chromium/base/run_loop.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/run_loop.h"

#include "base/cancelable_callback.h"
#include "base/check.h"
#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/observer_list.h"
#include "base/task/single_thread_task_runner.h"
#include "base/trace_event/base_tracing.h"
#include "build/build_config.h"
#include "third_party/abseil-cpp/absl/base/attributes.h"

namespace base {

namespace {

ABSL_CONST_INIT thread_local RunLoop::Delegate* delegate =;
ABSL_CONST_INIT thread_local const RunLoop::RunLoopTimeout* run_loop_timeout =;

// Runs |closure| immediately if this is called on |task_runner|, otherwise
// forwards |closure| to it.
void ProxyToTaskRunner(scoped_refptr<SequencedTaskRunner> task_runner,
                       OnceClosure closure) {}

void OnRunLoopTimeout(RunLoop* run_loop,
                      const Location& location,
                      OnceCallback<void(const Location&)> on_timeout) {}

}  // namespace

RunLoop::Delegate::Delegate() {}

RunLoop::Delegate::~Delegate() {}

bool RunLoop::Delegate::ShouldQuitWhenIdle() {}

// static
void RunLoop::RegisterDelegateForCurrentThread(Delegate* new_delegate) {}

RunLoop::RunLoop(Type type)
    :{}

RunLoop::~RunLoop() {}

void RunLoop::Run(const Location& location) {}

void RunLoop::RunUntilIdle() {}

void RunLoop::Quit() {}

void RunLoop::QuitWhenIdle() {}

RepeatingClosure RunLoop::QuitClosure() {}

RepeatingClosure RunLoop::QuitWhenIdleClosure() {}

bool RunLoop::AnyQuitCalled() {}

// static
bool RunLoop::IsRunningOnCurrentThread() {}

// static
bool RunLoop::IsNestedOnCurrentThread() {}

// static
void RunLoop::AddNestingObserverOnCurrentThread(NestingObserver* observer) {}

// static
void RunLoop::RemoveNestingObserverOnCurrentThread(NestingObserver* observer) {}


#if DCHECK_IS_ON()
ScopedDisallowRunningRunLoop::ScopedDisallowRunningRunLoop()
    :{}

ScopedDisallowRunningRunLoop::~ScopedDisallowRunningRunLoop() {}
#else   // DCHECK_IS_ON()
// Defined out of line so that the compiler doesn't inline these and realize
// the scope has no effect and then throws an "unused variable" warning in
// non-dcheck builds.
ScopedDisallowRunningRunLoop::ScopedDisallowRunningRunLoop() = default;
ScopedDisallowRunningRunLoop::~ScopedDisallowRunningRunLoop() = default;
#endif  // DCHECK_IS_ON()

RunLoop::RunLoopTimeout::RunLoopTimeout() = default;

RunLoop::RunLoopTimeout::~RunLoopTimeout() = default;

// static
void RunLoop::SetTimeoutForCurrentThread(const RunLoopTimeout* timeout) {}

// static
const RunLoop::RunLoopTimeout* RunLoop::GetTimeoutForCurrentThread() {}

bool RunLoop::BeforeRun() {}

void RunLoop::AfterRun() {}

}  // namespace base