diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-31 02:29:20 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-31 02:29:20 +0000 |
commit | 5e9e96aae1a78860b984124519f720163fc52a33 (patch) | |
tree | d29e8de21b25f313cf93d1c939fc1dd3083b92f4 | |
parent | 16efcd1cd7d75552d6ef14632030520d9bb3986c (diff) | |
download | chromium_src-5e9e96aae1a78860b984124519f720163fc52a33.zip chromium_src-5e9e96aae1a78860b984124519f720163fc52a33.tar.gz chromium_src-5e9e96aae1a78860b984124519f720163fc52a33.tar.bz2 |
Move MessageLoop to base namespace.
This adds a "using" to the header to avoid having to update everything at once. However, all forward declares and the locations that use the forward declares need to be updated (since they don't see the using in message_loop.h).
BUG=
Review URL: https://codereview.chromium.org/13243003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@191566 0039d316-1c4b-4281-b951-d872f2087c98
88 files changed, 465 insertions, 382 deletions
diff --git a/android_webview/browser/aw_browser_main_parts.h b/android_webview/browser/aw_browser_main_parts.h index 669833b..b43e53b 100644 --- a/android_webview/browser/aw_browser_main_parts.h +++ b/android_webview/browser/aw_browser_main_parts.h @@ -9,7 +9,9 @@ #include "base/memory/scoped_ptr.h" #include "content/public/browser/browser_main_parts.h" +namespace base { class MessageLoop; +} namespace android_webview { @@ -33,7 +35,7 @@ class AwBrowserMainParts : public content::BrowserMainParts { private: // Android specific UI MessageLoop. - scoped_ptr<MessageLoop> main_message_loop_; + scoped_ptr<base::MessageLoop> main_message_loop_; AwBrowserContext* browser_context_; // weak AwDevToolsDelegate* devtools_delegate_; diff --git a/base/message_loop.cc b/base/message_loop.cc index 544f1d4..c84c493 100644 --- a/base/message_loop.cc +++ b/base/message_loop.cc @@ -39,15 +39,13 @@ #include <gdk/gdkx.h> #endif -using base::PendingTask; -using base::TimeDelta; -using base::TimeTicks; +namespace base { namespace { // A lazily created thread local storage for quick access to a thread's message // loop, if one exists. This should be safe and free of static constructors. -base::LazyInstance<base::ThreadLocalPointer<MessageLoop> > lazy_tls_ptr = +LazyInstance<base::ThreadLocalPointer<MessageLoop> > lazy_tls_ptr = LAZY_INSTANCE_INITIALIZER; // Logical events for Histogram profiling. Run with -message-loop-histogrammer @@ -76,7 +74,7 @@ const int kNumberOfDistinctMessagesDisplayed = 1100; // in the pair (i.e., the quoted string) when printing out a histogram. #define VALUE_TO_NUMBER_AND_NAME(name) {name, #name}, -const base::LinearHistogram::DescriptionPair event_descriptions_[] = { +const LinearHistogram::DescriptionPair event_descriptions_[] = { // Provide some pretty print capability in our histogram for our internal // messages. @@ -149,30 +147,30 @@ MessageLoop::MessageLoop(Type type) DCHECK(!current()) << "should only have one message loop per thread"; lazy_tls_ptr.Pointer()->Set(this); - message_loop_proxy_ = new base::MessageLoopProxyImpl(); + message_loop_proxy_ = new MessageLoopProxyImpl(); thread_task_runner_handle_.reset( - new base::ThreadTaskRunnerHandle(message_loop_proxy_)); + new ThreadTaskRunnerHandle(message_loop_proxy_)); // TODO(rvargas): Get rid of the OS guards. #if defined(OS_WIN) -#define MESSAGE_PUMP_UI new base::MessagePumpForUI() -#define MESSAGE_PUMP_IO new base::MessagePumpForIO() +#define MESSAGE_PUMP_UI new MessagePumpForUI() +#define MESSAGE_PUMP_IO new MessagePumpForIO() #elif defined(OS_IOS) -#define MESSAGE_PUMP_UI base::MessagePumpMac::Create() -#define MESSAGE_PUMP_IO new base::MessagePumpIOSForIO() +#define MESSAGE_PUMP_UI MessagePumpMac::Create() +#define MESSAGE_PUMP_IO new MessagePumpIOSForIO() #elif defined(OS_MACOSX) -#define MESSAGE_PUMP_UI base::MessagePumpMac::Create() -#define MESSAGE_PUMP_IO new base::MessagePumpLibevent() +#define MESSAGE_PUMP_UI MessagePumpMac::Create() +#define MESSAGE_PUMP_IO new MessagePumpLibevent() #elif defined(OS_NACL) // Currently NaCl doesn't have a UI MessageLoop. // TODO(abarth): Figure out if we need this. #define MESSAGE_PUMP_UI NULL // ipc_channel_nacl.cc uses a worker thread to do socket reads currently, and // doesn't require extra support for watching file descriptors. -#define MESSAGE_PUMP_IO new base::MessagePumpDefault(); +#define MESSAGE_PUMP_IO new MessagePumpDefault(); #elif defined(OS_POSIX) // POSIX but not MACOSX. -#define MESSAGE_PUMP_UI new base::MessagePumpForUI() -#define MESSAGE_PUMP_IO new base::MessagePumpLibevent() +#define MESSAGE_PUMP_UI new MessagePumpForUI() +#define MESSAGE_PUMP_IO new MessagePumpLibevent() #else #error Not implemented #endif @@ -186,7 +184,7 @@ MessageLoop::MessageLoop(Type type) pump_ = MESSAGE_PUMP_IO; } else { DCHECK_EQ(TYPE_DEFAULT, type_); - pump_ = new base::MessagePumpDefault(); + pump_ = new MessagePumpDefault(); } } @@ -219,7 +217,7 @@ MessageLoop::~MessageLoop() { thread_task_runner_handle_.reset(); // Tell the message_loop_proxy that we are dying. - static_cast<base::MessageLoopProxyImpl*>(message_loop_proxy_.get())-> + static_cast<MessageLoopProxyImpl*>(message_loop_proxy_.get())-> WillDestroyCurrentMessageLoop(); message_loop_proxy_ = NULL; @@ -231,8 +229,8 @@ MessageLoop::~MessageLoop() { // Doing this is not-critical, it is mainly to make sure we track // the high resolution timer activations properly in our unit tests. if (!high_resolution_timer_expiration_.is_null()) { - base::Time::ActivateHighResolutionTimer(false); - high_resolution_timer_expiration_ = base::TimeTicks(); + Time::ActivateHighResolutionTimer(false); + high_resolution_timer_expiration_ = TimeTicks(); } #endif } @@ -272,7 +270,7 @@ void MessageLoop::RemoveDestructionObserver( } void MessageLoop::PostTask( - const tracked_objects::Location& from_here, const base::Closure& task) { + const tracked_objects::Location& from_here, const Closure& task) { DCHECK(!task.is_null()) << from_here.ToString(); PendingTask pending_task( from_here, task, CalculateDelayedRuntime(TimeDelta()), true); @@ -281,7 +279,7 @@ void MessageLoop::PostTask( void MessageLoop::PostDelayedTask( const tracked_objects::Location& from_here, - const base::Closure& task, + const Closure& task, TimeDelta delay) { DCHECK(!task.is_null()) << from_here.ToString(); PendingTask pending_task( @@ -291,7 +289,7 @@ void MessageLoop::PostDelayedTask( void MessageLoop::PostNonNestableTask( const tracked_objects::Location& from_here, - const base::Closure& task) { + const Closure& task) { DCHECK(!task.is_null()) << from_here.ToString(); PendingTask pending_task( from_here, task, CalculateDelayedRuntime(TimeDelta()), false); @@ -300,7 +298,7 @@ void MessageLoop::PostNonNestableTask( void MessageLoop::PostNonNestableDelayedTask( const tracked_objects::Location& from_here, - const base::Closure& task, + const Closure& task, TimeDelta delay) { DCHECK(!task.is_null()) << from_here.ToString(); PendingTask pending_task( @@ -309,12 +307,12 @@ void MessageLoop::PostNonNestableDelayedTask( } void MessageLoop::Run() { - base::RunLoop run_loop; + RunLoop run_loop; run_loop.Run(); } void MessageLoop::RunUntilIdle() { - base::RunLoop run_loop; + RunLoop run_loop; run_loop.RunUntilIdle(); } @@ -345,8 +343,8 @@ static void QuitCurrentWhenIdle() { } // static -base::Closure MessageLoop::QuitWhenIdleClosure() { - return base::Bind(&QuitCurrentWhenIdle); +Closure MessageLoop::QuitWhenIdleClosure() { + return Bind(&QuitCurrentWhenIdle); } void MessageLoop::SetNestableTasksAllowed(bool allowed) { @@ -379,7 +377,7 @@ void MessageLoop::RemoveTaskObserver(TaskObserver* task_observer) { void MessageLoop::AssertIdle() const { // We only check |incoming_queue_|, since we don't want to lock |work_queue_|. - base::AutoLock lock(incoming_queue_lock_); + AutoLock lock(incoming_queue_lock_); DCHECK(incoming_queue_.empty()); } @@ -424,7 +422,7 @@ void MessageLoop::RunInternal() { #if !defined(OS_MACOSX) && !defined(OS_ANDROID) if (run_loop_->dispatcher_ && type() == TYPE_UI) { - static_cast<base::MessagePumpForUI*>(pump_.get())-> + static_cast<MessagePumpForUI*>(pump_.get())-> RunWithDispatcher(this, run_loop_->dispatcher_); return; } @@ -464,7 +462,7 @@ void MessageLoop::RunTask(const PendingTask& pending_task) { // Look at a memory dump of the stack. const void* program_counter = pending_task.posted_from.program_counter(); - base::debug::Alias(&program_counter); + debug::Alias(&program_counter); HistogramEvent(kTaskRunEvent); @@ -512,7 +510,7 @@ void MessageLoop::ReloadWorkQueue() { // Acquire all we can from the inter-thread queue with one lock acquisition. { - base::AutoLock lock(incoming_queue_lock_); + AutoLock lock(incoming_queue_lock_); if (incoming_queue_.empty()) return; incoming_queue_.Swap(&work_queue_); // Constant time @@ -562,9 +560,9 @@ TimeTicks MessageLoop::CalculateDelayedRuntime(TimeDelta delay) { // res timers for any timer which is within 2x of the granularity. // This is a tradeoff between accuracy and power management. bool needs_high_res_timers = delay.InMilliseconds() < - (2 * base::Time::kMinLowResolutionThresholdMs); + (2 * Time::kMinLowResolutionThresholdMs); if (needs_high_res_timers) { - if (base::Time::ActivateHighResolutionTimer(true)) { + if (Time::ActivateHighResolutionTimer(true)) { high_resolution_timer_expiration_ = TimeTicks::Now() + TimeDelta::FromMilliseconds(kHighResolutionTimerModeLeaseTimeMs); } @@ -578,7 +576,7 @@ TimeTicks MessageLoop::CalculateDelayedRuntime(TimeDelta delay) { #if defined(OS_WIN) if (!high_resolution_timer_expiration_.is_null()) { if (TimeTicks::Now() > high_resolution_timer_expiration_) { - base::Time::ActivateHighResolutionTimer(false); + Time::ActivateHighResolutionTimer(false); high_resolution_timer_expiration_ = TimeTicks(); } } @@ -593,9 +591,9 @@ void MessageLoop::AddToIncomingQueue(PendingTask* pending_task) { // directly, as it could starve handling of foreign threads. Put every task // into this queue. - scoped_refptr<base::MessagePump> pump; + scoped_refptr<MessagePump> pump; { - base::AutoLock locked(incoming_queue_lock_); + AutoLock locked(incoming_queue_lock_); // Initialize the sequence number. The sequence number is used for delayed // tasks (to faciliate FIFO sorting when two tasks have the same @@ -628,9 +626,9 @@ void MessageLoop::AddToIncomingQueue(PendingTask* pending_task) { void MessageLoop::StartHistogrammer() { #if !defined(OS_NACL) // NaCl build has no metrics code. if (enable_histogrammer_ && !message_histogram_ - && base::StatisticsRecorder::IsActive()) { + && StatisticsRecorder::IsActive()) { DCHECK(!thread_name_.empty()); - message_histogram_ = base::LinearHistogram::FactoryGetWithRangeDescription( + message_histogram_ = LinearHistogram::FactoryGetWithRangeDescription( "MsgLoop:" + thread_name_, kLeastNonZeroMessageId, kMaxMessageId, kNumberOfDistinctMessagesDisplayed, @@ -722,14 +720,14 @@ bool MessageLoop::DoIdleWork() { void MessageLoop::DeleteSoonInternal(const tracked_objects::Location& from_here, void(*deleter)(const void*), const void* object) { - PostNonNestableTask(from_here, base::Bind(deleter, object)); + PostNonNestableTask(from_here, Bind(deleter, object)); } void MessageLoop::ReleaseSoonInternal( const tracked_objects::Location& from_here, void(*releaser)(const void*), const void* object) { - PostNonNestableTask(from_here, base::Bind(releaser, object)); + PostNonNestableTask(from_here, Bind(releaser, object)); } //------------------------------------------------------------------------------ @@ -744,13 +742,13 @@ void MessageLoopForUI::DidProcessMessage(const MSG& message) { #if defined(OS_ANDROID) void MessageLoopForUI::Start() { // No Histogram support for UI message loop as it is managed by Java side - static_cast<base::MessagePumpForUI*>(pump_.get())->Start(this); + static_cast<MessagePumpForUI*>(pump_.get())->Start(this); } #endif #if defined(OS_IOS) void MessageLoopForUI::Attach() { - static_cast<base::MessagePumpUIApplication*>(pump_.get())->Attach(this); + static_cast<MessagePumpUIApplication*>(pump_.get())->Attach(this); } #endif @@ -813,3 +811,5 @@ bool MessageLoopForIO::WatchFileDescriptor(int fd, } #endif + +} // namespace base diff --git a/base/message_loop.h b/base/message_loop.h index 13bf621..0de51ab 100644 --- a/base/message_loop.h +++ b/base/message_loop.h @@ -42,13 +42,13 @@ #endif namespace base { + class HistogramBase; class RunLoop; class ThreadTaskRunnerHandle; #if defined(OS_ANDROID) class MessagePumpForUI; #endif -} // namespace base // A MessageLoop is used to process events for a particular thread. There is // at most one MessageLoop instance per thread. @@ -705,4 +705,12 @@ class BASE_EXPORT MessageLoopForIO : public MessageLoop { COMPILE_ASSERT(sizeof(MessageLoop) == sizeof(MessageLoopForIO), MessageLoopForIO_should_not_have_extra_member_variables); +} // namespace base + +// TODO(brettw) remove this when all users are updated to explicitly use the +// namespace +using base::MessageLoop; +using base::MessageLoopForIO; +using base::MessageLoopForUI; + #endif // BASE_MESSAGE_LOOP_H_ diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc index 984a025..5a90a6f 100644 --- a/base/message_loop_unittest.cc +++ b/base/message_loop_unittest.cc @@ -23,18 +23,14 @@ #include "base/win/scoped_handle.h" #endif -using base::PlatformThread; -using base::Thread; -using base::Time; -using base::TimeDelta; -using base::TimeTicks; +namespace base { // TODO(darin): Platform-specific MessageLoop tests should be grouped together // to avoid chopping this file up with so many #ifdefs. namespace { -class Foo : public base::RefCounted<Foo> { +class Foo : public RefCounted<Foo> { public: Foo() : test_count_(0) { } @@ -73,7 +69,7 @@ class Foo : public base::RefCounted<Foo> { const std::string& result() const { return result_; } private: - friend class base::RefCounted<Foo>; + friend class RefCounted<Foo>; ~Foo() {} @@ -87,22 +83,22 @@ void RunTest_PostTask(MessageLoop::Type message_loop_type) { // Add tests to message loop scoped_refptr<Foo> foo(new Foo()); std::string a("a"), b("b"), c("c"), d("d"); - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + MessageLoop::current()->PostTask(FROM_HERE, Bind( &Foo::Test0, foo.get())); - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + MessageLoop::current()->PostTask(FROM_HERE, Bind( &Foo::Test1ConstRef, foo.get(), a)); - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + MessageLoop::current()->PostTask(FROM_HERE, Bind( &Foo::Test1Ptr, foo.get(), &b)); - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + MessageLoop::current()->PostTask(FROM_HERE, Bind( &Foo::Test1Int, foo.get(), 100)); - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + MessageLoop::current()->PostTask(FROM_HERE, Bind( &Foo::Test2Ptr, foo.get(), &a, &c)); - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + MessageLoop::current()->PostTask(FROM_HERE, Bind( &Foo::Test2Mixed, foo.get(), a, &d)); // After all tests, post a message that will shut down the message loop - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( - &MessageLoop::Quit, base::Unretained(MessageLoop::current()))); + MessageLoop::current()->PostTask(FROM_HERE, Bind( + &MessageLoop::Quit, Unretained(MessageLoop::current()))); // Now kick things off MessageLoop::current()->Run(); @@ -117,22 +113,22 @@ void RunTest_PostTask_SEH(MessageLoop::Type message_loop_type) { // Add tests to message loop scoped_refptr<Foo> foo(new Foo()); std::string a("a"), b("b"), c("c"), d("d"); - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + MessageLoop::current()->PostTask(FROM_HERE, Bind( &Foo::Test0, foo.get())); - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + MessageLoop::current()->PostTask(FROM_HERE, Bind( &Foo::Test1ConstRef, foo.get(), a)); - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + MessageLoop::current()->PostTask(FROM_HERE, Bind( &Foo::Test1Ptr, foo.get(), &b)); - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + MessageLoop::current()->PostTask(FROM_HERE, Bind( &Foo::Test1Int, foo.get(), 100)); - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + MessageLoop::current()->PostTask(FROM_HERE, Bind( &Foo::Test2Ptr, foo.get(), &a, &c)); - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + MessageLoop::current()->PostTask(FROM_HERE, Bind( &Foo::Test2Mixed, foo.get(), a, &d)); // After all tests, post a message that will shut down the message loop - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( - &MessageLoop::Quit, base::Unretained(MessageLoop::current()))); + MessageLoop::current()->PostTask(FROM_HERE, Bind( + &MessageLoop::Quit, Unretained(MessageLoop::current()))); // Now kick things off with the SEH block active. MessageLoop::current()->set_exception_restoration(true); @@ -172,7 +168,7 @@ void RunTest_PostDelayedTask_Basic(MessageLoop::Type message_loop_type) { Time run_time; loop.PostDelayedTask( - FROM_HERE, base::Bind(&RecordRunTimeFunc, &run_time, &num_tasks), + FROM_HERE, Bind(&RecordRunTimeFunc, &run_time, &num_tasks), kDelay); Time time_before_run = Time::Now(); @@ -193,13 +189,13 @@ void RunTest_PostDelayedTask_InDelayOrder( loop.PostDelayedTask( FROM_HERE, - base::Bind(&RecordRunTimeFunc, &run_time1, &num_tasks), + Bind(&RecordRunTimeFunc, &run_time1, &num_tasks), TimeDelta::FromMilliseconds(200)); // If we get a large pause in execution (due to a context switch) here, this // test could fail. loop.PostDelayedTask( FROM_HERE, - base::Bind(&RecordRunTimeFunc, &run_time2, &num_tasks), + Bind(&RecordRunTimeFunc, &run_time2, &num_tasks), TimeDelta::FromMilliseconds(10)); loop.Run(); @@ -227,10 +223,10 @@ void RunTest_PostDelayedTask_InPostOrder( loop.PostDelayedTask( FROM_HERE, - base::Bind(&RecordRunTimeFunc, &run_time1, &num_tasks), kDelay); + Bind(&RecordRunTimeFunc, &run_time1, &num_tasks), kDelay); loop.PostDelayedTask( FROM_HERE, - base::Bind(&RecordRunTimeFunc, &run_time2, &num_tasks), kDelay); + Bind(&RecordRunTimeFunc, &run_time2, &num_tasks), kDelay); loop.Run(); EXPECT_EQ(0, num_tasks); @@ -250,10 +246,10 @@ void RunTest_PostDelayedTask_InPostOrder_2( int num_tasks = 2; Time run_time; - loop.PostTask(FROM_HERE, base::Bind(&SlowFunc, kPause, &num_tasks)); + loop.PostTask(FROM_HERE, Bind(&SlowFunc, kPause, &num_tasks)); loop.PostDelayedTask( FROM_HERE, - base::Bind(&RecordRunTimeFunc, &run_time, &num_tasks), + Bind(&RecordRunTimeFunc, &run_time, &num_tasks), TimeDelta::FromMilliseconds(10)); Time time_before_run = Time::Now(); @@ -281,10 +277,10 @@ void RunTest_PostDelayedTask_InPostOrder_3( // Clutter the ML with tasks. for (int i = 1; i < num_tasks; ++i) loop.PostTask(FROM_HERE, - base::Bind(&RecordRunTimeFunc, &run_time1, &num_tasks)); + Bind(&RecordRunTimeFunc, &run_time1, &num_tasks)); loop.PostDelayedTask( - FROM_HERE, base::Bind(&RecordRunTimeFunc, &run_time2, &num_tasks), + FROM_HERE, Bind(&RecordRunTimeFunc, &run_time2, &num_tasks), TimeDelta::FromMilliseconds(1)); loop.Run(); @@ -307,11 +303,11 @@ void RunTest_PostDelayedTask_SharedTimer( loop.PostDelayedTask( FROM_HERE, - base::Bind(&RecordRunTimeFunc, &run_time1, &num_tasks), + Bind(&RecordRunTimeFunc, &run_time1, &num_tasks), TimeDelta::FromSeconds(1000)); loop.PostDelayedTask( FROM_HERE, - base::Bind(&RecordRunTimeFunc, &run_time2, &num_tasks), + Bind(&RecordRunTimeFunc, &run_time2, &num_tasks), TimeDelta::FromMilliseconds(10)); Time start_time = Time::Now(); @@ -327,7 +323,7 @@ void RunTest_PostDelayedTask_SharedTimer( // and then run all pending to force them both to have run. This is just // encouraging flakiness if there is any. PlatformThread::Sleep(TimeDelta::FromMilliseconds(100)); - base::RunLoop().RunUntilIdle(); + RunLoop().RunUntilIdle(); EXPECT_TRUE(run_time1.is_null()); EXPECT_FALSE(run_time2.is_null()); @@ -356,18 +352,18 @@ void RunTest_PostDelayedTask_SharedTimer_SubPump() { int num_tasks = 1; Time run_time; - loop.PostTask(FROM_HERE, base::Bind(&SubPumpFunc)); + loop.PostTask(FROM_HERE, Bind(&SubPumpFunc)); // This very delayed task should never run. loop.PostDelayedTask( FROM_HERE, - base::Bind(&RecordRunTimeFunc, &run_time, &num_tasks), + Bind(&RecordRunTimeFunc, &run_time, &num_tasks), TimeDelta::FromSeconds(1000)); // This slightly delayed task should run from within SubPumpFunc). loop.PostDelayedTask( FROM_HERE, - base::Bind(&PostQuitMessage, 0), + Bind(&PostQuitMessage, 0), TimeDelta::FromMilliseconds(10)); Time start_time = Time::Now(); @@ -383,7 +379,7 @@ void RunTest_PostDelayedTask_SharedTimer_SubPump() { // and then run all pending to force them both to have run. This is just // encouraging flakiness if there is any. PlatformThread::Sleep(TimeDelta::FromMilliseconds(100)); - base::RunLoop().RunUntilIdle(); + RunLoop().RunUntilIdle(); EXPECT_TRUE(run_time.is_null()); } @@ -393,7 +389,7 @@ void RunTest_PostDelayedTask_SharedTimer_SubPump() { // This is used to inject a test point for recording the destructor calls for // Closure objects send to MessageLoop::PostTask(). It is awkward usage since we // are trying to hook the actual destruction, which is not a common operation. -class RecordDeletionProbe : public base::RefCounted<RecordDeletionProbe> { +class RecordDeletionProbe : public RefCounted<RecordDeletionProbe> { public: RecordDeletionProbe(RecordDeletionProbe* post_on_delete, bool* was_deleted) : post_on_delete_(post_on_delete), was_deleted_(was_deleted) { @@ -401,14 +397,14 @@ class RecordDeletionProbe : public base::RefCounted<RecordDeletionProbe> { void Run() {} private: - friend class base::RefCounted<RecordDeletionProbe>; + friend class RefCounted<RecordDeletionProbe>; ~RecordDeletionProbe() { *was_deleted_ = true; if (post_on_delete_) MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&RecordDeletionProbe::Run, post_on_delete_.get())); + Bind(&RecordDeletionProbe::Run, post_on_delete_.get())); } scoped_refptr<RecordDeletionProbe> post_on_delete_; @@ -421,11 +417,11 @@ void RunTest_EnsureDeletion(MessageLoop::Type message_loop_type) { { MessageLoop loop(message_loop_type); loop.PostTask( - FROM_HERE, base::Bind(&RecordDeletionProbe::Run, + FROM_HERE, Bind(&RecordDeletionProbe::Run, new RecordDeletionProbe(NULL, &a_was_deleted))); // TODO(ajwong): Do we really need 1000ms here? loop.PostDelayedTask( - FROM_HERE, base::Bind(&RecordDeletionProbe::Run, + FROM_HERE, Bind(&RecordDeletionProbe::Run, new RecordDeletionProbe(NULL, &b_was_deleted)), TimeDelta::FromMilliseconds(1000)); } @@ -444,7 +440,7 @@ void RunTest_EnsureDeletion_Chain(MessageLoop::Type message_loop_type) { RecordDeletionProbe* a = new RecordDeletionProbe(NULL, &a_was_deleted); RecordDeletionProbe* b = new RecordDeletionProbe(a, &b_was_deleted); RecordDeletionProbe* c = new RecordDeletionProbe(b, &c_was_deleted); - loop.PostTask(FROM_HERE, base::Bind(&RecordDeletionProbe::Run, c)); + loop.PostTask(FROM_HERE, Bind(&RecordDeletionProbe::Run, c)); } EXPECT_TRUE(a_was_deleted); EXPECT_TRUE(b_was_deleted); @@ -455,7 +451,7 @@ void NestingFunc(int* depth) { if (*depth > 0) { *depth -= 1; MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&NestingFunc, depth)); + Bind(&NestingFunc, depth)); MessageLoop::current()->SetNestableTasksAllowed(true); MessageLoop::current()->Run(); @@ -473,7 +469,7 @@ LONG WINAPI BadExceptionHandler(EXCEPTION_POINTERS *ex_info) { // This task throws an SEH exception: initially write to an invalid address. // If the right SEH filter is installed, it will fix the error. -class Crasher : public base::RefCounted<Crasher> { +class Crasher : public RefCounted<Crasher> { public: // Ctor. If trash_SEH_handler is true, the task will override the unhandled // exception handler with one sure to crash this test. @@ -552,7 +548,7 @@ void RunTest_Crasher(MessageLoop::Type message_loop_type) { MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&Crasher::Run, new Crasher(false))); + Bind(&Crasher::Run, new Crasher(false))); MessageLoop::current()->set_exception_restoration(true); MessageLoop::current()->Run(); MessageLoop::current()->set_exception_restoration(false); @@ -571,7 +567,7 @@ void RunTest_CrasherNasty(MessageLoop::Type message_loop_type) { MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&Crasher::Run, new Crasher(true))); + Bind(&Crasher::Run, new Crasher(true))); MessageLoop::current()->set_exception_restoration(true); MessageLoop::current()->Run(); MessageLoop::current()->set_exception_restoration(false); @@ -586,7 +582,7 @@ void RunTest_Nesting(MessageLoop::Type message_loop_type) { int depth = 100; MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&NestingFunc, &depth)); + Bind(&NestingFunc, &depth)); MessageLoop::current()->Run(); EXPECT_EQ(depth, 0); } @@ -714,7 +710,7 @@ void RecursiveFunc(TaskList* order, int cookie, int depth, MessageLoop::current()->SetNestableTasksAllowed(true); MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&RecursiveFunc, order, cookie, depth - 1, is_reentrant)); + Bind(&RecursiveFunc, order, cookie, depth - 1, is_reentrant)); } order->RecordEnd(RECURSIVE, cookie); } @@ -744,11 +740,11 @@ void RecursiveFuncWin(MessageLoop* target, TaskList* order, bool is_reentrant) { target->PostTask(FROM_HERE, - base::Bind(&RecursiveFunc, order, 1, 2, is_reentrant)); + Bind(&RecursiveFunc, order, 1, 2, is_reentrant)); target->PostTask(FROM_HERE, - base::Bind(&MessageBoxFunc, order, 2, is_reentrant)); + Bind(&MessageBoxFunc, order, 2, is_reentrant)); target->PostTask(FROM_HERE, - base::Bind(&RecursiveFunc, order, 3, 2, is_reentrant)); + Bind(&RecursiveFunc, order, 3, 2, is_reentrant)); // The trick here is that for recursive task processing, this task will be // ran _inside_ the MessageBox message loop, dismissing the MessageBox // without a chance. @@ -756,9 +752,9 @@ void RecursiveFuncWin(MessageLoop* target, // MessageBox will have been dismissed by the code below, where // expect_window_ is true. target->PostTask(FROM_HERE, - base::Bind(&EndDialogFunc, order, 4)); + Bind(&EndDialogFunc, order, 4)); target->PostTask(FROM_HERE, - base::Bind(&QuitFunc, order, 5)); + Bind(&QuitFunc, order, 5)); // Enforce that every tasks are sent before starting to run the main thread // message loop. @@ -792,13 +788,13 @@ void RunTest_RecursiveDenial1(MessageLoop::Type message_loop_type) { TaskList order; MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&RecursiveFunc, &order, 1, 2, false)); + Bind(&RecursiveFunc, &order, 1, 2, false)); MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&RecursiveFunc, &order, 2, 2, false)); + Bind(&RecursiveFunc, &order, 2, 2, false)); MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&QuitFunc, &order, 3)); + Bind(&QuitFunc, &order, 3)); MessageLoop::current()->Run(); @@ -826,16 +822,16 @@ void RunTest_RecursiveDenial3(MessageLoop::Type message_loop_type) { EXPECT_TRUE(MessageLoop::current()->NestableTasksAllowed()); TaskList order; MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&RecursiveSlowFunc, &order, 1, 2, false)); + FROM_HERE, Bind(&RecursiveSlowFunc, &order, 1, 2, false)); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&RecursiveSlowFunc, &order, 2, 2, false)); + FROM_HERE, Bind(&RecursiveSlowFunc, &order, 2, 2, false)); MessageLoop::current()->PostDelayedTask( FROM_HERE, - base::Bind(&OrderedFunc, &order, 3), + Bind(&OrderedFunc, &order, 3), TimeDelta::FromMilliseconds(5)); MessageLoop::current()->PostDelayedTask( FROM_HERE, - base::Bind(&QuitFunc, &order, 4), + Bind(&QuitFunc, &order, 4), TimeDelta::FromMilliseconds(5)); MessageLoop::current()->Run(); @@ -865,11 +861,11 @@ void RunTest_RecursiveSupport1(MessageLoop::Type message_loop_type) { TaskList order; MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&RecursiveFunc, &order, 1, 2, true)); + FROM_HERE, Bind(&RecursiveFunc, &order, 1, 2, true)); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&RecursiveFunc, &order, 2, 2, true)); + FROM_HERE, Bind(&RecursiveFunc, &order, 2, 2, true)); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&QuitFunc, &order, 3)); + FROM_HERE, Bind(&QuitFunc, &order, 3)); MessageLoop::current()->Run(); @@ -904,9 +900,9 @@ void RunTest_RecursiveDenial2(MessageLoop::Type message_loop_type) { options.message_loop_type = message_loop_type; ASSERT_EQ(true, worker.StartWithOptions(options)); TaskList order; - base::win::ScopedHandle event(CreateEvent(NULL, FALSE, FALSE, NULL)); + win::ScopedHandle event(CreateEvent(NULL, FALSE, FALSE, NULL)); worker.message_loop()->PostTask(FROM_HERE, - base::Bind(&RecursiveFuncWin, + Bind(&RecursiveFuncWin, MessageLoop::current(), event.Get(), true, @@ -948,9 +944,9 @@ void RunTest_RecursiveSupport2(MessageLoop::Type message_loop_type) { options.message_loop_type = message_loop_type; ASSERT_EQ(true, worker.StartWithOptions(options)); TaskList order; - base::win::ScopedHandle event(CreateEvent(NULL, FALSE, FALSE, NULL)); + win::ScopedHandle event(CreateEvent(NULL, FALSE, FALSE, NULL)); worker.message_loop()->PostTask(FROM_HERE, - base::Bind(&RecursiveFuncWin, + Bind(&RecursiveFuncWin, MessageLoop::current(), event.Get(), false, @@ -972,7 +968,7 @@ void RunTest_RecursiveSupport2(MessageLoop::Type message_loop_type) { EXPECT_EQ(order.Get(7), TaskItem(MESSAGEBOX, 2, false)); /* The order can subtly change here. The reason is that when RecursiveFunc(1) is called in the main thread, if it is faster than getting to the - PostTask(FROM_HERE, base::Bind(&QuitFunc) execution, the order of task + PostTask(FROM_HERE, Bind(&QuitFunc) execution, the order of task execution can change. We don't care anyway that the order isn't correct. EXPECT_EQ(order.Get(8), TaskItem(QUITMESSAGELOOP, 5, true)); EXPECT_EQ(order.Get(9), TaskItem(QUITMESSAGELOOP, 5, false)); @@ -993,12 +989,12 @@ void FuncThatPumps(TaskList* order, int cookie) { order->RecordStart(PUMPS, cookie); { MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); - base::RunLoop().RunUntilIdle(); + RunLoop().RunUntilIdle(); } order->RecordEnd(PUMPS, cookie); } -void FuncThatRuns(TaskList* order, int cookie, base::RunLoop* run_loop) { +void FuncThatRuns(TaskList* order, int cookie, RunLoop* run_loop) { order->RecordStart(RUNS, cookie); { MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); @@ -1020,11 +1016,11 @@ void RunTest_NonNestableWithNoNesting( MessageLoop::current()->PostNonNestableTask( FROM_HERE, - base::Bind(&OrderedFunc, &order, 1)); + Bind(&OrderedFunc, &order, 1)); MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&OrderedFunc, &order, 2)); + Bind(&OrderedFunc, &order, 2)); MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&QuitFunc, &order, 3)); + Bind(&QuitFunc, &order, 3)); MessageLoop::current()->Run(); // FIFO order. @@ -1046,33 +1042,33 @@ void RunTest_NonNestableInNestedLoop(MessageLoop::Type message_loop_type, MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&FuncThatPumps, &order, 1)); + Bind(&FuncThatPumps, &order, 1)); if (use_delayed) { MessageLoop::current()->PostNonNestableDelayedTask( FROM_HERE, - base::Bind(&OrderedFunc, &order, 2), + Bind(&OrderedFunc, &order, 2), TimeDelta::FromMilliseconds(1)); } else { MessageLoop::current()->PostNonNestableTask( FROM_HERE, - base::Bind(&OrderedFunc, &order, 2)); + Bind(&OrderedFunc, &order, 2)); } MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&OrderedFunc, &order, 3)); + Bind(&OrderedFunc, &order, 3)); MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&SleepFunc, &order, 4, TimeDelta::FromMilliseconds(50))); + Bind(&SleepFunc, &order, 4, TimeDelta::FromMilliseconds(50))); MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&OrderedFunc, &order, 5)); + Bind(&OrderedFunc, &order, 5)); if (use_delayed) { MessageLoop::current()->PostNonNestableDelayedTask( FROM_HERE, - base::Bind(&QuitFunc, &order, 6), + Bind(&QuitFunc, &order, 6), TimeDelta::FromMilliseconds(2)); } else { MessageLoop::current()->PostNonNestableTask( FROM_HERE, - base::Bind(&QuitFunc, &order, 6)); + Bind(&QuitFunc, &order, 6)); } MessageLoop::current()->Run(); @@ -1099,20 +1095,20 @@ void RunTest_QuitNow(MessageLoop::Type message_loop_type) { TaskList order; - base::RunLoop run_loop; + RunLoop run_loop; MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&FuncThatRuns, &order, 1, base::Unretained(&run_loop))); + Bind(&FuncThatRuns, &order, 1, Unretained(&run_loop))); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 2)); + FROM_HERE, Bind(&OrderedFunc, &order, 2)); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&FuncThatQuitsNow)); + FROM_HERE, Bind(&FuncThatQuitsNow)); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 3)); + FROM_HERE, Bind(&OrderedFunc, &order, 3)); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&FuncThatQuitsNow)); + FROM_HERE, Bind(&FuncThatQuitsNow)); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 4)); // never runs + FROM_HERE, Bind(&OrderedFunc, &order, 4)); // never runs MessageLoop::current()->Run(); @@ -1133,14 +1129,14 @@ void RunTest_RunLoopQuitOrderBefore(MessageLoop::Type message_loop_type) { TaskList order; - base::RunLoop run_loop; + RunLoop run_loop; run_loop.Quit(); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 1)); // never runs + FROM_HERE, Bind(&OrderedFunc, &order, 1)); // never runs MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&FuncThatQuitsNow)); // never runs + FROM_HERE, Bind(&FuncThatQuitsNow)); // never runs run_loop.Run(); @@ -1153,16 +1149,16 @@ void RunTest_RunLoopQuitOrderDuring(MessageLoop::Type message_loop_type) { TaskList order; - base::RunLoop run_loop; + RunLoop run_loop; MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 1)); + FROM_HERE, Bind(&OrderedFunc, &order, 1)); MessageLoop::current()->PostTask( FROM_HERE, run_loop.QuitClosure()); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 2)); // never runs + FROM_HERE, Bind(&OrderedFunc, &order, 2)); // never runs MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&FuncThatQuitsNow)); // never runs + FROM_HERE, Bind(&FuncThatQuitsNow)); // never runs run_loop.Run(); @@ -1179,24 +1175,24 @@ void RunTest_RunLoopQuitOrderAfter(MessageLoop::Type message_loop_type) { TaskList order; - base::RunLoop run_loop; + RunLoop run_loop; MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&FuncThatRuns, &order, 1, base::Unretained(&run_loop))); + Bind(&FuncThatRuns, &order, 1, Unretained(&run_loop))); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 2)); + FROM_HERE, Bind(&OrderedFunc, &order, 2)); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&FuncThatQuitsNow)); + FROM_HERE, Bind(&FuncThatQuitsNow)); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 3)); + FROM_HERE, Bind(&OrderedFunc, &order, 3)); MessageLoop::current()->PostTask( FROM_HERE, run_loop.QuitClosure()); // has no affect MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 4)); + FROM_HERE, Bind(&OrderedFunc, &order, 4)); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&FuncThatQuitsNow)); + FROM_HERE, Bind(&FuncThatQuitsNow)); - base::RunLoop outer_run_loop; + RunLoop outer_run_loop; outer_run_loop.Run(); ASSERT_EQ(8U, order.Size()); @@ -1218,15 +1214,15 @@ void RunTest_RunLoopQuitTop(MessageLoop::Type message_loop_type) { TaskList order; - base::RunLoop outer_run_loop; - base::RunLoop nested_run_loop; + RunLoop outer_run_loop; + RunLoop nested_run_loop; MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&FuncThatRuns, &order, 1, base::Unretained(&nested_run_loop))); + Bind(&FuncThatRuns, &order, 1, Unretained(&nested_run_loop))); MessageLoop::current()->PostTask( FROM_HERE, outer_run_loop.QuitClosure()); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 2)); + FROM_HERE, Bind(&OrderedFunc, &order, 2)); MessageLoop::current()->PostTask( FROM_HERE, nested_run_loop.QuitClosure()); @@ -1247,15 +1243,15 @@ void RunTest_RunLoopQuitNested(MessageLoop::Type message_loop_type) { TaskList order; - base::RunLoop outer_run_loop; - base::RunLoop nested_run_loop; + RunLoop outer_run_loop; + RunLoop nested_run_loop; MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&FuncThatRuns, &order, 1, base::Unretained(&nested_run_loop))); + Bind(&FuncThatRuns, &order, 1, Unretained(&nested_run_loop))); MessageLoop::current()->PostTask( FROM_HERE, nested_run_loop.QuitClosure()); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 2)); + FROM_HERE, Bind(&OrderedFunc, &order, 2)); MessageLoop::current()->PostTask( FROM_HERE, outer_run_loop.QuitClosure()); @@ -1276,16 +1272,16 @@ void RunTest_RunLoopQuitBogus(MessageLoop::Type message_loop_type) { TaskList order; - base::RunLoop outer_run_loop; - base::RunLoop nested_run_loop; - base::RunLoop bogus_run_loop; + RunLoop outer_run_loop; + RunLoop nested_run_loop; + RunLoop bogus_run_loop; MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&FuncThatRuns, &order, 1, base::Unretained(&nested_run_loop))); + Bind(&FuncThatRuns, &order, 1, Unretained(&nested_run_loop))); MessageLoop::current()->PostTask( FROM_HERE, bogus_run_loop.QuitClosure()); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 2)); + FROM_HERE, Bind(&OrderedFunc, &order, 2)); MessageLoop::current()->PostTask( FROM_HERE, outer_run_loop.QuitClosure()); MessageLoop::current()->PostTask( @@ -1308,42 +1304,42 @@ void RunTest_RunLoopQuitDeep(MessageLoop::Type message_loop_type) { TaskList order; - base::RunLoop outer_run_loop; - base::RunLoop nested_loop1; - base::RunLoop nested_loop2; - base::RunLoop nested_loop3; - base::RunLoop nested_loop4; + RunLoop outer_run_loop; + RunLoop nested_loop1; + RunLoop nested_loop2; + RunLoop nested_loop3; + RunLoop nested_loop4; MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&FuncThatRuns, &order, 1, base::Unretained(&nested_loop1))); + Bind(&FuncThatRuns, &order, 1, Unretained(&nested_loop1))); MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&FuncThatRuns, &order, 2, base::Unretained(&nested_loop2))); + Bind(&FuncThatRuns, &order, 2, Unretained(&nested_loop2))); MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&FuncThatRuns, &order, 3, base::Unretained(&nested_loop3))); + Bind(&FuncThatRuns, &order, 3, Unretained(&nested_loop3))); MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&FuncThatRuns, &order, 4, base::Unretained(&nested_loop4))); + Bind(&FuncThatRuns, &order, 4, Unretained(&nested_loop4))); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 5)); + FROM_HERE, Bind(&OrderedFunc, &order, 5)); MessageLoop::current()->PostTask( FROM_HERE, outer_run_loop.QuitClosure()); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 6)); + FROM_HERE, Bind(&OrderedFunc, &order, 6)); MessageLoop::current()->PostTask( FROM_HERE, nested_loop1.QuitClosure()); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 7)); + FROM_HERE, Bind(&OrderedFunc, &order, 7)); MessageLoop::current()->PostTask( FROM_HERE, nested_loop2.QuitClosure()); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 8)); + FROM_HERE, Bind(&OrderedFunc, &order, 8)); MessageLoop::current()->PostTask( FROM_HERE, nested_loop3.QuitClosure()); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 9)); + FROM_HERE, Bind(&OrderedFunc, &order, 9)); MessageLoop::current()->PostTask( FROM_HERE, nested_loop4.QuitClosure()); MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&OrderedFunc, &order, 10)); + FROM_HERE, Bind(&OrderedFunc, &order, 10)); outer_run_loop.Run(); @@ -1374,7 +1370,7 @@ void PostNTasksThenQuit(int posts_remaining) { if (posts_remaining > 1) { MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&PostNTasksThenQuit, posts_remaining - 1)); + Bind(&PostNTasksThenQuit, posts_remaining - 1)); } else { MessageLoop::current()->QuitWhenIdle(); } @@ -1383,7 +1379,7 @@ void PostNTasksThenQuit(int posts_remaining) { void RunTest_RecursivePosts(MessageLoop::Type message_loop_type, int num_times) { MessageLoop loop(message_loop_type); - loop.PostTask(FROM_HERE, base::Bind(&PostNTasksThenQuit, num_times)); + loop.PostTask(FROM_HERE, Bind(&PostNTasksThenQuit, num_times)); loop.Run(); } @@ -1393,7 +1389,7 @@ class DispatcherImpl : public MessageLoopForUI::Dispatcher { public: DispatcherImpl() : dispatch_count_(0) {} - virtual bool Dispatch(const base::NativeEvent& msg) OVERRIDE { + virtual bool Dispatch(const NativeEvent& msg) OVERRIDE { ::TranslateMessage(&msg); ::DispatchMessage(&msg); // Do not count WM_TIMER since it is not what we post and it will cause @@ -1417,16 +1413,16 @@ void RunTest_Dispatcher(MessageLoop::Type message_loop_type) { MessageLoop::current()->PostDelayedTask( FROM_HERE, - base::Bind(&MouseDownUp), + Bind(&MouseDownUp), TimeDelta::FromMilliseconds(100)); DispatcherImpl dispatcher; - base::RunLoop run_loop(&dispatcher); + RunLoop run_loop(&dispatcher); run_loop.Run(); ASSERT_EQ(2, dispatcher.dispatch_count_); } LRESULT CALLBACK MsgFilterProc(int code, WPARAM wparam, LPARAM lparam) { - if (code == base::MessagePumpForUI::kMessageFilterCode) { + if (code == MessagePumpForUI::kMessageFilterCode) { MSG* msg = reinterpret_cast<MSG*>(lparam); if (msg->message == WM_LBUTTONDOWN) return TRUE; @@ -1439,14 +1435,14 @@ void RunTest_DispatcherWithMessageHook(MessageLoop::Type message_loop_type) { MessageLoop::current()->PostDelayedTask( FROM_HERE, - base::Bind(&MouseDownUp), + Bind(&MouseDownUp), TimeDelta::FromMilliseconds(100)); HHOOK msg_hook = SetWindowsHookEx(WH_MSGFILTER, MsgFilterProc, NULL, GetCurrentThreadId()); DispatcherImpl dispatcher; - base::RunLoop run_loop(&dispatcher); + RunLoop run_loop(&dispatcher); run_loop.Run(); ASSERT_EQ(1, dispatcher.dispatch_count_); UnhookWindowsHookEx(msg_hook); @@ -1468,7 +1464,7 @@ class TestIOHandler : public MessageLoopForIO::IOHandler { char buffer_[48]; MessageLoopForIO::IOContext context_; HANDLE signal_; - base::win::ScopedHandle file_; + win::ScopedHandle file_; bool wait_; }; @@ -1505,11 +1501,11 @@ void TestIOHandler::WaitForIO() { } void RunTest_IOHandler() { - base::win::ScopedHandle callback_called(CreateEvent(NULL, TRUE, FALSE, NULL)); + win::ScopedHandle callback_called(CreateEvent(NULL, TRUE, FALSE, NULL)); ASSERT_TRUE(callback_called.IsValid()); const wchar_t* kPipeName = L"\\\\.\\pipe\\iohandler_pipe"; - base::win::ScopedHandle server( + win::ScopedHandle server( CreateNamedPipe(kPipeName, PIPE_ACCESS_OUTBOUND, 0, 1, 0, 0, 0, NULL)); ASSERT_TRUE(server.IsValid()); @@ -1522,10 +1518,10 @@ void RunTest_IOHandler() { ASSERT_TRUE(NULL != thread_loop); TestIOHandler handler(kPipeName, callback_called, false); - thread_loop->PostTask(FROM_HERE, base::Bind(&TestIOHandler::Init, - base::Unretained(&handler))); + thread_loop->PostTask(FROM_HERE, Bind(&TestIOHandler::Init, + Unretained(&handler))); // Make sure the thread runs and sleeps for lack of work. - base::PlatformThread::Sleep(TimeDelta::FromMilliseconds(100)); + PlatformThread::Sleep(TimeDelta::FromMilliseconds(100)); const char buffer[] = "Hello there!"; DWORD written; @@ -1538,18 +1534,18 @@ void RunTest_IOHandler() { } void RunTest_WaitForIO() { - base::win::ScopedHandle callback1_called( + win::ScopedHandle callback1_called( CreateEvent(NULL, TRUE, FALSE, NULL)); - base::win::ScopedHandle callback2_called( + win::ScopedHandle callback2_called( CreateEvent(NULL, TRUE, FALSE, NULL)); ASSERT_TRUE(callback1_called.IsValid()); ASSERT_TRUE(callback2_called.IsValid()); const wchar_t* kPipeName1 = L"\\\\.\\pipe\\iohandler_pipe1"; const wchar_t* kPipeName2 = L"\\\\.\\pipe\\iohandler_pipe2"; - base::win::ScopedHandle server1( + win::ScopedHandle server1( CreateNamedPipe(kPipeName1, PIPE_ACCESS_OUTBOUND, 0, 1, 0, 0, 0, NULL)); - base::win::ScopedHandle server2( + win::ScopedHandle server2( CreateNamedPipe(kPipeName2, PIPE_ACCESS_OUTBOUND, 0, 1, 0, 0, 0, NULL)); ASSERT_TRUE(server1.IsValid()); ASSERT_TRUE(server2.IsValid()); @@ -1564,15 +1560,15 @@ void RunTest_WaitForIO() { TestIOHandler handler1(kPipeName1, callback1_called, false); TestIOHandler handler2(kPipeName2, callback2_called, true); - thread_loop->PostTask(FROM_HERE, base::Bind(&TestIOHandler::Init, - base::Unretained(&handler1))); + thread_loop->PostTask(FROM_HERE, Bind(&TestIOHandler::Init, + Unretained(&handler1))); // TODO(ajwong): Do we really need such long Sleeps in ths function? // Make sure the thread runs and sleeps for lack of work. TimeDelta delay = TimeDelta::FromMilliseconds(100); - base::PlatformThread::Sleep(delay); - thread_loop->PostTask(FROM_HERE, base::Bind(&TestIOHandler::Init, - base::Unretained(&handler2))); - base::PlatformThread::Sleep(delay); + PlatformThread::Sleep(delay); + thread_loop->PostTask(FROM_HERE, Bind(&TestIOHandler::Init, + Unretained(&handler2))); + PlatformThread::Sleep(delay); // At this time handler1 is waiting to be called, and the thread is waiting // on the Init method of handler2, filtering only handler2 callbacks. @@ -1580,7 +1576,7 @@ void RunTest_WaitForIO() { const char buffer[] = "Hello there!"; DWORD written; EXPECT_TRUE(WriteFile(server1, buffer, sizeof(buffer), &written, NULL)); - base::PlatformThread::Sleep(2 * delay); + PlatformThread::Sleep(2 * delay); EXPECT_EQ(WAIT_TIMEOUT, WaitForSingleObject(callback1_called, 0)) << "handler1 has not been called"; @@ -1801,14 +1797,14 @@ class DummyTaskObserver : public MessageLoop::TaskObserver { virtual ~DummyTaskObserver() {} - virtual void WillProcessTask(const base::PendingTask& pending_task) OVERRIDE { + virtual void WillProcessTask(const PendingTask& pending_task) OVERRIDE { num_tasks_started_++; EXPECT_TRUE(pending_task.time_posted != TimeTicks()); EXPECT_LE(num_tasks_started_, num_tasks_); EXPECT_EQ(num_tasks_started_, num_tasks_processed_ + 1); } - virtual void DidProcessTask(const base::PendingTask& pending_task) OVERRIDE { + virtual void DidProcessTask(const PendingTask& pending_task) OVERRIDE { num_tasks_processed_++; EXPECT_TRUE(pending_task.time_posted != TimeTicks()); EXPECT_LE(num_tasks_started_, num_tasks_); @@ -1832,7 +1828,7 @@ TEST(MessageLoopTest, TaskObserver) { MessageLoop loop; loop.AddTaskObserver(&observer); - loop.PostTask(FROM_HERE, base::Bind(&PostNTasksThenQuit, kNumPosts)); + loop.PostTask(FROM_HERE, Bind(&PostNTasksThenQuit, kNumPosts)); loop.Run(); loop.RemoveTaskObserver(&observer); @@ -1868,24 +1864,24 @@ TEST(MessageLoopTest, HighResolutionTimer) { EXPECT_FALSE(loop.high_resolution_timers_enabled()); // Post a fast task to enable the high resolution timers. - loop.PostDelayedTask(FROM_HERE, base::Bind(&PostNTasksThenQuit, 1), + loop.PostDelayedTask(FROM_HERE, Bind(&PostNTasksThenQuit, 1), kFastTimer); loop.Run(); EXPECT_TRUE(loop.high_resolution_timers_enabled()); // Post a slow task and verify high resolution timers // are still enabled. - loop.PostDelayedTask(FROM_HERE, base::Bind(&PostNTasksThenQuit, 1), + loop.PostDelayedTask(FROM_HERE, Bind(&PostNTasksThenQuit, 1), kSlowTimer); loop.Run(); EXPECT_TRUE(loop.high_resolution_timers_enabled()); // Wait for a while so that high-resolution mode elapses. - base::PlatformThread::Sleep(TimeDelta::FromMilliseconds( + PlatformThread::Sleep(TimeDelta::FromMilliseconds( MessageLoop::kHighResolutionTimerModeLeaseTimeMs)); // Post a slow task to disable the high resolution timers. - loop.PostDelayedTask(FROM_HERE, base::Bind(&PostNTasksThenQuit, 1), + loop.PostDelayedTask(FROM_HERE, Bind(&PostNTasksThenQuit, 1), kSlowTimer); loop.Run(); EXPECT_FALSE(loop.high_resolution_timers_enabled()); @@ -1970,7 +1966,7 @@ namespace { // send to MessageLoop::PostTask(). It is awkward usage since we are trying to // hook the actual destruction, which is not a common operation. class DestructionObserverProbe : - public base::RefCounted<DestructionObserverProbe> { + public RefCounted<DestructionObserverProbe> { public: DestructionObserverProbe(bool* task_destroyed, bool* destruction_observer_called) @@ -1982,7 +1978,7 @@ class DestructionObserverProbe : ADD_FAILURE(); } private: - friend class base::RefCounted<DestructionObserverProbe>; + friend class RefCounted<DestructionObserverProbe>; virtual ~DestructionObserverProbe() { EXPECT_FALSE(*destruction_observer_called_); @@ -2028,7 +2024,7 @@ TEST(MessageLoopTest, DestructionObserverTest) { loop->AddDestructionObserver(&observer); loop->PostDelayedTask( FROM_HERE, - base::Bind(&DestructionObserverProbe::Run, + Bind(&DestructionObserverProbe::Run, new DestructionObserverProbe(&task_destroyed, &destruction_observer_called)), kDelay); @@ -2047,12 +2043,12 @@ TEST(MessageLoopTest, ThreadMainTaskRunner) { scoped_refptr<Foo> foo(new Foo()); std::string a("a"); - base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, base::Bind( + ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, Bind( &Foo::Test1ConstRef, foo.get(), a)); // Post quit task; - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( - &MessageLoop::Quit, base::Unretained(MessageLoop::current()))); + MessageLoop::current()->PostTask(FROM_HERE, Bind( + &MessageLoop::Quit, Unretained(MessageLoop::current()))); // Now kick things off MessageLoop::current()->Run(); @@ -2082,3 +2078,5 @@ TEST(MessageLoopTest, RecursivePosts) { RunTest_RecursivePosts(MessageLoop::TYPE_UI, kNumTimes); RunTest_RecursivePosts(MessageLoop::TYPE_IO, kNumTimes); } + +} // namespace base diff --git a/base/test/sequenced_worker_pool_owner.h b/base/test/sequenced_worker_pool_owner.h index c6c8d676..1cc3fd6 100644 --- a/base/test/sequenced_worker_pool_owner.h +++ b/base/test/sequenced_worker_pool_owner.h @@ -15,10 +15,10 @@ #include "base/synchronization/lock.h" #include "base/threading/sequenced_worker_pool.h" -class MessageLoop; - namespace base { +class MessageLoop; + // Wrapper around SequencedWorkerPool for testing that blocks destruction // until the pool is actually destroyed. This is so that a // SequencedWorkerPool from one test doesn't outlive its test and cause diff --git a/base/timer.h b/base/timer.h index 95cae12..bbcbae2 100644 --- a/base/timer.h +++ b/base/timer.h @@ -56,11 +56,10 @@ #include "base/location.h" #include "base/time.h" -class MessageLoop; - namespace base { class BaseTimerTaskInternal; +class MessageLoop; //----------------------------------------------------------------------------- // This class wraps MessageLoop::PostDelayedTask to manage delayed and repeating diff --git a/cc/test/cc_test_suite.h b/cc/test/cc_test_suite.h index 0d1ca4f..d1a71fd 100644 --- a/cc/test/cc_test_suite.h +++ b/cc/test/cc_test_suite.h @@ -9,7 +9,9 @@ #include "base/memory/scoped_ptr.h" #include "base/test/test_suite.h" +namespace base { class MessageLoop; +} namespace cc { @@ -24,7 +26,7 @@ class CCTestSuite : public base::TestSuite { virtual void Shutdown() OVERRIDE; private: - scoped_ptr<MessageLoop> message_loop_; + scoped_ptr<base::MessageLoop> message_loop_; DISALLOW_COPY_AND_ASSIGN(CCTestSuite); }; diff --git a/chrome/browser/autocomplete/history_url_provider.h b/chrome/browser/autocomplete/history_url_provider.h index 7d40a08..1a3a3ea 100644 --- a/chrome/browser/autocomplete/history_url_provider.h +++ b/chrome/browser/autocomplete/history_url_provider.h @@ -17,9 +17,12 @@ #include "chrome/browser/search_engines/search_terms_data.h" #include "chrome/browser/search_engines/template_url.h" -class MessageLoop; class Profile; +namespace base { +class MessageLoop; +} + namespace history { class HistoryBackend; class URLDatabase; @@ -93,7 +96,7 @@ struct HistoryURLProviderParams { const SearchTermsData& search_terms_data); ~HistoryURLProviderParams(); - MessageLoop* message_loop; + base::MessageLoop* message_loop; // A copy of the autocomplete input. We need the copy since this object will // live beyond the original query while it runs on the history thread. diff --git a/chrome/browser/chromeos/login/user_image_loader.h b/chrome/browser/chromeos/login/user_image_loader.h index a3b7384..bc069ce 100644 --- a/chrome/browser/chromeos/login/user_image_loader.h +++ b/chrome/browser/chromeos/login/user_image_loader.h @@ -15,9 +15,12 @@ #include "base/threading/sequenced_worker_pool.h" #include "chrome/browser/image_decoder.h" -class MessageLoop; class SkBitmap; +namespace base { +class MessageLoop; +} + namespace chromeos { typedef base::SequencedWorkerPool::SequenceToken SequenceToken; @@ -77,7 +80,7 @@ class UserImageLoader : public base::RefCountedThreadSafe<UserImageLoader>, virtual void OnDecodeImageFailed(const ImageDecoder* decoder) OVERRIDE; // The message loop object of the thread in which we notify the delegate. - MessageLoop* target_message_loop_; + base::MessageLoop* target_message_loop_; // Specify how the file should be decoded in the utility process. const ImageDecoder::ImageCodec image_codec_; diff --git a/chrome/browser/devtools/devtools_adb_bridge.h b/chrome/browser/devtools/devtools_adb_bridge.h index 82710ad..17c0716 100644 --- a/chrome/browser/devtools/devtools_adb_bridge.h +++ b/chrome/browser/devtools/devtools_adb_bridge.h @@ -15,11 +15,11 @@ #include "net/socket/tcp_client_socket.h" namespace base { -class Thread; +class MessageLoop; class DictionaryValue; +class Thread; } -class MessageLoop; class Profile; class DevToolsAdbBridge { @@ -78,7 +78,7 @@ class DevToolsAdbBridge { public: static scoped_refptr<RefCountedAdbThread> GetInstance(); RefCountedAdbThread(); - MessageLoop* message_loop(); + base::MessageLoop* message_loop(); private: friend class base::RefCounted<RefCountedAdbThread>; diff --git a/chrome/browser/extensions/extension_error_reporter.h b/chrome/browser/extensions/extension_error_reporter.h index 070f26d..5b0801d 100644 --- a/chrome/browser/extensions/extension_error_reporter.h +++ b/chrome/browser/extensions/extension_error_reporter.h @@ -10,7 +10,9 @@ #include "base/string16.h" +namespace base { class MessageLoop; +} // Exposes an easy way for the various components of the extension system to // report errors. This is a singleton that lives on the UI thread, with the @@ -45,7 +47,7 @@ class ExtensionErrorReporter { explicit ExtensionErrorReporter(bool enable_noisy_errors); ~ExtensionErrorReporter(); - MessageLoop* ui_loop_; + base::MessageLoop* ui_loop_; std::vector<string16> errors_; bool enable_noisy_errors_; }; diff --git a/chrome/browser/extensions/extension_install_prompt.h b/chrome/browser/extensions/extension_install_prompt.h index 55c32c6..bc109c7 100644 --- a/chrome/browser/extensions/extension_install_prompt.h +++ b/chrome/browser/extensions/extension_install_prompt.h @@ -23,11 +23,11 @@ class Browser; class ExtensionInstallUI; class InfoBarDelegate; -class MessageLoop; class Profile; namespace base { class DictionaryValue; +class MessageLoop; } // namespace base namespace content { @@ -336,7 +336,7 @@ class ExtensionInstallPrompt // Shows the actual UI (the icon should already be loaded). void ShowConfirmation(); - MessageLoop* ui_loop_; + base::MessageLoop* ui_loop_; // The extensions installation icon. SkBitmap icon_; diff --git a/chrome/browser/extensions/extension_uninstall_dialog.h b/chrome/browser/extensions/extension_uninstall_dialog.h index ea1b4dc..729d50f 100644 --- a/chrome/browser/extensions/extension_uninstall_dialog.h +++ b/chrome/browser/extensions/extension_uninstall_dialog.h @@ -14,9 +14,12 @@ #include "ui/gfx/image/image_skia.h" class Browser; -class MessageLoop; class Profile; +namespace base { +class MessageLoop; +} + namespace extensions { class Extension; } @@ -110,7 +113,7 @@ class ExtensionUninstallDialog }; State state_; - MessageLoop* ui_loop_; + base::MessageLoop* ui_loop_; content::NotificationRegistrar registrar_; diff --git a/chrome/browser/google/google_update_win.h b/chrome/browser/google/google_update_win.h index 67105a1..9b673de 100644 --- a/chrome/browser/google/google_update_win.h +++ b/chrome/browser/google/google_update_win.h @@ -10,7 +10,10 @@ #include "base/string16.h" #include "google_update/google_update_idl.h" +namespace base { class MessageLoop; +} + namespace views { class Widget; } @@ -108,7 +111,8 @@ class GoogleUpdate : public base::RefCountedThreadSafe<GoogleUpdate> { // listener. // Note, after this function completes, this object will have deleted itself. bool ReportFailure(HRESULT hr, GoogleUpdateErrorCode error_code, - const string16& error_message, MessageLoop* main_loop); + const string16& error_message, + base::MessageLoop* main_loop); // The update check needs to run on another thread than the main thread, and // therefore CheckForUpdate will delegate to this function. |main_loop| points @@ -116,7 +120,7 @@ class GoogleUpdate : public base::RefCountedThreadSafe<GoogleUpdate> { // |window| should point to a foreground window. This is needed to ensure that // Vista/Windows 7 UAC prompts show up in the foreground. It may also be null. void InitiateGoogleUpdateCheck(bool install_if_newer, HWND window, - MessageLoop* main_loop); + base::MessageLoop* main_loop); // This function reports the results of the GoogleUpdate operation to the // listener. If results indicates an error, the |error_code| and diff --git a/chrome/browser/importer/firefox_importer_unittest_utils.h b/chrome/browser/importer/firefox_importer_unittest_utils.h index 1d6cc69..480b09e 100644 --- a/chrome/browser/importer/firefox_importer_unittest_utils.h +++ b/chrome/browser/importer/firefox_importer_unittest_utils.h @@ -11,10 +11,14 @@ #include "chrome/browser/importer/nss_decryptor.h" class FFDecryptorServerChannelListener; + +namespace base { +class MessageLoopForIO; +} + namespace IPC { - class Channel; +class Channel; } // namespace IPC -class MessageLoopForIO; // On OS X NSSDecryptor needs to run in a separate process. To allow us to use // the same unit test on all platforms we use a proxy class which spawns a @@ -52,7 +56,7 @@ class FFUnitTestDecryptorProxy { base::ProcessHandle child_process_; scoped_ptr<IPC::Channel> channel_; scoped_ptr<FFDecryptorServerChannelListener> listener_; - scoped_ptr<MessageLoopForIO> message_loop_; + scoped_ptr<base::MessageLoopForIO> message_loop_; #else NSSDecryptor decryptor_; #endif // !OS_MACOSX diff --git a/chrome/browser/printing/print_job_worker_owner.h b/chrome/browser/printing/print_job_worker_owner.h index 7224fd3..8f9f585 100644 --- a/chrome/browser/printing/print_job_worker_owner.h +++ b/chrome/browser/printing/print_job_worker_owner.h @@ -8,7 +8,10 @@ #include "base/memory/ref_counted.h" #include "printing/printing_context.h" +namespace base { class MessageLoop; +} + namespace printing { @@ -28,7 +31,7 @@ class PrintJobWorkerOwner virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) = 0; // Retrieves the message loop that is expected to process GetSettingsDone. - virtual MessageLoop* message_loop() = 0; + virtual base::MessageLoop* message_loop() = 0; // Access the current settings. virtual const PrintSettings& settings() const = 0; diff --git a/chrome/browser/printing/printer_query.h b/chrome/browser/printing/printer_query.h index 80545c7..3256a91 100644 --- a/chrome/browser/printing/printer_query.h +++ b/chrome/browser/printing/printer_query.h @@ -12,10 +12,9 @@ #include "printing/print_job_constants.h" #include "ui/gfx/native_widget_types.h" -class MessageLoop; - namespace base { class DictionaryValue; +class MessageLoop; } namespace printing { @@ -38,7 +37,7 @@ class PrinterQuery : public PrintJobWorkerOwner { virtual void GetSettingsDone(const PrintSettings& new_settings, PrintingContext::Result result) OVERRIDE; virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) OVERRIDE; - virtual MessageLoop* message_loop() OVERRIDE; + virtual base::MessageLoop* message_loop() OVERRIDE; virtual const PrintSettings& settings() const OVERRIDE; virtual int cookie() const OVERRIDE; @@ -79,7 +78,7 @@ class PrinterQuery : public PrintJobWorkerOwner { // Main message loop reference. Used to send notifications in the right // thread. - MessageLoop* const io_message_loop_; + base::MessageLoop* const io_message_loop_; // All the UI is done in a worker thread because many Win32 print functions // are blocking and enters a message loop without your consent. There is one diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h index 3a294db..91edef2 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.h +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.h @@ -39,11 +39,11 @@ #include "googleurl/src/gurl.h" class MalwareDetails; -class MessageLoop; class SafeBrowsingBlockingPageFactory; namespace base { class DictionaryValue; +class MessageLoop; } namespace content { @@ -156,7 +156,7 @@ class SafeBrowsingBlockingPage : public content::InterstitialPageDelegate { // For reporting back user actions. SafeBrowsingUIManager* ui_manager_; - MessageLoop* report_loop_; + base::MessageLoop* report_loop_; // True if the interstitial is blocking the main page because it is on one // of our lists. False if a subresource is being blocked, or in the case of diff --git a/chrome/browser/safe_browsing/safe_browsing_database.h b/chrome/browser/safe_browsing/safe_browsing_database.h index 27a7f8f..856226b 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database.h +++ b/chrome/browser/safe_browsing/safe_browsing_database.h @@ -16,7 +16,8 @@ #include "chrome/browser/safe_browsing/safe_browsing_store.h" namespace base { - class Time; +class MessageLoop; +class Time; } namespace safe_browsing { @@ -24,7 +25,6 @@ class PrefixSet; } class GURL; -class MessageLoop; class SafeBrowsingDatabase; // Factory for creating SafeBrowsingDatabase. Tests implement this factory @@ -344,7 +344,7 @@ class SafeBrowsingDatabaseNew : public SafeBrowsingDatabase { // Used to verify that various calls are made from the thread the // object was created on. - MessageLoop* creation_loop_; + base::MessageLoop* creation_loop_; // Lock for protecting access to variables that may be used on the // IO thread. This includes |prefix_set_|, |full_browse_hashes_|, diff --git a/chrome/browser/sync/glue/password_change_processor.h b/chrome/browser/sync/glue/password_change_processor.h index 54430bd..ed4b54c 100644 --- a/chrome/browser/sync/glue/password_change_processor.h +++ b/chrome/browser/sync/glue/password_change_processor.h @@ -17,7 +17,10 @@ #include "content/public/browser/notification_types.h" class PasswordStore; + +namespace base { class MessageLoop; +} namespace browser_sync { @@ -77,7 +80,7 @@ class PasswordChangeProcessor : public ChangeProcessor, content::NotificationRegistrar notification_registrar_; - MessageLoop* expected_loop_; + base::MessageLoop* expected_loop_; DISALLOW_COPY_AND_ASSIGN(PasswordChangeProcessor); }; diff --git a/chrome/browser/sync/glue/password_model_associator.h b/chrome/browser/sync/glue/password_model_associator.h index 303df9f..c1e2cf3 100644 --- a/chrome/browser/sync/glue/password_model_associator.h +++ b/chrome/browser/sync/glue/password_model_associator.h @@ -17,10 +17,13 @@ #include "chrome/browser/sync/glue/model_associator.h" #include "sync/protocol/password_specifics.pb.h" -class MessageLoop; class PasswordStore; class ProfileSyncService; +namespace base { +class MessageLoop; +} + namespace content { struct PasswordForm; } @@ -133,7 +136,7 @@ class PasswordModelAssociator base::Lock abort_association_pending_lock_; bool abort_association_pending_; - MessageLoop* expected_loop_; + base::MessageLoop* expected_loop_; PasswordToSyncIdMap id_map_; SyncIdToPasswordMap id_map_inverse_; diff --git a/chrome/browser/sync/glue/sync_backend_host.h b/chrome/browser/sync/glue/sync_backend_host.h index 32a2354..f32709e 100644 --- a/chrome/browser/sync/glue/sync_backend_host.h +++ b/chrome/browser/sync/glue/sync_backend_host.h @@ -34,9 +34,12 @@ #include "sync/protocol/encryption.pb.h" #include "sync/protocol/sync_protocol_error.h" -class MessageLoop; class Profile; +namespace base { +class MessageLoop; +} + namespace syncer { class SyncManagerFactory; } @@ -307,7 +310,7 @@ class SyncBackendHost struct DoInitializeOptions { DoInitializeOptions( - MessageLoop* sync_loop, + base::MessageLoop* sync_loop, SyncBackendRegistrar* registrar, const syncer::ModelSafeRoutingInfo& routing_info, const std::vector<syncer::ModelSafeWorker*>& workers, @@ -328,7 +331,7 @@ class SyncBackendHost report_unrecoverable_error_function); ~DoInitializeOptions(); - MessageLoop* sync_loop; + base::MessageLoop* sync_loop; SyncBackendRegistrar* registrar; syncer::ModelSafeRoutingInfo routing_info; std::vector<syncer::ModelSafeWorker*> workers; @@ -509,7 +512,7 @@ class SyncBackendHost // A reference to the MessageLoop used to construct |this|, so we know how // to safely talk back to the SyncFrontend. - MessageLoop* const frontend_loop_; + base::MessageLoop* const frontend_loop_; Profile* const profile_; diff --git a/chrome/browser/sync/glue/sync_backend_registrar.h b/chrome/browser/sync/glue/sync_backend_registrar.h index a02c5d8..f43e279 100644 --- a/chrome/browser/sync/glue/sync_backend_registrar.h +++ b/chrome/browser/sync/glue/sync_backend_registrar.h @@ -16,9 +16,12 @@ #include "sync/internal_api/public/engine/model_safe_worker.h" #include "sync/internal_api/public/sync_manager.h" -class MessageLoop; class Profile; +namespace base { +class MessageLoop; +} + namespace syncer { struct UserShare; } // namespace syncer @@ -37,7 +40,7 @@ class SyncBackendRegistrar : public syncer::SyncManager::ChangeDelegate { // |sync_loop|. Must be created on the UI thread. SyncBackendRegistrar(const std::string& name, Profile* profile, - MessageLoop* sync_loop); + base::MessageLoop* sync_loop); // Informs the SyncBackendRegistrar of the currently enabled set of types. // These types will be placed in the passive group. This function should be @@ -128,7 +131,7 @@ class SyncBackendRegistrar : public syncer::SyncManager::ChangeDelegate { Profile* const profile_; - MessageLoop* const sync_loop_; + base::MessageLoop* const sync_loop_; const scoped_refptr<UIModelWorker> ui_worker_; diff --git a/chrome/browser/sync/glue/typed_url_change_processor.h b/chrome/browser/sync/glue/typed_url_change_processor.h index 619a8eb..823c45c 100644 --- a/chrome/browser/sync/glue/typed_url_change_processor.h +++ b/chrome/browser/sync/glue/typed_url_change_processor.h @@ -17,9 +17,12 @@ #include "content/public/browser/notification_registrar.h" #include "content/public/browser/notification_types.h" -class MessageLoop; class Profile; +namespace base { +class MessageLoop; +} + namespace content { class NotificationService; } @@ -101,7 +104,7 @@ class TypedUrlChangeProcessor : public ChangeProcessor, content::NotificationRegistrar notification_registrar_; - MessageLoop* expected_loop_; + base::MessageLoop* expected_loop_; scoped_ptr<content::NotificationService> notification_service_; diff --git a/chrome/browser/sync/glue/typed_url_model_associator.h b/chrome/browser/sync/glue/typed_url_model_associator.h index 3a49993..66c3841 100644 --- a/chrome/browser/sync/glue/typed_url_model_associator.h +++ b/chrome/browser/sync/glue/typed_url_model_associator.h @@ -19,9 +19,12 @@ #include "sync/protocol/typed_url_specifics.pb.h" class GURL; -class MessageLoop; class ProfileSyncService; +namespace base { +class MessageLoop; +} + namespace history { class HistoryBackend; class URLRow; @@ -187,7 +190,7 @@ class TypedUrlModelAssociator : public AssociatorInterface { ProfileSyncService* sync_service_; history::HistoryBackend* history_backend_; - MessageLoop* expected_loop_; + base::MessageLoop* expected_loop_; // Lock to ensure exclusive access to the pending_abort_ flag. base::Lock pending_abort_lock_; diff --git a/chrome/browser/sync/glue/ui_model_worker.h b/chrome/browser/sync/glue/ui_model_worker.h index ae5839b..8704ec4 100644 --- a/chrome/browser/sync/glue/ui_model_worker.h +++ b/chrome/browser/sync/glue/ui_model_worker.h @@ -12,8 +12,6 @@ #include "sync/internal_api/public/engine/model_safe_worker.h" #include "sync/internal_api/public/util/unrecoverable_error_info.h" -class MessageLoop; - namespace browser_sync { // A syncer::ModelSafeWorker for UI models (e.g. bookmarks) that diff --git a/chrome/browser/ui/views/sync/one_click_signin_bubble_view.h b/chrome/browser/ui/views/sync/one_click_signin_bubble_view.h index 720d7c4..78de25d 100644 --- a/chrome/browser/ui/views/sync/one_click_signin_bubble_view.h +++ b/chrome/browser/ui/views/sync/one_click_signin_bubble_view.h @@ -16,7 +16,9 @@ #include "ui/views/controls/button/button.h" #include "ui/views/controls/link_listener.h" +namespace base { class MessageLoop; +} namespace views { class GridLayout; @@ -108,7 +110,7 @@ class OneClickSigninBubbleView : public views::BubbleDelegateView, BrowserWindow::StartSyncCallback start_sync_callback_; // A message loop used only with unit tests. - MessageLoop* message_loop_for_testing_; + base::MessageLoop* message_loop_for_testing_; DISALLOW_COPY_AND_ASSIGN(OneClickSigninBubbleView); }; diff --git a/chrome/browser/ui/webui/ntp/thumbnail_source.cc b/chrome/browser/ui/webui/ntp/thumbnail_source.cc index 3a4895b..5f3f6f7 100644 --- a/chrome/browser/ui/webui/ntp/thumbnail_source.cc +++ b/chrome/browser/ui/webui/ntp/thumbnail_source.cc @@ -68,7 +68,7 @@ std::string ThumbnailSource::GetMimeType(const std::string&) const { return "image/png"; } -MessageLoop* ThumbnailSource::MessageLoopForRequestPath( +base::MessageLoop* ThumbnailSource::MessageLoopForRequestPath( const std::string& path) const { // TopSites can be accessed from the IO thread. return thumbnail_service_.get() ? diff --git a/chrome/browser/ui/webui/ntp/thumbnail_source.h b/chrome/browser/ui/webui/ntp/thumbnail_source.h index 0c43451..8ceefac 100644 --- a/chrome/browser/ui/webui/ntp/thumbnail_source.h +++ b/chrome/browser/ui/webui/ntp/thumbnail_source.h @@ -35,7 +35,7 @@ class ThumbnailSource : public content::URLDataSource { bool is_incognito, const content::URLDataSource::GotDataCallback& callback) OVERRIDE; virtual std::string GetMimeType(const std::string& path) const OVERRIDE; - virtual MessageLoop* MessageLoopForRequestPath( + virtual base::MessageLoop* MessageLoopForRequestPath( const std::string& path) const OVERRIDE; virtual bool ShouldServiceRequest( const net::URLRequest* request) const OVERRIDE; diff --git a/chrome/browser/ui/webui/theme_source.h b/chrome/browser/ui/webui/theme_source.h index 2ec2f22..0ab44c1 100644 --- a/chrome/browser/ui/webui/theme_source.h +++ b/chrome/browser/ui/webui/theme_source.h @@ -30,7 +30,7 @@ class ThemeSource : public content::URLDataSource { bool is_incognito, const content::URLDataSource::GotDataCallback& callback) OVERRIDE; virtual std::string GetMimeType(const std::string& path) const OVERRIDE; - virtual MessageLoop* MessageLoopForRequestPath( + virtual base::MessageLoop* MessageLoopForRequestPath( const std::string& path) const OVERRIDE; virtual bool ShouldReplaceExistingSource() const OVERRIDE; virtual bool ShouldServiceRequest( diff --git a/chrome/browser/webdata/web_data_request_manager.h b/chrome/browser/webdata/web_data_request_manager.h index 1e1db64..c834113 100644 --- a/chrome/browser/webdata/web_data_request_manager.h +++ b/chrome/browser/webdata/web_data_request_manager.h @@ -17,11 +17,14 @@ #include "chrome/browser/api/webdata/web_data_service_base.h" #include "chrome/browser/api/webdata/web_data_service_consumer.h" -class MessageLoop; class WebDataService; class WebDataServiceConsumer; class WebDataRequestManager; +namespace base { +class MessageLoop; +} + ////////////////////////////////////////////////////////////////////////////// // // Webdata requests @@ -42,7 +45,7 @@ class WebDataRequest { WebDataServiceConsumer* GetConsumer() const; // Retrieves the original message loop the of the request. - MessageLoop* GetMessageLoop() const; + base::MessageLoop* GetMessageLoop() const; // Returns |true| if the request was cancelled via the |Cancel()| method. bool IsCancelled() const; @@ -67,7 +70,7 @@ class WebDataRequest { WebDataRequestManager* manager_; // Tracks loop that the request originated on. - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; // Identifier for this request. WebDataServiceBase::Handle handle_; diff --git a/chrome/browser/webdata/web_data_service.h b/chrome/browser/webdata/web_data_service.h index 9b61701..0902ec5 100644 --- a/chrome/browser/webdata/web_data_service.h +++ b/chrome/browser/webdata/web_data_service.h @@ -31,7 +31,6 @@ class GURL; #if defined(OS_WIN) struct IE7PasswordInfo; #endif -class MessageLoop; class Profile; class SkBitmap; class WebDatabaseService; diff --git a/chrome/common/mac/mock_launchd.h b/chrome/common/mac/mock_launchd.h index b88b23a5..d5e00bd 100644 --- a/chrome/common/mac/mock_launchd.h +++ b/chrome/common/mac/mock_launchd.h @@ -15,7 +15,9 @@ #include "chrome/common/mac/launchd.h" #include "chrome/common/multi_process_lock.h" +namespace base { class MessageLoop; +} // TODO(dmaclach): Write this in terms of a real mock. // http://crbug.com/76923 @@ -26,7 +28,7 @@ class MockLaunchd : public Launchd { base::FilePath* bundle_root, base::FilePath* executable); - MockLaunchd(const base::FilePath& file, MessageLoop* loop, + MockLaunchd(const base::FilePath& file, base::MessageLoop* loop, bool create_socket, bool as_service); virtual ~MockLaunchd(); @@ -62,7 +64,7 @@ class MockLaunchd : public Launchd { private: base::FilePath file_; std::string pipe_name_; - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; scoped_ptr<MultiProcessLock> running_lock_; bool create_socket_; bool as_service_; diff --git a/chrome_frame/urlmon_url_request.h b/chrome_frame/urlmon_url_request.h index 3ec3a9e..24d8f5e 100644 --- a/chrome_frame/urlmon_url_request.h +++ b/chrome_frame/urlmon_url_request.h @@ -16,6 +16,7 @@ #include "chrome_frame/utils.h" namespace base { +class MessageLoop; class Thread; } @@ -75,7 +76,7 @@ class UrlmonUrlRequestManager } private: - friend class MessageLoop; + friend class base::MessageLoop; // PluginUrlRequestManager implementation. virtual PluginUrlRequestManager::ThreadSafeFlags GetThreadSafeFlags(); diff --git a/content/browser/browser_main_loop.h b/content/browser/browser_main_loop.h index 25e15a0..9118309 100644 --- a/content/browser/browser_main_loop.h +++ b/content/browser/browser_main_loop.h @@ -11,9 +11,9 @@ class CommandLine; class HighResolutionTimerManager; -class MessageLoop; namespace base { +class MessageLoop; class SystemMonitor; } @@ -93,7 +93,7 @@ class BrowserMainLoop { int result_code_; // Members initialized in |MainMessageLoopStart()| --------------------------- - scoped_ptr<MessageLoop> main_message_loop_; + scoped_ptr<base::MessageLoop> main_message_loop_; scoped_ptr<base::SystemMonitor> system_monitor_; scoped_ptr<HighResolutionTimerManager> hi_res_timer_manager_; scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; diff --git a/content/browser/device_orientation/provider_impl.h b/content/browser/device_orientation/provider_impl.h index 6706f06..be7cf3b0 100644 --- a/content/browser/device_orientation/provider_impl.h +++ b/content/browser/device_orientation/provider_impl.h @@ -16,7 +16,9 @@ #include "content/browser/device_orientation/provider.h" #include "content/common/content_export.h" +namespace base { class MessageLoop; +} namespace content { @@ -55,7 +57,7 @@ class ProviderImpl : public Provider { // The Message Loop on which this object was created. // Typically the I/O loop, but may be something else during testing. - MessageLoop* creator_loop_; + base::MessageLoop* creator_loop_; // Members below are only to be used from the creator_loop_. DataFetcherFactory factory_; diff --git a/content/browser/histogram_synchronizer.h b/content/browser/histogram_synchronizer.h index 0968abd..0b279a0 100644 --- a/content/browser/histogram_synchronizer.h +++ b/content/browser/histogram_synchronizer.h @@ -15,7 +15,9 @@ #include "base/time.h" #include "content/browser/histogram_subscriber.h" +namespace base { class MessageLoop; +} namespace content { @@ -68,7 +70,7 @@ class HistogramSynchronizer : public HistogramSubscriber { // changes to histograms. When all changes have been acquired, or when the // wait time expires (whichever is sooner), post the callback to the // specified message loop. Note the callback is posted exactly once. - static void FetchHistogramsAsynchronously(MessageLoop* callback_thread, + static void FetchHistogramsAsynchronously(base::MessageLoop* callback_thread, const base::Closure& callback, base::TimeDelta wait_time); @@ -109,13 +111,14 @@ class HistogramSynchronizer : public HistogramSubscriber { // callaback_thread_. This side effect should not generally happen, but is in // place to assure correctness (that any tasks that were set, are eventually // called, and never merely discarded). - void SetCallbackTaskAndThread(MessageLoop* callback_thread, + void SetCallbackTaskAndThread(base::MessageLoop* callback_thread, const base::Closure& callback); void ForceHistogramSynchronizationDoneCallback(int sequence_number); // Internal helper function, to post task, and record callback stats. - void InternalPostTask(MessageLoop* thread, const base::Closure& callback); + void InternalPostTask(base::MessageLoop* thread, + const base::Closure& callback); // Gets a new sequence number to be sent to processes from browser process. int GetNextAvailableSequenceNumber(ProcessHistogramRequester requester); @@ -127,7 +130,7 @@ class HistogramSynchronizer : public HistogramSubscriber { // the task and thread we use to post a completion notification in // callback_ and callback_thread_. base::Closure callback_; - MessageLoop* callback_thread_; + base::MessageLoop* callback_thread_; // We don't track the actual processes that are contacted for an update, only // the count of the number of processes, and we can sometimes time-out and diff --git a/content/common/child_histogram_message_filter.h b/content/common/child_histogram_message_filter.h index 4955d49..9339d8e 100644 --- a/content/common/child_histogram_message_filter.h +++ b/content/common/child_histogram_message_filter.h @@ -14,8 +14,6 @@ #include "base/metrics/histogram_snapshot_manager.h" #include "ipc/ipc_channel_proxy.h" -class MessageLoop; - namespace base { class HistogramSamples; } // namespace base diff --git a/content/common/child_thread.h b/content/common/child_thread.h index ed9e684..6664d34 100644 --- a/content/common/child_thread.h +++ b/content/common/child_thread.h @@ -15,7 +15,9 @@ #include "ipc/ipc_message.h" // For IPC_MESSAGE_LOG_ENABLED. #include "webkit/glue/resource_loader_bridge.h" +namespace base { class MessageLoop; +} namespace IPC { class SyncChannel; @@ -104,7 +106,7 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender { return histogram_message_filter_.get(); } - MessageLoop* message_loop() const { return message_loop_; } + base::MessageLoop* message_loop() const { return message_loop_; } // Returns the one child thread. static ChildThread* current(); @@ -166,7 +168,7 @@ class CONTENT_EXPORT ChildThread : public IPC::Listener, public IPC::Sender { // attempt to communicate. bool on_channel_error_called_; - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; scoped_ptr<FileSystemDispatcher> file_system_dispatcher_; diff --git a/content/common/gpu/client/gpu_channel_host.h b/content/common/gpu/client/gpu_channel_host.h index 9f55d5a..1bac9ec 100644 --- a/content/common/gpu/client/gpu_channel_host.h +++ b/content/common/gpu/client/gpu_channel_host.h @@ -29,11 +29,11 @@ #include "ui/gl/gpu_preference.h" class GURL; -class MessageLoop; class TransportTextureService; struct GPUCreateCommandBufferConfig; namespace base { +class MessageLoop; class MessageLoopProxy; } @@ -65,7 +65,7 @@ class CONTENT_EXPORT GpuChannelHostFactory { virtual bool IsMainThread() = 0; virtual bool IsIOThread() = 0; - virtual MessageLoop* GetMainLoop() = 0; + virtual base::MessageLoop* GetMainLoop() = 0; virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() = 0; virtual base::WaitableEvent* GetShutDownEvent() = 0; virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory(size_t size) = 0; diff --git a/content/public/browser/browser_thread.h b/content/public/browser/browser_thread.h index e75d70c..6e2fc67 100644 --- a/content/public/browser/browser_thread.h +++ b/content/public/browser/browser_thread.h @@ -19,9 +19,8 @@ #include "base/logging.h" #endif // UNIT_TEST -class MessageLoop; - namespace base { +class MessageLoop; class SequencedWorkerPool; class Thread; } @@ -216,7 +215,7 @@ class CONTENT_EXPORT BrowserThread { // // Ownership remains with the BrowserThread implementation, so you // must not delete the pointer. - static MessageLoop* UnsafeGetMessageLoopForThread(ID identifier); + static base::MessageLoop* UnsafeGetMessageLoopForThread(ID identifier); // Sets the delegate for the specified BrowserThread. // diff --git a/content/public/browser/histogram_fetcher.h b/content/public/browser/histogram_fetcher.h index 73dabde..5e6e090 100644 --- a/content/public/browser/histogram_fetcher.h +++ b/content/public/browser/histogram_fetcher.h @@ -10,7 +10,9 @@ #include "base/time.h" #include "content/common/content_export.h" +namespace base { class MessageLoop; +} namespace content { @@ -21,9 +23,11 @@ namespace content { // been acquired, or when the wait time expires (whichever is sooner), post the // callback to the specified message loop. Note the callback is posted exactly // once. -CONTENT_EXPORT void FetchHistogramsAsynchronously(MessageLoop* callback_thread, - const base::Closure& callback, - base::TimeDelta wait_time); +CONTENT_EXPORT void FetchHistogramsAsynchronously( + base::MessageLoop* callback_thread, + const base::Closure& callback, + base::TimeDelta wait_time); + } // namespace content #endif // CONTENT_PUBLIC_BROWSER_HISTOGRAM_FETCHER_H_ diff --git a/content/public/browser/url_data_source.cc b/content/public/browser/url_data_source.cc index b3c62b3..669f5c8 100644 --- a/content/public/browser/url_data_source.cc +++ b/content/public/browser/url_data_source.cc @@ -16,7 +16,7 @@ void URLDataSource::Add(BrowserContext* browser_context, URLDataManager::AddDataSource(browser_context, source); } -MessageLoop* URLDataSource::MessageLoopForRequestPath( +base::MessageLoop* URLDataSource::MessageLoopForRequestPath( const std::string& path) const { return BrowserThread::UnsafeGetMessageLoopForThread(BrowserThread::UI); } diff --git a/content/public/browser/url_data_source.h b/content/public/browser/url_data_source.h index 49daf87..93d38c0 100644 --- a/content/public/browser/url_data_source.h +++ b/content/public/browser/url_data_source.h @@ -10,9 +10,8 @@ #include "base/callback.h" #include "content/common/content_export.h" -class MessageLoop; - namespace base { +class MessageLoop; class RefCountedMemory; } @@ -66,7 +65,8 @@ class CONTENT_EXPORT URLDataSource { // on the IO thread. This can improve performance by satisfying such requests // more rapidly when there is a large amount of UI thread contention. Or the // delegate can return a specific thread's Messageloop if they wish. - virtual MessageLoop* MessageLoopForRequestPath(const std::string& path) const; + virtual base::MessageLoop* MessageLoopForRequestPath( + const std::string& path) const; // Returns true if the URLDataSource should replace an existing URLDataSource // with the same name that has already been registered. The default is true. diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h index b12633c..77a1057 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h @@ -18,11 +18,11 @@ #include "v8/include/v8.h" class GURL; -class MessageLoop; class SkBitmap; namespace base { class FilePath; +class MessageLoop; } namespace WebKit { @@ -231,7 +231,7 @@ class CONTENT_EXPORT ContentRendererClient { // Allow the embedder to specify a different renderer compositor MessageLoop. // If not NULL, the returned MessageLoop must be valid for the lifetime of // RenderThreadImpl. If NULL, then a new thread will be created. - virtual MessageLoop* OverrideCompositorMessageLoop() const; + virtual base::MessageLoop* OverrideCompositorMessageLoop() const; // Allow the embedder to disable input event filtering by the compositor. virtual bool ShouldCreateCompositorInputHandler() const; diff --git a/content/public/renderer/render_thread.h b/content/public/renderer/render_thread.h index a041657..7dcefd4 100644 --- a/content/public/renderer/render_thread.h +++ b/content/public/renderer/render_thread.h @@ -16,9 +16,9 @@ #endif class GURL; -class MessageLoop; namespace base { +class MessageLoop; class MessageLoopProxy; } @@ -45,7 +45,7 @@ class CONTENT_EXPORT RenderThread : public IPC::Sender { RenderThread(); virtual ~RenderThread(); - virtual MessageLoop* GetMessageLoop() = 0; + virtual base::MessageLoop* GetMessageLoop() = 0; virtual IPC::SyncChannel* GetChannel() = 0; virtual std::string GetLocale() = 0; virtual IPC::SyncMessageFilter* GetSyncMessageFilter() = 0; diff --git a/content/public/test/test_browser_thread.h b/content/public/test/test_browser_thread.h index 24182e1..c4c386b 100644 --- a/content/public/test/test_browser_thread.h +++ b/content/public/test/test_browser_thread.h @@ -9,9 +9,8 @@ #include "base/memory/scoped_ptr.h" #include "content/public/browser/browser_thread.h" -class MessageLoop; - namespace base { +class MessageLoop; class Thread; } @@ -24,7 +23,8 @@ class TestBrowserThreadImpl; class TestBrowserThread { public: explicit TestBrowserThread(BrowserThread::ID identifier); - TestBrowserThread(BrowserThread::ID identifier, MessageLoop* message_loop); + TestBrowserThread(BrowserThread::ID identifier, + base::MessageLoop* message_loop); ~TestBrowserThread(); // We provide a subset of the capabilities of the Thread interface diff --git a/content/renderer/devtools/devtools_agent_filter.h b/content/renderer/devtools/devtools_agent_filter.h index 9e4f8ae..e7f7861 100644 --- a/content/renderer/devtools/devtools_agent_filter.h +++ b/content/renderer/devtools/devtools_agent_filter.h @@ -9,9 +9,12 @@ #include "ipc/ipc_channel_proxy.h" -class MessageLoop; struct DevToolsMessageData; +namespace base { +class MessageLoop; +} + namespace content { // DevToolsAgentFilter is registered as an IPC filter in order to be able to @@ -37,7 +40,7 @@ class DevToolsAgentFilter : public IPC::ChannelProxy::MessageFilter { void OnDispatchOnInspectorBackend(const std::string& message); bool message_handled_; - MessageLoop* render_thread_loop_; + base::MessageLoop* render_thread_loop_; int current_routing_id_; DISALLOW_COPY_AND_ASSIGN(DevToolsAgentFilter); diff --git a/content/shell/shell_url_request_context_getter.h b/content/shell/shell_url_request_context_getter.h index 846c5d3..d7a96b2 100644 --- a/content/shell/shell_url_request_context_getter.h +++ b/content/shell/shell_url_request_context_getter.h @@ -13,7 +13,9 @@ #include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_job_factory.h" +namespace base { class MessageLoop; +} namespace net { class HostResolver; @@ -30,8 +32,8 @@ class ShellURLRequestContextGetter : public net::URLRequestContextGetter { ShellURLRequestContextGetter( bool ignore_certificate_errors, const base::FilePath& base_path, - MessageLoop* io_loop, - MessageLoop* file_loop, + base::MessageLoop* io_loop, + base::MessageLoop* file_loop, ProtocolHandlerMap* protocol_handlers); // net::URLRequestContextGetter implementation. @@ -47,8 +49,8 @@ class ShellURLRequestContextGetter : public net::URLRequestContextGetter { private: bool ignore_certificate_errors_; base::FilePath base_path_; - MessageLoop* io_loop_; - MessageLoop* file_loop_; + base::MessageLoop* io_loop_; + base::MessageLoop* file_loop_; scoped_ptr<net::ProxyConfigService> proxy_config_service_; scoped_ptr<net::NetworkDelegate> network_delegate_; diff --git a/extensions/browser/file_reader.h b/extensions/browser/file_reader.h index f103cd3..109a97a 100644 --- a/extensions/browser/file_reader.h +++ b/extensions/browser/file_reader.h @@ -11,7 +11,9 @@ #include "base/memory/ref_counted.h" #include "extensions/common/extension_resource.h" +namespace base { class MessageLoop; +} // This file defines an interface for reading a file asynchronously on a // background thread. @@ -38,7 +40,7 @@ class FileReader : public base::RefCountedThreadSafe<FileReader> { extensions::ExtensionResource resource_; Callback callback_; - MessageLoop* origin_loop_; + base::MessageLoop* origin_loop_; }; #endif // EXTENSIONS_BROWSER_FILE_READER_H_ diff --git a/ipc/ipc_test_base.h b/ipc/ipc_test_base.h index 2afb720..2ce2d76 100644 --- a/ipc/ipc_test_base.h +++ b/ipc/ipc_test_base.h @@ -15,7 +15,9 @@ #include "ipc/ipc_channel_proxy.h" #include "ipc/ipc_multiprocess_test.h" +namespace base { class MessageLoopForIO; +} // A test fixture for multiprocess IPC tests. Such tests include a "client" side // (running in a separate process). The same client may be shared between @@ -82,7 +84,7 @@ class IPCTestBase : public base::MultiProcessTest { private: std::string test_client_name_; - scoped_ptr<MessageLoopForIO> message_loop_; + scoped_ptr<base::MessageLoopForIO> message_loop_; scoped_ptr<IPC::Channel> channel_; scoped_ptr<IPC::ChannelProxy> channel_proxy_; diff --git a/jingle/glue/channel_socket_adapter.h b/jingle/glue/channel_socket_adapter.h index b5ed635..baf4d4c 100644 --- a/jingle/glue/channel_socket_adapter.h +++ b/jingle/glue/channel_socket_adapter.h @@ -11,7 +11,9 @@ #include "third_party/libjingle/source/talk/base/socketaddress.h" #include "third_party/libjingle/source/talk/base/sigslot.h" +namespace base { class MessageLoop; +} namespace cricket { class TransportChannel; @@ -56,7 +58,7 @@ class TransportChannelSocketAdapter : public net::Socket, void OnWritableState(cricket::TransportChannel* channel); void OnChannelDestroyed(cricket::TransportChannel* channel); - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; cricket::TransportChannel* channel_; diff --git a/jingle/glue/fake_socket_factory.h b/jingle/glue/fake_socket_factory.h index 4e4fa40..6cbfb75 100644 --- a/jingle/glue/fake_socket_factory.h +++ b/jingle/glue/fake_socket_factory.h @@ -16,7 +16,9 @@ #include "third_party/libjingle/source/talk/base/asyncpacketsocket.h" #include "third_party/libjingle/source/talk/base/packetsocketfactory.h" +namespace base { class MessageLoop; +} namespace jingle_glue { @@ -82,7 +84,7 @@ class FakeSocketManager : public base::RefCountedThreadSafe<FakeSocketManager> { const net::IPEndPoint& to, const std::vector<char>& data); - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; std::map<net::IPEndPoint, FakeUDPPacketSocket*> endpoints_; DISALLOW_COPY_AND_ASSIGN(FakeSocketManager); diff --git a/media/audio/audio_device_thread.h b/media/audio/audio_device_thread.h index 87d3e4c..22ff077 100644 --- a/media/audio/audio_device_thread.h +++ b/media/audio/audio_device_thread.h @@ -15,7 +15,9 @@ #include "media/audio/audio_parameters.h" #include "media/audio/shared_memory_util.h" +namespace base { class MessageLoop; +} namespace media { class AudioBus; @@ -86,7 +88,7 @@ class MEDIA_EXPORT AudioDeviceThread { // in order to join the worker thread and close the thread handle later via a // posted task. // If set to NULL, function will wait for the thread to exit before returning. - void Stop(MessageLoop* loop_for_join); + void Stop(base::MessageLoop* loop_for_join); // Returns true if the thread is stopped or stopping. bool IsStopped(); diff --git a/media/audio/audio_manager.h b/media/audio/audio_manager.h index bf17901..a20af4a 100644 --- a/media/audio/audio_manager.h +++ b/media/audio/audio_manager.h @@ -13,9 +13,8 @@ #include "media/audio/audio_device_name.h" #include "media/audio/audio_parameters.h" -class MessageLoop; - namespace base { +class MessageLoop; class MessageLoopProxy; } diff --git a/media/audio/audio_output_controller.h b/media/audio/audio_output_controller.h index ae89515..3f158a5 100644 --- a/media/audio/audio_output_controller.h +++ b/media/audio/audio_output_controller.h @@ -18,8 +18,6 @@ #include "media/audio/simple_sources.h" #include "media/base/media_export.h" -class MessageLoop; - // An AudioOutputController controls an AudioOutputStream and provides data // to this output stream. It has an important function that it executes // audio operations like play, pause, stop, etc. on a separate thread, diff --git a/media/audio/audio_output_dispatcher.h b/media/audio/audio_output_dispatcher.h index 6f8d86e..e07d181 100644 --- a/media/audio/audio_output_dispatcher.h +++ b/media/audio/audio_output_dispatcher.h @@ -25,7 +25,9 @@ #include "media/audio/audio_manager.h" #include "media/audio/audio_parameters.h" +namespace base { class MessageLoop; +} namespace media { @@ -71,7 +73,7 @@ class MEDIA_EXPORT AudioOutputDispatcher // A no-reference-held pointer (we don't want circular references) back to the // AudioManager that owns this object. AudioManager* audio_manager_; - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; AudioParameters params_; private: diff --git a/media/audio/audio_output_dispatcher_impl.h b/media/audio/audio_output_dispatcher_impl.h index 0eaa651..85a84f7 100644 --- a/media/audio/audio_output_dispatcher_impl.h +++ b/media/audio/audio_output_dispatcher_impl.h @@ -25,8 +25,6 @@ #include "media/audio/audio_output_dispatcher.h" #include "media/audio/audio_parameters.h" -class MessageLoop; - namespace media { class AudioOutputProxy; diff --git a/media/audio/linux/alsa_output.h b/media/audio/linux/alsa_output.h index 1b81046..bceeba5 100644 --- a/media/audio/linux/alsa_output.h +++ b/media/audio/linux/alsa_output.h @@ -33,7 +33,9 @@ #include "media/audio/audio_io.h" #include "media/audio/audio_parameters.h" +namespace base { class MessageLoop; +} namespace media { @@ -191,7 +193,7 @@ class MEDIA_EXPORT AlsaPcmOutputStream : public AudioOutputStream { // We hold a reference to the audio thread message loop since // AudioManagerBase::ShutDown() can invalidate the message loop pointer // before the stream gets deleted. - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; // Handle to the actual PCM playback device. snd_pcm_t* playback_handle_; diff --git a/media/base/pipeline.h b/media/base/pipeline.h index 4a24fd2..efd327d 100644 --- a/media/base/pipeline.h +++ b/media/base/pipeline.h @@ -20,8 +20,6 @@ #include "media/base/serial_runner.h" #include "ui/gfx/size.h" -class MessageLoop; - namespace base { class MessageLoopProxy; class TimeDelta; diff --git a/media/base/test_helpers.h b/media/base/test_helpers.h index 1c38694..097c5f8 100644 --- a/media/base/test_helpers.h +++ b/media/base/test_helpers.h @@ -9,7 +9,9 @@ #include "media/base/pipeline_status.h" #include "testing/gmock/include/gmock/gmock.h" +namespace base { class MessageLoop; +} namespace media { @@ -45,7 +47,7 @@ class WaitableMessageLoopEvent { void OnCallback(PipelineStatus status); void OnTimeout(); - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; bool signaled_; PipelineStatus status_; diff --git a/media/filters/gpu_video_decoder.h b/media/filters/gpu_video_decoder.h index d92c045..a0afd02 100644 --- a/media/filters/gpu_video_decoder.h +++ b/media/filters/gpu_video_decoder.h @@ -15,8 +15,8 @@ #include "media/base/video_decoder.h" #include "media/video/video_decode_accelerator.h" -class MessageLoop; template <class T> class scoped_refptr; + namespace base { class MessageLoopProxy; class SharedMemory; diff --git a/media/tools/player_x11/gl_video_renderer.h b/media/tools/player_x11/gl_video_renderer.h index dcda343..986a51c 100644 --- a/media/tools/player_x11/gl_video_renderer.h +++ b/media/tools/player_x11/gl_video_renderer.h @@ -11,8 +11,6 @@ #include "ui/gfx/size.h" #include "ui/gl/gl_bindings.h" -class MessageLoop; - namespace media { class VideoFrame; } diff --git a/media/tools/player_x11/x11_video_renderer.h b/media/tools/player_x11/x11_video_renderer.h index 18b76ba..3e4b41d 100644 --- a/media/tools/player_x11/x11_video_renderer.h +++ b/media/tools/player_x11/x11_video_renderer.h @@ -12,8 +12,6 @@ #include "ui/gfx/rect.h" #include "ui/gfx/size.h" -class MessageLoop; - namespace media { class VideoFrame; } diff --git a/net/cookies/cookie_store_test_callbacks.h b/net/cookies/cookie_store_test_callbacks.h index 0d74b58..ad6f77e 100644 --- a/net/cookies/cookie_store_test_callbacks.h +++ b/net/cookies/cookie_store_test_callbacks.h @@ -10,9 +10,8 @@ #include "net/cookies/cookie_store.h" -class MessageLoop; - namespace base { +class MessageLoop; class Thread; } @@ -42,9 +41,9 @@ class CookieCallback { private: bool did_run_; base::Thread* run_in_thread_; - MessageLoop* run_in_loop_; - MessageLoop* parent_loop_; - MessageLoop* loop_to_quit_; + base::MessageLoop* run_in_loop_; + base::MessageLoop* parent_loop_; + base::MessageLoop* loop_to_quit_; }; // Callback implementations for the asynchronous CookieStore methods. diff --git a/net/proxy/mock_proxy_resolver.h b/net/proxy/mock_proxy_resolver.h index 8f78c91..fc2422c 100644 --- a/net/proxy/mock_proxy_resolver.h +++ b/net/proxy/mock_proxy_resolver.h @@ -12,7 +12,9 @@ #include "net/base/net_errors.h" #include "net/proxy/proxy_resolver.h" +namespace base { class MessageLoop; +} namespace net { @@ -42,7 +44,7 @@ class MockAsyncProxyResolverBase : public ProxyResolver { const GURL url_; ProxyInfo* results_; net::CompletionCallback callback_; - MessageLoop* origin_loop_; + base::MessageLoop* origin_loop_; }; class SetPacScriptRequest { @@ -61,7 +63,7 @@ class MockAsyncProxyResolverBase : public ProxyResolver { MockAsyncProxyResolverBase* resolver_; const scoped_refptr<ProxyResolverScriptData> script_data_; net::CompletionCallback callback_; - MessageLoop* origin_loop_; + base::MessageLoop* origin_loop_; }; typedef std::vector<scoped_refptr<Request> > RequestsList; diff --git a/net/proxy/proxy_config_service_linux.h b/net/proxy/proxy_config_service_linux.h index 8d46d99..8bae4c8 100644 --- a/net/proxy/proxy_config_service_linux.h +++ b/net/proxy/proxy_config_service_linux.h @@ -19,9 +19,8 @@ #include "net/proxy/proxy_config_service.h" #include "net/proxy/proxy_server.h" -class MessageLoopForIO; - namespace base { +class MessageLoopForIO; class SingleThreadTaskRunner; } // namespace base @@ -52,7 +51,7 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService { // gconf/gsettings calls or reading necessary files, depending on the // implementation. virtual bool Init(base::SingleThreadTaskRunner* glib_thread_task_runner, - MessageLoopForIO* file_loop) = 0; + base::MessageLoopForIO* file_loop) = 0; // Releases the gconf/gsettings client, which clears cached directories and // stops notifications. @@ -183,7 +182,7 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService { void SetUpAndFetchInitialConfig( base::SingleThreadTaskRunner* glib_thread_task_runner, base::SingleThreadTaskRunner* io_thread_task_runner, - MessageLoopForIO* file_loop); + base::MessageLoopForIO* file_loop); // Handler for setting change notifications: fetches a new proxy // configuration from settings, and if this config is different @@ -283,7 +282,7 @@ class NET_EXPORT_PRIVATE ProxyConfigServiceLinux : public ProxyConfigService { void SetupAndFetchInitialConfig( base::SingleThreadTaskRunner* glib_thread_task_runner, base::SingleThreadTaskRunner* io_thread_task_runner, - MessageLoopForIO* file_loop) { + base::MessageLoopForIO* file_loop) { delegate_->SetUpAndFetchInitialConfig(glib_thread_task_runner, io_thread_task_runner, file_loop); } diff --git a/net/proxy/proxy_service.h b/net/proxy/proxy_service.h index 6eab86a..6639911 100644 --- a/net/proxy/proxy_service.h +++ b/net/proxy/proxy_service.h @@ -23,9 +23,9 @@ #include "net/proxy/proxy_server.h" class GURL; -class MessageLoop; namespace base { +class MessageLoop; class SingleThreadTaskRunner; } // namespace base @@ -241,7 +241,7 @@ class NET_EXPORT ProxyService : public NetworkChangeNotifier::IPAddressObserver, // system proxy settings. static ProxyConfigService* CreateSystemProxyConfigService( base::SingleThreadTaskRunner* io_thread_task_runner, - MessageLoop* file_loop); + base::MessageLoop* file_loop); // This method should only be used by unit tests. void set_stall_proxy_auto_config_delay(base::TimeDelta delay) { @@ -407,7 +407,7 @@ class NET_EXPORT ProxyService : public NetworkChangeNotifier::IPAddressObserver, class NET_EXPORT SyncProxyServiceHelper : public base::RefCountedThreadSafe<SyncProxyServiceHelper> { public: - SyncProxyServiceHelper(MessageLoop* io_message_loop, + SyncProxyServiceHelper(base::MessageLoop* io_message_loop, ProxyService* proxy_service); int ResolveProxy(const GURL& url, @@ -427,7 +427,7 @@ class NET_EXPORT SyncProxyServiceHelper void OnCompletion(int result); - MessageLoop* io_message_loop_; + base::MessageLoop* io_message_loop_; ProxyService* proxy_service_; base::WaitableEvent event_; diff --git a/net/test/net_test_suite.h b/net/test/net_test_suite.h index 32e6b02b..c8479d7 100644 --- a/net/test/net_test_suite.h +++ b/net/test/net_test_suite.h @@ -10,7 +10,9 @@ #include "build/build_config.h" #include "net/dns/mock_host_resolver.h" +namespace base { class MessageLoop; +} namespace net { class NetworkChangeNotifier; @@ -45,7 +47,7 @@ class NetTestSuite : public base::TestSuite { private: scoped_ptr<net::NetworkChangeNotifier> network_change_notifier_; - scoped_ptr<MessageLoop> message_loop_; + scoped_ptr<base::MessageLoop> message_loop_; scoped_refptr<net::RuleBasedHostResolverProc> host_resolver_proc_; net::ScopedDefaultHostResolverProc scoped_host_resolver_proc_; }; diff --git a/printing/printed_document.h b/printing/printed_document.h index 3992386..8093769 100644 --- a/printing/printed_document.h +++ b/printing/printed_document.h @@ -13,10 +13,9 @@ #include "printing/print_settings.h" #include "ui/gfx/native_widget_types.h" -class MessageLoop; - namespace base { class FilePath; +class MessageLoop; } namespace printing { @@ -147,7 +146,7 @@ class PRINTING_EXPORT PrintedDocument PrintSettings settings_; // Native thread for the render source. - MessageLoop* source_message_loop_; + base::MessageLoop* source_message_loop_; // Document name. Immutable. string16 name_; diff --git a/remoting/base/auto_thread_task_runner.h b/remoting/base/auto_thread_task_runner.h index ea43521..5626856 100644 --- a/remoting/base/auto_thread_task_runner.h +++ b/remoting/base/auto_thread_task_runner.h @@ -11,8 +11,6 @@ #include "base/message_loop.h" #include "base/single_thread_task_runner.h" -class MessageLoop; - namespace remoting { // A wrapper around |SingleThreadTaskRunner| that provides automatic lifetime diff --git a/remoting/base/plugin_thread_task_runner.h b/remoting/base/plugin_thread_task_runner.h index bfae1ce..15c1d2b 100644 --- a/remoting/base/plugin_thread_task_runner.h +++ b/remoting/base/plugin_thread_task_runner.h @@ -16,8 +16,6 @@ #include "base/threading/platform_thread.h" #include "base/time.h" -class MessageLoop; - namespace remoting { // SingleThreadTaskRunner for plugin main threads. diff --git a/remoting/host/register_support_host_request.h b/remoting/host/register_support_host_request.h index ab4d649..7fce5ea 100644 --- a/remoting/host/register_support_host_request.h +++ b/remoting/host/register_support_host_request.h @@ -14,8 +14,6 @@ #include "remoting/jingle_glue/signal_strategy.h" #include "testing/gtest/include/gtest/gtest_prod.h" -class MessageLoop; - namespace buzz { class XmlElement; } // namespace buzz diff --git a/remoting/protocol/connection_tester.h b/remoting/protocol/connection_tester.h index f89cd7a..6c95c71 100644 --- a/remoting/protocol/connection_tester.h +++ b/remoting/protocol/connection_tester.h @@ -9,7 +9,9 @@ #include "base/memory/ref_counted.h" +namespace base { class MessageLoop; +} namespace net { class DrainableIOBuffer; @@ -48,7 +50,7 @@ class StreamConnectionTester { void HandleReadResult(int result); private: - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; net::StreamSocket* host_socket_; net::StreamSocket* client_socket_; int message_size_; @@ -83,7 +85,7 @@ class DatagramConnectionTester { void OnRead(int result); void HandleReadResult(int result); - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; net::Socket* host_socket_; net::Socket* client_socket_; int message_size_; diff --git a/remoting/protocol/fake_session.h b/remoting/protocol/fake_session.h index 2ca9b46..471b336 100644 --- a/remoting/protocol/fake_session.h +++ b/remoting/protocol/fake_session.h @@ -17,7 +17,9 @@ #include "remoting/protocol/channel_factory.h" #include "remoting/protocol/session.h" +namespace base { class MessageLoop; +} namespace remoting { namespace protocol { @@ -98,7 +100,7 @@ class FakeSocket : public net::StreamSocket { net::BoundNetLog net_log_; - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; base::WeakPtrFactory<FakeSocket> weak_factory_; DISALLOW_COPY_AND_ASSIGN(FakeSocket); @@ -138,7 +140,7 @@ class FakeUdpSocket : public net::Socket { std::vector<std::string> input_packets_; int input_pos_; - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; DISALLOW_COPY_AND_ASSIGN(FakeUdpSocket); }; @@ -195,7 +197,7 @@ class FakeSession : public Session, EventHandler* event_handler_; scoped_ptr<const CandidateSessionConfig> candidate_config_; SessionConfig config_; - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; bool async_creation_; diff --git a/sync/engine/sync_scheduler.h b/sync/engine/sync_scheduler.h index db21ab0..b2ebbe3 100644 --- a/sync/engine/sync_scheduler.h +++ b/sync/engine/sync_scheduler.h @@ -16,8 +16,6 @@ #include "sync/internal_api/public/base/model_type_invalidation_map.h" #include "sync/sessions/sync_session.h" -class MessageLoop; - namespace tracked_objects { class Location; } // namespace tracked_objects diff --git a/sync/engine/sync_scheduler_impl.h b/sync/engine/sync_scheduler_impl.h index 4fc8c17..f3c4d5a 100644 --- a/sync/engine/sync_scheduler_impl.h +++ b/sync/engine/sync_scheduler_impl.h @@ -285,7 +285,7 @@ class SYNC_EXPORT_PRIVATE SyncSchedulerImpl : public SyncScheduler { // The message loop this object is on. Almost all methods have to // be called on this thread. - MessageLoop* const sync_loop_; + base::MessageLoop* const sync_loop_; // Set in Start(), unset in Stop(). bool started_; diff --git a/sync/internal_api/public/engine/passive_model_worker.h b/sync/internal_api/public/engine/passive_model_worker.h index 4b01606..a6ea011 100644 --- a/sync/internal_api/public/engine/passive_model_worker.h +++ b/sync/internal_api/public/engine/passive_model_worker.h @@ -11,7 +11,9 @@ #include "sync/internal_api/public/engine/model_safe_worker.h" #include "sync/internal_api/public/util/syncer_error.h" +namespace base { class MessageLoop; +} namespace syncer { @@ -20,7 +22,7 @@ namespace syncer { // thread). class SYNC_EXPORT PassiveModelWorker : public ModelSafeWorker { public: - explicit PassiveModelWorker(const MessageLoop* sync_loop); + explicit PassiveModelWorker(const base::MessageLoop* sync_loop); // ModelSafeWorker implementation. Called on the sync thread. virtual SyncerError DoWorkAndWaitUntilDone( @@ -30,7 +32,7 @@ class SYNC_EXPORT PassiveModelWorker : public ModelSafeWorker { private: virtual ~PassiveModelWorker(); - const MessageLoop* const sync_loop_; + const base::MessageLoop* const sync_loop_; DISALLOW_COPY_AND_ASSIGN(PassiveModelWorker); }; diff --git a/sync/internal_api/public/http_bridge.h b/sync/internal_api/public/http_bridge.h index 31863fd..6619adf 100644 --- a/sync/internal_api/public/http_bridge.h +++ b/sync/internal_api/public/http_bridge.h @@ -21,9 +21,12 @@ #include "sync/internal_api/public/http_post_provider_factory.h" #include "sync/internal_api/public/http_post_provider_interface.h" -class MessageLoop; class HttpBridgeTest; +namespace base { +class MessageLoop; +} + namespace net { class HttpResponseHeaders; class HttpUserAgentSettings; @@ -157,7 +160,7 @@ class SYNC_EXPORT_PRIVATE HttpBridge // the network. // This should be the main syncer thread (SyncerThread) which is what blocks // on network IO through curl_easy_perform. - MessageLoop* const created_on_loop_; + base::MessageLoop* const created_on_loop_; // The URL to POST to. GURL url_for_request_; diff --git a/ui/aura/test/aura_test_base.h b/ui/aura/test/aura_test_base.h index 58e4647..568e9af 100644 --- a/ui/aura/test/aura_test_base.h +++ b/ui/aura/test/aura_test_base.h @@ -44,7 +44,7 @@ class AuraTestBase : public testing::Test { RootWindow* root_window() { return helper_->root_window(); } private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; scoped_ptr<AuraTestHelper> helper_; DISALLOW_COPY_AND_ASSIGN(AuraTestBase); diff --git a/ui/aura/test/aura_test_helper.cc b/ui/aura/test/aura_test_helper.cc index cc7597c..a1ad97d 100644 --- a/ui/aura/test/aura_test_helper.cc +++ b/ui/aura/test/aura_test_helper.cc @@ -27,7 +27,7 @@ namespace aura { namespace test { -AuraTestHelper::AuraTestHelper(MessageLoopForUI* message_loop) +AuraTestHelper::AuraTestHelper(base::MessageLoopForUI* message_loop) : setup_called_(false), teardown_called_(false), owns_root_window_(false) { diff --git a/ui/aura/test/aura_test_helper.h b/ui/aura/test/aura_test_helper.h index 6a44592..7ffc3f9 100644 --- a/ui/aura/test/aura_test_helper.h +++ b/ui/aura/test/aura_test_helper.h @@ -8,7 +8,9 @@ #include "base/basictypes.h" #include "base/memory/scoped_ptr.h" +namespace base { class MessageLoopForUI; +} namespace ui { class InputMethod; @@ -31,7 +33,7 @@ class TestStackingClient; // that are necessary to run test on Aura. class AuraTestHelper { public: - explicit AuraTestHelper(MessageLoopForUI* message_loop); + explicit AuraTestHelper(base::MessageLoopForUI* message_loop); ~AuraTestHelper(); // Creates and initializes (shows and sizes) the RootWindow for use in tests. @@ -49,7 +51,7 @@ class AuraTestHelper { TestScreen* test_screen() { return test_screen_.get(); } private: - MessageLoopForUI* message_loop_; + base::MessageLoopForUI* message_loop_; bool setup_called_; bool teardown_called_; bool owns_root_window_; diff --git a/ui/compositor/test/test_suite.h b/ui/compositor/test/test_suite.h index b8be517..2d86fdc 100644 --- a/ui/compositor/test/test_suite.h +++ b/ui/compositor/test/test_suite.h @@ -10,7 +10,9 @@ #include "base/memory/scoped_ptr.h" #include "base/test/test_suite.h" +namespace base { class MessageLoop; +} namespace ui { namespace test { @@ -26,7 +28,7 @@ class CompositorTestSuite : public base::TestSuite { virtual void Shutdown() OVERRIDE; private: - scoped_ptr<MessageLoop> message_loop_; + scoped_ptr<base::MessageLoop> message_loop_; DISALLOW_COPY_AND_ASSIGN(CompositorTestSuite); }; diff --git a/ui/views/test/views_test_base.h b/ui/views/test/views_test_base.h index 456c07d..efb8c50 100644 --- a/ui/views/test/views_test_base.h +++ b/ui/views/test/views_test_base.h @@ -46,14 +46,14 @@ class ViewsTestBase : public testing::Test { views_delegate_.reset(views_delegate); } - MessageLoop* message_loop() { return &message_loop_; } + base::MessageLoop* message_loop() { return &message_loop_; } // Returns a context view. In aura builds, this will be the // RootWindow. Everywhere else, NULL. gfx::NativeView GetContext(); private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; scoped_ptr<TestViewsDelegate> views_delegate_; #if defined(USE_AURA) scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; diff --git a/ui/views/test/webview_test_helper.cc b/ui/views/test/webview_test_helper.cc index 26d379f..2746937 100644 --- a/ui/views/test/webview_test_helper.cc +++ b/ui/views/test/webview_test_helper.cc @@ -11,7 +11,7 @@ namespace views { -WebViewTestHelper::WebViewTestHelper(MessageLoopForUI* ui_loop) { +WebViewTestHelper::WebViewTestHelper(base::MessageLoopForUI* ui_loop) { test_content_client_initializer_.reset( new content::TestContentClientInitializer); diff --git a/ui/views/test/webview_test_helper.h b/ui/views/test/webview_test_helper.h index 46cf4e6..025ea06 100644 --- a/ui/views/test/webview_test_helper.h +++ b/ui/views/test/webview_test_helper.h @@ -7,7 +7,9 @@ #include "base/memory/scoped_ptr.h" +namespace base { class MessageLoopForUI; +} namespace content { class TestContentClientInitializer; @@ -18,7 +20,7 @@ namespace views { class WebViewTestHelper { public: - explicit WebViewTestHelper(MessageLoopForUI* ui_loop); + explicit WebViewTestHelper(base::MessageLoopForUI* ui_loop); virtual ~WebViewTestHelper(); private: diff --git a/webkit/glue/webkitplatformsupport_impl.h b/webkit/glue/webkitplatformsupport_impl.h index 3db2706..b757f94 100644 --- a/webkit/glue/webkitplatformsupport_impl.h +++ b/webkit/glue/webkitplatformsupport_impl.h @@ -25,7 +25,9 @@ #include "webkit/glue/webthemeengine_impl_android.h" #endif +namespace base { class MessageLoop; +} namespace webkit { class WebCompositorSupportImpl; @@ -177,7 +179,7 @@ class WEBKIT_GLUE_EXPORT WebKitPlatformSupportImpl : } static void DestroyCurrentThread(void*); - MessageLoop* main_loop_; + base::MessageLoop* main_loop_; base::OneShotTimer<WebKitPlatformSupportImpl> shared_timer_; void (*shared_timer_func_)(); double shared_timer_fire_time_; diff --git a/webkit/plugins/npapi/plugin_instance.h b/webkit/plugins/npapi/plugin_instance.h index 9e3fb32..a4e27b5 100644 --- a/webkit/plugins/npapi/plugin_instance.h +++ b/webkit/plugins/npapi/plugin_instance.h @@ -23,7 +23,9 @@ #include "ui/gfx/point.h" #include "ui/gfx/rect.h" +namespace base { class MessageLoop; +} namespace webkit { namespace npapi { @@ -304,7 +306,7 @@ class PluginInstance : public base::RefCountedThreadSafe<PluginInstance> { gfx::Rect containing_window_frame_; NPCocoaEvent* currently_handled_event_; // weak #endif - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; scoped_refptr<PluginStreamUrl> plugin_data_stream_; // This flag if true indicates that the plugin data would be passed from |