#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 = …;
void ProxyToTaskRunner(scoped_refptr<SequencedTaskRunner> task_runner,
OnceClosure closure) { … }
void OnRunLoopTimeout(RunLoop* run_loop,
const Location& location,
OnceCallback<void(const Location&)> on_timeout) { … }
}
RunLoop::Delegate::Delegate() { … }
RunLoop::Delegate::~Delegate() { … }
bool RunLoop::Delegate::ShouldQuitWhenIdle() { … }
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() { … }
bool RunLoop::IsRunningOnCurrentThread() { … }
bool RunLoop::IsNestedOnCurrentThread() { … }
void RunLoop::AddNestingObserverOnCurrentThread(NestingObserver* observer) { … }
void RunLoop::RemoveNestingObserverOnCurrentThread(NestingObserver* observer) { … }
#if DCHECK_IS_ON()
ScopedDisallowRunningRunLoop::ScopedDisallowRunningRunLoop()
: … { … }
ScopedDisallowRunningRunLoop::~ScopedDisallowRunningRunLoop() { … }
#else
ScopedDisallowRunningRunLoop::ScopedDisallowRunningRunLoop() = default;
ScopedDisallowRunningRunLoop::~ScopedDisallowRunningRunLoop() = default;
#endif
RunLoop::RunLoopTimeout::RunLoopTimeout() = default;
RunLoop::RunLoopTimeout::~RunLoopTimeout() = default;
void RunLoop::SetTimeoutForCurrentThread(const RunLoopTimeout* timeout) { … }
const RunLoop::RunLoopTimeout* RunLoop::GetTimeoutForCurrentThread() { … }
bool RunLoop::BeforeRun() { … }
void RunLoop::AfterRun() { … }
}