diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-04 14:17:11 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-04 14:17:11 +0000 |
commit | dd32b127ce5deac52b24f493dac79195a30bf138 (patch) | |
tree | fe41d5b0b6fb1bcff0ccfc87a9f46cefee602723 | |
parent | 63b5c710324dc630a663eb76a6a4cc1372322830 (diff) | |
download | chromium_src-dd32b127ce5deac52b24f493dac79195a30bf138.zip chromium_src-dd32b127ce5deac52b24f493dac79195a30bf138.tar.gz chromium_src-dd32b127ce5deac52b24f493dac79195a30bf138.tar.bz2 |
content: Use base::MessageLoop.
BUG=236029
R=avi@chromium.org
Review URL: https://chromiumcodereview.appspot.com/14335017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198316 0039d316-1c4b-4281-b951-d872f2087c98
187 files changed, 820 insertions, 723 deletions
diff --git a/content/app/android/child_process_service.cc b/content/app/android/child_process_service.cc index 2a12aa4..99e801b 100644 --- a/content/app/android/child_process_service.cc +++ b/content/app/android/child_process_service.cc @@ -105,7 +105,7 @@ void InternalInitChildProcess(const std::vector<int>& file_ids, } void QuitMainThreadMessageLoop() { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } // namespace <anonymous> diff --git a/content/browser/android/content_view_render_view.cc b/content/browser/android/content_view_render_view.cc index f427bc3..635ff80 100644 --- a/content/browser/android/content_view_render_view.cc +++ b/content/browser/android/content_view_render_view.cc @@ -77,7 +77,7 @@ void ContentViewRenderView::ScheduleComposite() { return; scheduled_composite_ = true; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ContentViewRenderView::Composite, weak_factory_.GetWeakPtr())); diff --git a/content/browser/appcache/chrome_appcache_service_unittest.cc b/content/browser/appcache/chrome_appcache_service_unittest.cc index 0c8a7f4..d925104 100644 --- a/content/browser/appcache/chrome_appcache_service_unittest.cc +++ b/content/browser/appcache/chrome_appcache_service_unittest.cc @@ -63,16 +63,15 @@ class MockURLRequestContextGetter : public net::URLRequestContextGetter { class ChromeAppCacheServiceTest : public testing::Test { public: ChromeAppCacheServiceTest() - : message_loop_(MessageLoop::TYPE_IO), + : message_loop_(base::MessageLoop::TYPE_IO), kProtectedManifestURL(kProtectedManifest), kNormalManifestURL(kNormalManifest), kSessionOnlyManifestURL(kSessionOnlyManifest), file_thread_(BrowserThread::FILE, &message_loop_), - file_user_blocking_thread_( - BrowserThread::FILE_USER_BLOCKING, &message_loop_), + file_user_blocking_thread_(BrowserThread::FILE_USER_BLOCKING, + &message_loop_), cache_thread_(BrowserThread::CACHE, &message_loop_), - io_thread_(BrowserThread::IO, &message_loop_) { - } + io_thread_(BrowserThread::IO, &message_loop_) {} protected: scoped_refptr<ChromeAppCacheService> CreateAppCacheService( @@ -80,7 +79,7 @@ class ChromeAppCacheServiceTest : public testing::Test { bool init_storage); void InsertDataIntoAppCache(ChromeAppCacheService* appcache_service); - MessageLoop message_loop_; + base::MessageLoop message_loop_; base::ScopedTempDir temp_dir_; const GURL kProtectedManifestURL; const GURL kNormalManifestURL; diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc index bc6e7f2..3c20e5f 100644 --- a/content/browser/browser_main_loop.cc +++ b/content/browser/browser_main_loop.cc @@ -233,7 +233,7 @@ void ImmediateShutdownAndExitProcess() { } // For measuring memory usage after each task. Behind a command line flag. -class BrowserMainLoop::MemoryObserver : public MessageLoop::TaskObserver { +class BrowserMainLoop::MemoryObserver : public base::MessageLoop::TaskObserver { public: MemoryObserver() {} virtual ~MemoryObserver() {} @@ -363,8 +363,8 @@ void BrowserMainLoop::MainMessageLoopStart() { #endif // Create a MessageLoop if one does not already exist for the current thread. - if (!MessageLoop::current()) - main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); + if (!base::MessageLoop::current()) + main_message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); InitializeMainThread(); @@ -411,7 +411,7 @@ void BrowserMainLoop::MainMessageLoopStart() { if (parsed_command_line_.HasSwitch(switches::kMemoryMetrics)) { memory_observer_.reset(new MemoryObserver()); - MessageLoop::current()->AddTaskObserver(memory_observer_.get()); + base::MessageLoop::current()->AddTaskObserver(memory_observer_.get()); } } @@ -436,9 +436,9 @@ void BrowserMainLoop::CreateThreads() { base::Thread::Options default_options; base::Thread::Options io_message_loop_options; - io_message_loop_options.message_loop_type = MessageLoop::TYPE_IO; + io_message_loop_options.message_loop_type = base::MessageLoop::TYPE_IO; base::Thread::Options ui_message_loop_options; - ui_message_loop_options.message_loop_type = MessageLoop::TYPE_UI; + ui_message_loop_options.message_loop_type = base::MessageLoop::TYPE_UI; // Start threads in the order they occur in the BrowserThread::ID // enumeration, except for BrowserThread::UI which is the main @@ -709,8 +709,8 @@ void BrowserMainLoop::InitializeMainThread() { main_message_loop_->set_thread_name(kThreadName); // Register the main thread by instantiating it, but don't call any methods. - main_thread_.reset(new BrowserThreadImpl(BrowserThread::UI, - MessageLoop::current())); + main_thread_.reset( + new BrowserThreadImpl(BrowserThread::UI, base::MessageLoop::current())); } #if defined(OS_ANDROID) @@ -859,9 +859,10 @@ void BrowserMainLoop::MainMessageLoopRun() { // Android's main message loop is the Java message loop. NOTREACHED(); #else - DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); + DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); if (parameters_.ui_task) - MessageLoopForUI::current()->PostTask(FROM_HERE, *parameters_.ui_task); + base::MessageLoopForUI::current()->PostTask(FROM_HERE, + *parameters_.ui_task); base::RunLoop run_loop; run_loop.Run(); diff --git a/content/browser/browser_thread_impl.cc b/content/browser/browser_thread_impl.cc index 517f51c..37f67bc 100644 --- a/content/browser/browser_thread_impl.cc +++ b/content/browser/browser_thread_impl.cc @@ -69,9 +69,8 @@ BrowserThreadImpl::BrowserThreadImpl(ID identifier) } BrowserThreadImpl::BrowserThreadImpl(ID identifier, - MessageLoop* message_loop) - : Thread(message_loop->thread_name().c_str()), - identifier_(identifier) { + base::MessageLoop* message_loop) + : Thread(message_loop->thread_name().c_str()), identifier_(identifier) { set_message_loop(message_loop); Initialize(); } @@ -113,51 +112,54 @@ void BrowserThreadImpl::Init() { MSVC_DISABLE_OPTIMIZE() MSVC_PUSH_DISABLE_WARNING(4748) -NOINLINE void BrowserThreadImpl::UIThreadRun(MessageLoop* message_loop) { +NOINLINE void BrowserThreadImpl::UIThreadRun(base::MessageLoop* message_loop) { volatile int line_number = __LINE__; Thread::Run(message_loop); CHECK_GT(line_number, 0); } -NOINLINE void BrowserThreadImpl::DBThreadRun(MessageLoop* message_loop) { +NOINLINE void BrowserThreadImpl::DBThreadRun(base::MessageLoop* message_loop) { volatile int line_number = __LINE__; Thread::Run(message_loop); CHECK_GT(line_number, 0); } -NOINLINE void BrowserThreadImpl::WebKitThreadRun(MessageLoop* message_loop) { +NOINLINE void BrowserThreadImpl::WebKitThreadRun( + base::MessageLoop* message_loop) { volatile int line_number = __LINE__; Thread::Run(message_loop); CHECK_GT(line_number, 0); } -NOINLINE void BrowserThreadImpl::FileThreadRun(MessageLoop* message_loop) { +NOINLINE void BrowserThreadImpl::FileThreadRun( + base::MessageLoop* message_loop) { volatile int line_number = __LINE__; Thread::Run(message_loop); CHECK_GT(line_number, 0); } NOINLINE void BrowserThreadImpl::FileUserBlockingThreadRun( - MessageLoop* message_loop) { + base::MessageLoop* message_loop) { volatile int line_number = __LINE__; Thread::Run(message_loop); CHECK_GT(line_number, 0); } NOINLINE void BrowserThreadImpl::ProcessLauncherThreadRun( - MessageLoop* message_loop) { + base::MessageLoop* message_loop) { volatile int line_number = __LINE__; Thread::Run(message_loop); CHECK_GT(line_number, 0); } -NOINLINE void BrowserThreadImpl::CacheThreadRun(MessageLoop* message_loop) { +NOINLINE void BrowserThreadImpl::CacheThreadRun( + base::MessageLoop* message_loop) { volatile int line_number = __LINE__; Thread::Run(message_loop); CHECK_GT(line_number, 0); } -NOINLINE void BrowserThreadImpl::IOThreadRun(MessageLoop* message_loop) { +NOINLINE void BrowserThreadImpl::IOThreadRun(base::MessageLoop* message_loop) { volatile int line_number = __LINE__; Thread::Run(message_loop); CHECK_GT(line_number, 0); @@ -166,7 +168,7 @@ NOINLINE void BrowserThreadImpl::IOThreadRun(MessageLoop* message_loop) { MSVC_POP_WARNING() MSVC_ENABLE_OPTIMIZE(); -void BrowserThreadImpl::Run(MessageLoop* message_loop) { +void BrowserThreadImpl::Run(base::MessageLoop* message_loop) { BrowserThread::ID thread_id; if (!GetCurrentThreadIdentifier(&thread_id)) return Thread::Run(message_loop); @@ -259,8 +261,9 @@ bool BrowserThreadImpl::PostTaskHelper( if (!target_thread_outlives_current) globals.lock.Acquire(); - MessageLoop* message_loop = globals.threads[identifier] ? - globals.threads[identifier]->message_loop() : NULL; + base::MessageLoop* message_loop = + globals.threads[identifier] ? globals.threads[identifier]->message_loop() + : NULL; if (message_loop) { if (nestable) { message_loop->PostDelayedTask(from_here, task, delay); @@ -361,7 +364,8 @@ bool BrowserThread::CurrentlyOn(ID identifier) { base::AutoLock lock(globals.lock); DCHECK(identifier >= 0 && identifier < ID_COUNT); return globals.threads[identifier] && - globals.threads[identifier]->message_loop() == MessageLoop::current(); + globals.threads[identifier]->message_loop() == + base::MessageLoop::current(); } // static @@ -433,7 +437,7 @@ bool BrowserThread::GetCurrentThreadIdentifier(ID* identifier) { // function. // http://crbug.com/63678 base::ThreadRestrictions::ScopedAllowSingleton allow_singleton; - MessageLoop* cur_message_loop = MessageLoop::current(); + base::MessageLoop* cur_message_loop = base::MessageLoop::current(); BrowserThreadGlobals& globals = g_globals.Get(); for (int i = 0; i < ID_COUNT; ++i) { if (globals.threads[i] && @@ -461,7 +465,7 @@ MessageLoop* BrowserThread::UnsafeGetMessageLoopForThread(ID identifier) { base::AutoLock lock(globals.lock); base::Thread* thread = globals.threads[identifier]; DCHECK(thread); - MessageLoop* loop = thread->message_loop(); + base::MessageLoop* loop = thread->message_loop(); return loop; } diff --git a/content/browser/browser_thread_impl.h b/content/browser/browser_thread_impl.h index 7375420..b4ca49b 100644 --- a/content/browser/browser_thread_impl.h +++ b/content/browser/browser_thread_impl.h @@ -20,14 +20,15 @@ class CONTENT_EXPORT BrowserThreadImpl : public BrowserThread, // Special constructor for the main (UI) thread and unittests. We use a dummy // thread here since the main thread already exists. - BrowserThreadImpl(BrowserThread::ID identifier, MessageLoop* message_loop); + BrowserThreadImpl(BrowserThread::ID identifier, + base::MessageLoop* message_loop); virtual ~BrowserThreadImpl(); static void ShutdownThreadPool(); protected: virtual void Init() OVERRIDE; - virtual void Run(MessageLoop* message_loop) OVERRIDE; + virtual void Run(base::MessageLoop* message_loop) OVERRIDE; virtual void CleanUp() OVERRIDE; private: @@ -38,14 +39,14 @@ class CONTENT_EXPORT BrowserThreadImpl : public BrowserThread, // The following are unique function names that makes it possible to tell // the thread id from the callstack alone in crash dumps. - void UIThreadRun(MessageLoop* message_loop); - void DBThreadRun(MessageLoop* message_loop); - void WebKitThreadRun(MessageLoop* message_loop); - void FileThreadRun(MessageLoop* message_loop); - void FileUserBlockingThreadRun(MessageLoop* message_loop); - void ProcessLauncherThreadRun(MessageLoop* message_loop); - void CacheThreadRun(MessageLoop* message_loop); - void IOThreadRun(MessageLoop* message_loop); + void UIThreadRun(base::MessageLoop* message_loop); + void DBThreadRun(base::MessageLoop* message_loop); + void WebKitThreadRun(base::MessageLoop* message_loop); + void FileThreadRun(base::MessageLoop* message_loop); + void FileUserBlockingThreadRun(base::MessageLoop* message_loop); + void ProcessLauncherThreadRun(base::MessageLoop* message_loop); + void CacheThreadRun(base::MessageLoop* message_loop); + void IOThreadRun(base::MessageLoop* message_loop); static bool PostTaskHelper( BrowserThread::ID identifier, diff --git a/content/browser/browser_thread_unittest.cc b/content/browser/browser_thread_unittest.cc index 06b1951..ec4b7cc 100644 --- a/content/browser/browser_thread_unittest.cc +++ b/content/browser/browser_thread_unittest.cc @@ -19,7 +19,7 @@ class BrowserThreadTest : public testing::Test { public: void Release() const { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure()); + loop_.PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } protected: @@ -35,17 +35,17 @@ class BrowserThreadTest : public testing::Test { file_thread_->Stop(); } - static void BasicFunction(MessageLoop* message_loop) { + static void BasicFunction(base::MessageLoop* message_loop) { CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } class DeletedOnFile : public base::RefCountedThreadSafe< DeletedOnFile, BrowserThread::DeleteOnFileThread> { public: - explicit DeletedOnFile(MessageLoop* message_loop) - : message_loop_(message_loop) { } + explicit DeletedOnFile(base::MessageLoop* message_loop) + : message_loop_(message_loop) {} private: friend struct BrowserThread::DeleteOnThread<BrowserThread::FILE>; @@ -53,10 +53,10 @@ class BrowserThreadTest : public testing::Test { ~DeletedOnFile() { CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); - message_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + message_loop_->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; }; private: @@ -64,42 +64,43 @@ class BrowserThreadTest : public testing::Test { scoped_ptr<BrowserThreadImpl> file_thread_; // It's kind of ugly to make this mutable - solely so we can post the Quit // Task from Release(). This should be fixed. - mutable MessageLoop loop_; + mutable base::MessageLoop loop_; }; TEST_F(BrowserThreadTest, PostTask) { BrowserThread::PostTask( - BrowserThread::FILE, FROM_HERE, - base::Bind(&BasicFunction, MessageLoop::current())); - MessageLoop::current()->Run(); + BrowserThread::FILE, + FROM_HERE, + base::Bind(&BasicFunction, base::MessageLoop::current())); + base::MessageLoop::current()->Run(); } TEST_F(BrowserThreadTest, Release) { BrowserThread::ReleaseSoon(BrowserThread::UI, FROM_HERE, this); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } TEST_F(BrowserThreadTest, ReleasedOnCorrectThread) { { scoped_refptr<DeletedOnFile> test( - new DeletedOnFile(MessageLoop::current())); + new DeletedOnFile(base::MessageLoop::current())); } - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } TEST_F(BrowserThreadTest, PostTaskViaMessageLoopProxy) { scoped_refptr<base::MessageLoopProxy> message_loop_proxy = BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE); message_loop_proxy->PostTask( - FROM_HERE, base::Bind(&BasicFunction, MessageLoop::current())); - MessageLoop::current()->Run(); + FROM_HERE, base::Bind(&BasicFunction, base::MessageLoop::current())); + base::MessageLoop::current()->Run(); } TEST_F(BrowserThreadTest, ReleaseViaMessageLoopProxy) { scoped_refptr<base::MessageLoopProxy> message_loop_proxy = BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI); message_loop_proxy->ReleaseSoon(FROM_HERE, this); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } TEST_F(BrowserThreadTest, PostTaskAndReply) { @@ -109,9 +110,9 @@ TEST_F(BrowserThreadTest, PostTaskAndReply) { BrowserThread::FILE, FROM_HERE, base::Bind(&base::DoNothing), - base::Bind(&MessageLoop::Quit, - base::Unretained(MessageLoop::current()->current())))); - MessageLoop::current()->Run(); + base::Bind(&base::MessageLoop::Quit, + base::Unretained(base::MessageLoop::current()->current())))); + base::MessageLoop::current()->Run(); } } // namespace content diff --git a/content/browser/byte_stream_unittest.cc b/content/browser/byte_stream_unittest.cc index 9ef45a3..aac6905 100644 --- a/content/browser/byte_stream_unittest.cc +++ b/content/browser/byte_stream_unittest.cc @@ -85,7 +85,7 @@ class ByteStreamTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; private: int producing_seed_key_; diff --git a/content/browser/device_monitor_linux.cc b/content/browser/device_monitor_linux.cc index 8a734b9..61aad7c 100644 --- a/content/browser/device_monitor_linux.cc +++ b/content/browser/device_monitor_linux.cc @@ -49,7 +49,7 @@ void DeviceMonitorLinux::Initialize() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); // We want to be notified of IO message loop destruction to delete |udev_|. - MessageLoop::current()->AddDestructionObserver(this); + base::MessageLoop::current()->AddDestructionObserver(this); std::vector<UdevLinux::UdevMonitorFilter> filters; for (size_t i = 0; i < arraysize(kSubsystemMap); ++i) { diff --git a/content/browser/device_monitor_linux.h b/content/browser/device_monitor_linux.h index 60044c0..71f0924 100644 --- a/content/browser/device_monitor_linux.h +++ b/content/browser/device_monitor_linux.h @@ -20,7 +20,7 @@ namespace content { class UdevLinux; -class DeviceMonitorLinux : public MessageLoop::DestructionObserver { +class DeviceMonitorLinux : public base::MessageLoop::DestructionObserver { public: DeviceMonitorLinux(); virtual ~DeviceMonitorLinux(); diff --git a/content/browser/device_orientation/provider_impl.cc b/content/browser/device_orientation/provider_impl.cc index 4b88764..59bdebf 100644 --- a/content/browser/device_orientation/provider_impl.cc +++ b/content/browser/device_orientation/provider_impl.cc @@ -27,7 +27,7 @@ class ProviderImpl::PollingThread : public base::Thread { public: PollingThread(const char* name, base::WeakPtr<ProviderImpl> provider, - MessageLoop* creator_loop); + base::MessageLoop* creator_loop); virtual ~PollingThread(); // Method for creating a DataFetcher and starting the polling, if the fetcher @@ -52,7 +52,7 @@ class ProviderImpl::PollingThread : public base::Thread { // 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_; scoped_ptr<DataFetcher> data_fetcher_; std::map<DeviceData::Type, scoped_refptr<const DeviceData> > @@ -62,28 +62,24 @@ class ProviderImpl::PollingThread : public base::Thread { base::WeakPtr<ProviderImpl> provider_; }; -ProviderImpl::PollingThread::PollingThread( - const char* name, - base::WeakPtr<ProviderImpl> provider, - MessageLoop* creator_loop) - : base::Thread(name), - creator_loop_(creator_loop), - provider_(provider) { -} +ProviderImpl::PollingThread::PollingThread(const char* name, + base::WeakPtr<ProviderImpl> provider, + base::MessageLoop* creator_loop) + : base::Thread(name), creator_loop_(creator_loop), provider_(provider) {} ProviderImpl::PollingThread::~PollingThread() { Stop(); } void ProviderImpl::PollingThread::DoAddPollingDataType(DeviceData::Type type) { - DCHECK(MessageLoop::current() == message_loop()); + DCHECK(base::MessageLoop::current() == message_loop()); polling_data_types_.insert(type); } void ProviderImpl::PollingThread::Initialize(DataFetcherFactory factory, DeviceData::Type type) { - DCHECK(MessageLoop::current() == message_loop()); + DCHECK(base::MessageLoop::current() == message_loop()); if (factory != NULL) { // Try to use factory to create a fetcher that can provide this type of @@ -115,7 +111,7 @@ void ProviderImpl::PollingThread::Initialize(DataFetcherFactory factory, void ProviderImpl::PollingThread::ScheduleDoNotify( const scoped_refptr<const DeviceData>& device_data, DeviceData::Type device_data_type) { - DCHECK(MessageLoop::current() == message_loop()); + DCHECK(base::MessageLoop::current() == message_loop()); creator_loop_->PostTask(FROM_HERE, base::Bind(&ProviderImpl::DoNotify, provider_, @@ -123,7 +119,7 @@ void ProviderImpl::PollingThread::ScheduleDoNotify( } void ProviderImpl::PollingThread::DoPoll() { - DCHECK(MessageLoop::current() == message_loop()); + DCHECK(base::MessageLoop::current() == message_loop()); // Poll the fetcher for each type of data. typedef std::set<DeviceData::Type>::const_iterator SetIterator; @@ -152,7 +148,7 @@ void ProviderImpl::PollingThread::DoPoll() { } void ProviderImpl::PollingThread::ScheduleDoPoll() { - DCHECK(MessageLoop::current() == message_loop()); + DCHECK(base::MessageLoop::current() == message_loop()); message_loop()->PostDelayedTask( FROM_HERE, @@ -161,7 +157,7 @@ void ProviderImpl::PollingThread::ScheduleDoPoll() { } base::TimeDelta ProviderImpl::PollingThread::SamplingInterval() const { - DCHECK(MessageLoop::current() == message_loop()); + DCHECK(base::MessageLoop::current() == message_loop()); DCHECK(data_fetcher_.get()); // TODO(erg): There used to be unused code here, that called a default @@ -171,7 +167,7 @@ base::TimeDelta ProviderImpl::PollingThread::SamplingInterval() const { } ProviderImpl::ProviderImpl(DataFetcherFactory factory) - : creator_loop_(MessageLoop::current()), + : creator_loop_(base::MessageLoop::current()), factory_(factory), weak_factory_(this), polling_thread_(NULL) { @@ -182,9 +178,9 @@ ProviderImpl::~ProviderImpl() { } void ProviderImpl::ScheduleDoAddPollingDataType(DeviceData::Type type) { - DCHECK(MessageLoop::current() == creator_loop_); + DCHECK(base::MessageLoop::current() == creator_loop_); - MessageLoop* polling_loop = polling_thread_->message_loop(); + base::MessageLoop* polling_loop = polling_thread_->message_loop(); polling_loop->PostTask(FROM_HERE, base::Bind(&PollingThread::DoAddPollingDataType, base::Unretained(polling_thread_), @@ -192,7 +188,7 @@ void ProviderImpl::ScheduleDoAddPollingDataType(DeviceData::Type type) { } void ProviderImpl::AddObserver(Observer* observer) { - DCHECK(MessageLoop::current() == creator_loop_); + DCHECK(base::MessageLoop::current() == creator_loop_); DeviceData::Type type = observer->device_data_type(); @@ -210,7 +206,7 @@ void ProviderImpl::AddObserver(Observer* observer) { } void ProviderImpl::RemoveObserver(Observer* observer) { - DCHECK(MessageLoop::current() == creator_loop_); + DCHECK(base::MessageLoop::current() == creator_loop_); observers_.erase(observer); if (observers_.empty()) @@ -218,7 +214,7 @@ void ProviderImpl::RemoveObserver(Observer* observer) { } void ProviderImpl::Start(DeviceData::Type type) { - DCHECK(MessageLoop::current() == creator_loop_); + DCHECK(base::MessageLoop::current() == creator_loop_); DCHECK(!polling_thread_); polling_thread_ = new PollingThread("Device data polling thread", @@ -237,7 +233,7 @@ void ProviderImpl::Start(DeviceData::Type type) { } void ProviderImpl::Stop() { - DCHECK(MessageLoop::current() == creator_loop_); + DCHECK(base::MessageLoop::current() == creator_loop_); weak_factory_.InvalidateWeakPtrs(); if (polling_thread_) { @@ -253,9 +249,9 @@ void ProviderImpl::Stop() { void ProviderImpl::ScheduleInitializePollingThread( DeviceData::Type device_data_type) { - DCHECK(MessageLoop::current() == creator_loop_); + DCHECK(base::MessageLoop::current() == creator_loop_); - MessageLoop* polling_loop = polling_thread_->message_loop(); + base::MessageLoop* polling_loop = polling_thread_->message_loop(); polling_loop->PostTask(FROM_HERE, base::Bind(&PollingThread::Initialize, base::Unretained(polling_thread_), @@ -265,7 +261,7 @@ void ProviderImpl::ScheduleInitializePollingThread( void ProviderImpl::DoNotify(const scoped_refptr<const DeviceData>& data, DeviceData::Type device_data_type) { - DCHECK(MessageLoop::current() == creator_loop_); + DCHECK(base::MessageLoop::current() == creator_loop_); // Update last notification of this type. last_notifications_map_[device_data_type] = data; diff --git a/content/browser/device_orientation/provider_unittest.cc b/content/browser/device_orientation/provider_unittest.cc index 4358c7f..ee2beed 100644 --- a/content/browser/device_orientation/provider_unittest.cc +++ b/content/browser/device_orientation/provider_unittest.cc @@ -150,7 +150,8 @@ class MotionUpdateChecker : public UpdateChecker { --(*expectations_count_ptr_); if (*expectations_count_ptr_ == 0) { - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); } } }; @@ -196,7 +197,8 @@ class OrientationUpdateChecker : public UpdateChecker { --(*expectations_count_ptr_); if (*expectations_count_ptr_ == 0) { - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); } } }; @@ -228,7 +230,8 @@ class TestDataUpdateChecker : public UpdateChecker { --(*expectations_count_ptr_); if (*expectations_count_ptr_ == 0) { - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); } } }; @@ -330,7 +333,7 @@ class DeviceOrientationProviderTest : public testing::Test { scoped_refptr<Provider> provider_; // Message loop for the test thread. - MessageLoop message_loop_; + base::MessageLoop message_loop_; }; TEST_F(DeviceOrientationProviderTest, FailingTest) { @@ -346,11 +349,11 @@ TEST_F(DeviceOrientationProviderTest, FailingTest) { checker_a->AddExpectation(new Orientation()); provider_->AddObserver(checker_a.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); checker_b->AddExpectation(new Orientation()); provider_->AddObserver(checker_b.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); MockDeviceDataFactory::SetCurInstance(NULL); } @@ -385,7 +388,7 @@ TEST_F(DeviceOrientationProviderTest, BasicPushTest) { device_data_factory->SetDeviceData(test_orientation, DeviceData::kTypeOrientation); provider_->AddObserver(checker.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); provider_->RemoveObserver(checker.get()); MockDeviceDataFactory::SetCurInstance(NULL); @@ -426,7 +429,7 @@ TEST_F(DeviceOrientationProviderTest, MultipleObserversPushTest) { device_data_factory->SetDeviceData(test_orientations[0], DeviceData::kTypeOrientation); provider_->AddObserver(checker_a.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); checker_a->AddExpectation(test_orientations[1]); checker_b->AddExpectation(test_orientations[0]); @@ -434,7 +437,7 @@ TEST_F(DeviceOrientationProviderTest, MultipleObserversPushTest) { device_data_factory->SetDeviceData(test_orientations[1], DeviceData::kTypeOrientation); provider_->AddObserver(checker_b.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); provider_->RemoveObserver(checker_a.get()); checker_b->AddExpectation(test_orientations[2]); @@ -443,7 +446,7 @@ TEST_F(DeviceOrientationProviderTest, MultipleObserversPushTest) { device_data_factory->SetDeviceData(test_orientations[2], DeviceData::kTypeOrientation); provider_->AddObserver(checker_c.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); provider_->RemoveObserver(checker_b.get()); provider_->RemoveObserver(checker_c.get()); @@ -472,13 +475,13 @@ TEST_F(DeviceOrientationProviderTest, FailingFirstDataTypeTest) { test_data_checker->AddExpectation(new TestData()); provider_->AddObserver(test_data_checker.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); orientation_checker->AddExpectation(test_orientation); device_data_factory->SetDeviceData(test_orientation, DeviceData::kTypeOrientation); provider_->AddObserver(orientation_checker.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); provider_->RemoveObserver(test_data_checker.get()); provider_->RemoveObserver(orientation_checker.get()); @@ -515,12 +518,12 @@ TEST_F(DeviceOrientationProviderTest, MAYBE_ObserverNotRemoved) { device_data_factory->SetDeviceData(test_orientation, DeviceData::kTypeOrientation); provider_->AddObserver(checker.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); checker->AddExpectation(test_orientation2); device_data_factory->SetDeviceData(test_orientation2, DeviceData::kTypeOrientation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); MockDeviceDataFactory::SetCurInstance(NULL); @@ -553,15 +556,15 @@ TEST_F(DeviceOrientationProviderTest, MAYBE_StartFailing) { DeviceData::kTypeOrientation); checker_a->AddExpectation(test_orientation); provider_->AddObserver(checker_a.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); checker_a->AddExpectation(new Orientation()); device_data_factory->SetFailing(true); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); checker_b->AddExpectation(new Orientation()); provider_->AddObserver(checker_b.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); provider_->RemoveObserver(checker_a.get()); provider_->RemoveObserver(checker_b.get()); @@ -595,7 +598,7 @@ TEST_F(DeviceOrientationProviderTest, StartStopStart) { device_data_factory->SetDeviceData(test_orientation, DeviceData::kTypeOrientation); provider_->AddObserver(checker_a.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); provider_->RemoveObserver(checker_a.get()); // This stops the Provider. @@ -603,7 +606,7 @@ TEST_F(DeviceOrientationProviderTest, StartStopStart) { device_data_factory->SetDeviceData(test_orientation2, DeviceData::kTypeOrientation); provider_->AddObserver(checker_b.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); provider_->RemoveObserver(checker_b.get()); MockDeviceDataFactory::SetCurInstance(NULL); @@ -634,12 +637,12 @@ TEST_F(DeviceOrientationProviderTest, FLAKY_MotionAlwaysFires) { device_data_factory->SetDeviceData(test_motion, DeviceData::kTypeMotion); checker->AddExpectation(test_motion); provider_->AddObserver(checker.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // The observer should receive the same motion again. device_data_factory->SetDeviceData(test_motion, DeviceData::kTypeMotion); checker->AddExpectation(test_motion); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); provider_->RemoveObserver(checker.get()); MockDeviceDataFactory::SetCurInstance(NULL); @@ -685,20 +688,20 @@ TEST_F(DeviceOrientationProviderTest, OrientationSignificantlyDifferent) { DeviceData::kTypeOrientation); checker_a->AddExpectation(first_orientation); provider_->AddObserver(checker_a.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // The observers should not see this insignificantly different orientation. device_data_factory->SetDeviceData(second_orientation, DeviceData::kTypeOrientation); checker_b->AddExpectation(first_orientation); provider_->AddObserver(checker_b.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); device_data_factory->SetDeviceData(third_orientation, DeviceData::kTypeOrientation); checker_a->AddExpectation(third_orientation); checker_b->AddExpectation(third_orientation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); provider_->RemoveObserver(checker_a.get()); provider_->RemoveObserver(checker_b.get()); diff --git a/content/browser/devtools/devtools_http_handler_impl.cc b/content/browser/devtools/devtools_http_handler_impl.cc index 53fd595..cea2156 100644 --- a/content/browser/devtools/devtools_http_handler_impl.cc +++ b/content/browser/devtools/devtools_http_handler_impl.cc @@ -93,16 +93,14 @@ class DevToolsDefaultBindingHandler // messages sent for DevToolsClient to a DebuggerShell instance. class DevToolsClientHostImpl : public DevToolsClientHost { public: - DevToolsClientHostImpl( - MessageLoop* message_loop, - net::HttpServer* server, - int connection_id) + DevToolsClientHostImpl(base::MessageLoop* message_loop, + net::HttpServer* server, + int connection_id) : message_loop_(message_loop), server_(server), connection_id_(connection_id), is_closed_(false), - detach_reason_("target_closed") { - } + detach_reason_("target_closed") {} virtual ~DevToolsClientHostImpl() {} @@ -140,7 +138,7 @@ class DevToolsClientHostImpl : public DevToolsClientHost { } private: - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; net::HttpServer* server_; int connection_id_; bool is_closed_; @@ -204,7 +202,7 @@ void DevToolsHttpHandlerImpl::Start() { // Runs on FILE thread. void DevToolsHttpHandlerImpl::StartHandlerThread() { base::Thread::Options options; - options.message_loop_type = MessageLoop::TYPE_IO; + options.message_loop_type = base::MessageLoop::TYPE_IO; if (!thread_->StartWithOptions(options)) { BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, diff --git a/content/browser/devtools/devtools_http_handler_unittest.cc b/content/browser/devtools/devtools_http_handler_unittest.cc index 5935a5e..9441c83 100644 --- a/content/browser/devtools/devtools_http_handler_unittest.cc +++ b/content/browser/devtools/devtools_http_handler_unittest.cc @@ -94,7 +94,7 @@ class DevToolsHttpHandlerTest : public testing::Test { file_thread_->Stop(); } private: - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; BrowserThreadImpl ui_thread_; scoped_ptr<BrowserThreadImpl> file_thread_; }; diff --git a/content/browser/devtools/devtools_manager_unittest.cc b/content/browser/devtools/devtools_manager_unittest.cc index 0438b7a..6923a93 100644 --- a/content/browser/devtools/devtools_manager_unittest.cc +++ b/content/browser/devtools/devtools_manager_unittest.cc @@ -181,9 +181,11 @@ TEST_F(DevToolsManagerTest, NoUnresponsiveDialogInInspectedContents) { // Start with a short timeout. inspected_rvh->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); // Wait long enough for first timeout and see if it fired. - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(10)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(10)); + base::MessageLoop::current()->Run(); EXPECT_FALSE(delegate.renderer_unresponsive_received()); // Now close devtools and check that the notification is delivered. @@ -191,9 +193,11 @@ TEST_F(DevToolsManagerTest, NoUnresponsiveDialogInInspectedContents) { // Start with a short timeout. inspected_rvh->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); // Wait long enough for first timeout and see if it fired. - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(10)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(10)); + base::MessageLoop::current()->Run(); EXPECT_TRUE(delegate.renderer_unresponsive_received()); contents()->SetDelegate(NULL); diff --git a/content/browser/download/base_file_unittest.cc b/content/browser/download/base_file_unittest.cc index 0e6239f..7b53c4d 100644 --- a/content/browser/download/base_file_unittest.cc +++ b/content/browser/download/base_file_unittest.cc @@ -222,7 +222,7 @@ class BaseFileTest : public testing::Test { DownloadInterruptReason expected_error_; // Mock file thread to satisfy debug checks in BaseFile. - MessageLoop message_loop_; + base::MessageLoop message_loop_; BrowserThreadImpl file_thread_; }; diff --git a/content/browser/download/download_browsertest.cc b/content/browser/download/download_browsertest.cc index dd1ba30..f3ed766 100644 --- a/content/browser/download/download_browsertest.cc +++ b/content/browser/download/download_browsertest.cc @@ -240,7 +240,7 @@ void DownloadFileWithDelayFactory::AddRenameCallback(base::Closure callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); rename_callbacks_.push_back(callback); if (waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } void DownloadFileWithDelayFactory::GetAllRenameCallbacks( @@ -296,10 +296,12 @@ class CountingDownloadFile : public DownloadFileImpl { // until data is returned. static int GetNumberActiveFilesFromFileThread() { int result = -1; - BrowserThread::PostTaskAndReply(BrowserThread::FILE, FROM_HERE, + BrowserThread::PostTaskAndReply( + BrowserThread::FILE, + FROM_HERE, base::Bind(&CountingDownloadFile::GetNumberActiveFiles, &result), - MessageLoop::current()->QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->QuitClosure()); + base::MessageLoop::current()->Run(); DCHECK_NE(-1, result); return result; } @@ -454,7 +456,7 @@ class DownloadCreateObserver : DownloadManager::Observer { item_ = download; if (waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } DownloadItem* WaitForFinished() { @@ -568,9 +570,9 @@ class DownloadContentTest : public ContentBrowserTest { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&EnsureNoPendingDownloadJobsOnIO, &result)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); return result && - (CountingDownloadFile::GetNumberActiveFilesFromFileThread() == 0); + (CountingDownloadFile::GetNumberActiveFilesFromFileThread() == 0); } void DownloadAndWait(Shell* shell, const GURL& url, @@ -679,7 +681,7 @@ class DownloadContentTest : public ContentBrowserTest { if (URLRequestSlowDownloadJob::NumberOutstandingRequests()) *result = false; BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, MessageLoop::QuitClosure()); + BrowserThread::UI, FROM_HERE, base::MessageLoop::QuitClosure()); } // Location of the downloads directory for these tests diff --git a/content/browser/download/download_file_unittest.cc b/content/browser/download/download_file_unittest.cc index d26cbce..982692e 100644 --- a/content/browser/download/download_file_unittest.cc +++ b/content/browser/download/download_file_unittest.cc @@ -302,7 +302,7 @@ class DownloadFileTest : public testing::Test { int64 bytes_per_sec_; std::string hash_state_; - MessageLoop loop_; + base::MessageLoop loop_; private: void SetRenameResult(bool* called_p, @@ -592,8 +592,9 @@ TEST_F(DownloadFileTest, ConfirmUpdate) { AppendDataToFile(chunks1, 2); // Run the message loops for 750ms and check for results. - loop_.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), - base::TimeDelta::FromMilliseconds(750)); + loop_.PostDelayedTask(FROM_HERE, + base::MessageLoop::QuitClosure(), + base::TimeDelta::FromMilliseconds(750)); loop_.Run(); EXPECT_EQ(static_cast<int64>(strlen(kTestData1) + strlen(kTestData2)), diff --git a/content/browser/download/download_id_unittest.cc b/content/browser/download/download_id_unittest.cc index 55e6494..ad84c91 100644 --- a/content/browser/download/download_id_unittest.cc +++ b/content/browser/download/download_id_unittest.cc @@ -44,7 +44,7 @@ class DownloadIdTest : public testing::Test { protected: scoped_refptr<DownloadManager> download_managers_[2]; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; // Necessary to delete |DownloadManager|s. BrowserThreadImpl ui_thread_; size_t num_managers_; diff --git a/content/browser/download/download_item_impl_unittest.cc b/content/browser/download/download_item_impl_unittest.cc index caee4ae..275b4d2 100644 --- a/content/browser/download/download_item_impl_unittest.cc +++ b/content/browser/download/download_item_impl_unittest.cc @@ -325,7 +325,7 @@ class DownloadItemTest : public testing::Test { } private: - MessageLoopForUI loop_; + base::MessageLoopForUI loop_; TestBrowserThread ui_thread_; // UI thread TestBrowserThread file_thread_; // FILE thread StrictMock<MockDelegate> delegate_; diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc index f48d46f..3fa9043 100644 --- a/content/browser/download/download_manager_impl.cc +++ b/content/browser/download/download_manager_impl.cc @@ -164,7 +164,7 @@ void EnsureNoPendingDownloadJobsOnFile(bool* result) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); *result = (DownloadFile::GetNumberOfDownloadFiles() == 0); BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, MessageLoop::QuitClosure()); + BrowserThread::UI, FROM_HERE, base::MessageLoop::QuitClosure()); } class DownloadItemFactoryImpl : public DownloadItemFactory { diff --git a/content/browser/download/download_manager_impl_unittest.cc b/content/browser/download/download_manager_impl_unittest.cc index c10a86a..2abb8f9 100644 --- a/content/browser/download/download_manager_impl_unittest.cc +++ b/content/browser/download/download_manager_impl_unittest.cc @@ -568,7 +568,7 @@ class DownloadManagerTest : public testing::Test { base::FilePath intermediate_path_; private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; TestBrowserThread ui_thread_; TestBrowserThread file_thread_; base::WeakPtr<MockDownloadItemFactory> mock_download_item_factory_; diff --git a/content/browser/download/drag_download_file.cc b/content/browser/download/drag_download_file.cc index 03dad10..5bbc9cb 100644 --- a/content/browser/download/drag_download_file.cc +++ b/content/browser/download/drag_download_file.cc @@ -37,7 +37,7 @@ class DragDownloadFile::DragDownloadFileUI : public DownloadItem::Observer { const Referrer& referrer, const std::string& referrer_encoding, WebContents* web_contents, - MessageLoop* on_completed_loop, + base::MessageLoop* on_completed_loop, const OnCompleted& on_completed) : on_completed_loop_(on_completed_loop), on_completed_(on_completed), @@ -132,7 +132,7 @@ class DragDownloadFile::DragDownloadFileUI : public DownloadItem::Observer { download_item_ = NULL; } - MessageLoop* on_completed_loop_; + base::MessageLoop* on_completed_loop_; OnCompleted on_completed_; GURL url_; Referrer referrer_; @@ -154,7 +154,7 @@ DragDownloadFile::DragDownloadFile(const base::FilePath& file_path, WebContents* web_contents) : file_path_(file_path), file_stream_(file_stream.Pass()), - drag_message_loop_(MessageLoop::current()), + drag_message_loop_(base::MessageLoop::current()), state_(INITIALIZED), drag_ui_(NULL), weak_ptr_factory_(this) { @@ -231,7 +231,7 @@ void DragDownloadFile::DownloadCompleted(bool is_successful) { void DragDownloadFile::CheckThread() { #if defined(OS_WIN) - DCHECK(drag_message_loop_ == MessageLoop::current()); + DCHECK(drag_message_loop_ == base::MessageLoop::current()); #else DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); #endif diff --git a/content/browser/download/drag_download_file.h b/content/browser/download/drag_download_file.h index e97f585..2151d44 100644 --- a/content/browser/download/drag_download_file.h +++ b/content/browser/download/drag_download_file.h @@ -63,7 +63,7 @@ class CONTENT_EXPORT DragDownloadFile : public ui::DownloadFileProvider { base::FilePath file_path_; scoped_ptr<net::FileStream> file_stream_; - MessageLoop* drag_message_loop_; + base::MessageLoop* drag_message_loop_; State state_; scoped_refptr<ui::DownloadFileObserver> observer_; base::RunLoop nested_loop_; diff --git a/content/browser/download/drag_download_file_browsertest.cc b/content/browser/download/drag_download_file_browsertest.cc index 040ddce..ebbec59 100644 --- a/content/browser/download/drag_download_file_browsertest.cc +++ b/content/browser/download/drag_download_file_browsertest.cc @@ -52,9 +52,9 @@ class DragDownloadFileTest : public ContentBrowserTest { virtual ~DragDownloadFileTest() {} void Succeed() { - BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, - MessageLoopForUI::current()->QuitClosure()); + BrowserThread::PostTask(BrowserThread::UI, + FROM_HERE, + base::MessageLoopForUI::current()->QuitClosure()); } void FailFast() { diff --git a/content/browser/download/mhtml_generation_browsertest.cc b/content/browser/download/mhtml_generation_browsertest.cc index 0bd0e52..26835dd 100644 --- a/content/browser/download/mhtml_generation_browsertest.cc +++ b/content/browser/download/mhtml_generation_browsertest.cc @@ -24,7 +24,7 @@ class MHTMLGenerationTest : public ContentBrowserTest { void MHTMLGenerated(const base::FilePath& path, int64 size) { mhtml_generated_ = true; file_size_ = size; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } protected: diff --git a/content/browser/gamepad/gamepad_provider.cc b/content/browser/gamepad/gamepad_provider.cc index 86e96d7..1dad482 100644 --- a/content/browser/gamepad/gamepad_provider.cc +++ b/content/browser/gamepad/gamepad_provider.cc @@ -68,7 +68,7 @@ void GamepadProvider::Pause() { base::AutoLock lock(is_paused_lock_); is_paused_ = true; } - MessageLoop* polling_loop = polling_thread_->message_loop(); + base::MessageLoop* polling_loop = polling_thread_->message_loop(); polling_loop->PostTask( FROM_HERE, base::Bind(&GamepadProvider::SendPauseHint, Unretained(this), true)); @@ -82,7 +82,7 @@ void GamepadProvider::Resume() { is_paused_ = false; } - MessageLoop* polling_loop = polling_thread_->message_loop(); + base::MessageLoop* polling_loop = polling_thread_->message_loop(); polling_loop->PostTask( FROM_HERE, base::Bind(&GamepadProvider::SendPauseHint, Unretained(this), false)); @@ -93,8 +93,8 @@ void GamepadProvider::Resume() { void GamepadProvider::RegisterForUserGesture(const base::Closure& closure) { base::AutoLock lock(user_gesture_lock_); - user_gesture_observers_.push_back( - ClosureAndThread(closure, MessageLoop::current()->message_loop_proxy())); + user_gesture_observers_.push_back(ClosureAndThread( + closure, base::MessageLoop::current()->message_loop_proxy())); } void GamepadProvider::OnDevicesChanged(base::SystemMonitor::DeviceType type) { @@ -114,7 +114,7 @@ void GamepadProvider::Initialize(scoped_ptr<GamepadDataFetcher> fetcher) { polling_thread_.reset(new base::Thread("Gamepad polling thread")); polling_thread_->StartWithOptions( - base::Thread::Options(MessageLoop::TYPE_IO, 0)); + base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); polling_thread_->message_loop()->PostTask( FROM_HERE, @@ -125,7 +125,7 @@ void GamepadProvider::Initialize(scoped_ptr<GamepadDataFetcher> fetcher) { void GamepadProvider::DoInitializePollingThread( scoped_ptr<GamepadDataFetcher> fetcher) { - DCHECK(MessageLoop::current() == polling_thread_->message_loop()); + DCHECK(base::MessageLoop::current() == polling_thread_->message_loop()); DCHECK(!data_fetcher_.get()); // Should only initialize once. if (!fetcher) @@ -134,13 +134,13 @@ void GamepadProvider::DoInitializePollingThread( } void GamepadProvider::SendPauseHint(bool paused) { - DCHECK(MessageLoop::current() == polling_thread_->message_loop()); + DCHECK(base::MessageLoop::current() == polling_thread_->message_loop()); if (data_fetcher_) data_fetcher_->PauseHint(paused); } void GamepadProvider::DoPoll() { - DCHECK(MessageLoop::current() == polling_thread_->message_loop()); + DCHECK(base::MessageLoop::current() == polling_thread_->message_loop()); DCHECK(have_scheduled_do_poll_); have_scheduled_do_poll_ = false; @@ -171,7 +171,7 @@ void GamepadProvider::DoPoll() { } void GamepadProvider::ScheduleDoPoll() { - DCHECK(MessageLoop::current() == polling_thread_->message_loop()); + DCHECK(base::MessageLoop::current() == polling_thread_->message_loop()); if (have_scheduled_do_poll_) return; @@ -181,7 +181,7 @@ void GamepadProvider::ScheduleDoPoll() { return; } - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&GamepadProvider::DoPoll, Unretained(this)), base::TimeDelta::FromMilliseconds(kDesiredSamplingIntervalMs)); diff --git a/content/browser/gamepad/gamepad_test_helpers.h b/content/browser/gamepad/gamepad_test_helpers.h index 6b97eda..7b8bb4b 100644 --- a/content/browser/gamepad/gamepad_test_helpers.h +++ b/content/browser/gamepad/gamepad_test_helpers.h @@ -50,11 +50,11 @@ class GamepadTestHelper { GamepadTestHelper(); virtual ~GamepadTestHelper(); - MessageLoop& message_loop() { return message_loop_; } + base::MessageLoop& message_loop() { return message_loop_; } private: // This must be constructed before the system monitor. - MessageLoop message_loop_; + base::MessageLoop message_loop_; DISALLOW_COPY_AND_ASSIGN(GamepadTestHelper); }; diff --git a/content/browser/geolocation/core_location_data_provider_mac.mm b/content/browser/geolocation/core_location_data_provider_mac.mm index 8c0d338..9942502 100644 --- a/content/browser/geolocation/core_location_data_provider_mac.mm +++ b/content/browser/geolocation/core_location_data_provider_mac.mm @@ -192,7 +192,7 @@ enum { namespace content { CoreLocationDataProviderMac::CoreLocationDataProviderMac() { - if (MessageLoop::current() != + if (base::MessageLoop::current() != GeolocationProvider::GetInstance()->message_loop()) { NOTREACHED() << "CoreLocation data provider must be created on " "the Geolocation thread."; @@ -247,7 +247,7 @@ void CoreLocationDataProviderMac::StopUpdatingTask() { } void CoreLocationDataProviderMac::PositionUpdated(Geoposition position) { - DCHECK(MessageLoop::current() == + DCHECK(base::MessageLoop::current() == GeolocationProvider::GetInstance()->message_loop()); if (provider_) provider_->SetPosition(&position); diff --git a/content/browser/geolocation/device_data_provider.h b/content/browser/geolocation/device_data_provider.h index 4918e30..431d706 100644 --- a/content/browser/geolocation/device_data_provider.h +++ b/content/browser/geolocation/device_data_provider.h @@ -92,7 +92,7 @@ template<typename DataType> class DeviceDataProviderImplBase : public DeviceDataProviderImplBaseHack { public: DeviceDataProviderImplBase() - : container_(NULL), client_loop_(MessageLoop::current()) { + : container_(NULL), client_loop_(base::MessageLoop::current()) { DCHECK(client_loop_); } @@ -138,12 +138,10 @@ class DeviceDataProviderImplBase : public DeviceDataProviderImplBaseHack { } bool CalledOnClientThread() const { - return MessageLoop::current() == this->client_loop_; + return base::MessageLoop::current() == this->client_loop_; } - MessageLoop* client_loop() const { - return client_loop_; - } + base::MessageLoop* client_loop() const { return client_loop_; } private: void NotifyListenersInClientLoop() { @@ -162,7 +160,7 @@ class DeviceDataProviderImplBase : public DeviceDataProviderImplBaseHack { // Reference to the client's message loop, all callbacks and access to // the listeners_ member should happen in this context. - MessageLoop* client_loop_; + base::MessageLoop* client_loop_; ListenersSet listeners_; diff --git a/content/browser/geolocation/device_data_provider_unittest.cc b/content/browser/geolocation/device_data_provider_unittest.cc index 0f0c957..42a678c 100644 --- a/content/browser/geolocation/device_data_provider_unittest.cc +++ b/content/browser/geolocation/device_data_provider_unittest.cc @@ -22,7 +22,7 @@ TEST(GeolocationDeviceDataProviderWifiData, CreateDestroy) { // run for correct behaviour, but we run it in this test to help smoke out // any race conditions between processing in the main loop and the setup / // tear down of the DeviceDataProvider thread. - MessageLoopForUI main_message_loop; + base::MessageLoopForUI main_message_loop; NullWifiDataListenerInterface listener; for (int i = 0; i < 10; i++) { DeviceDataProvider<WifiData>::Register(&listener); diff --git a/content/browser/geolocation/geolocation_provider.cc b/content/browser/geolocation/geolocation_provider.cc index 80420b9..7a2b689 100644 --- a/content/browser/geolocation/geolocation_provider.cc +++ b/content/browser/geolocation/geolocation_provider.cc @@ -95,7 +95,7 @@ GeolocationProvider::~GeolocationProvider() { } bool GeolocationProvider::OnGeolocationThread() const { - return MessageLoop::current() == message_loop(); + return base::MessageLoop::current() == message_loop(); } void GeolocationProvider::OnClientsChanged() { diff --git a/content/browser/geolocation/geolocation_provider_unittest.cc b/content/browser/geolocation/geolocation_provider_unittest.cc index dcffef0..ea22700 100644 --- a/content/browser/geolocation/geolocation_provider_unittest.cc +++ b/content/browser/geolocation/geolocation_provider_unittest.cc @@ -67,7 +67,7 @@ class AsyncMockGeolocationObserver : public MockGeolocationObserver { // GeolocationObserver virtual void OnLocationUpdate(const Geoposition& position) OVERRIDE { MockGeolocationObserver::OnLocationUpdate(position); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } }; @@ -134,7 +134,7 @@ class GeolocationProviderTest : public testing::Test { // Called on provider thread. void GetProvidersStarted(bool* started); - MessageLoop message_loop_; + base::MessageLoop message_loop_; TestBrowserThread io_thread_; scoped_ptr<LocationProviderForTestArbitrator> provider_; }; @@ -142,31 +142,31 @@ class GeolocationProviderTest : public testing::Test { bool GeolocationProviderTest::ProvidersStarted() { DCHECK(provider_->IsRunning()); - DCHECK(MessageLoop::current() == &message_loop_); + DCHECK(base::MessageLoop::current() == &message_loop_); bool started; provider_->message_loop_proxy()->PostTaskAndReply( FROM_HERE, base::Bind(&GeolocationProviderTest::GetProvidersStarted, base::Unretained(this), &started), - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); message_loop_.Run(); return started; } void GeolocationProviderTest::GetProvidersStarted(bool* started) { - DCHECK(MessageLoop::current() == provider_->message_loop()); + DCHECK(base::MessageLoop::current() == provider_->message_loop()); *started = provider_->mock_arbitrator()->providers_started(); } void GeolocationProviderTest::SendMockLocation(const Geoposition& position) { DCHECK(provider_->IsRunning()); - DCHECK(MessageLoop::current() == &message_loop_); - provider_->message_loop()->PostTask( - FROM_HERE, - base::Bind(&GeolocationProvider::OnLocationUpdate, - base::Unretained(provider_.get()), - position)); + DCHECK(base::MessageLoop::current() == &message_loop_); + provider_->message_loop() + ->PostTask(FROM_HERE, + base::Bind(&GeolocationProvider::OnLocationUpdate, + base::Unretained(provider_.get()), + position)); } // Regression test for http://crbug.com/59377 @@ -201,7 +201,7 @@ TEST_F(GeolocationProviderTest, StalePositionNotSent) { EXPECT_CALL(first_observer, OnLocationUpdate(GeopositionEq(first_position))); provider()->AddObserver(&first_observer, options); SendMockLocation(first_position); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); provider()->RemoveObserver(&first_observer); @@ -217,13 +217,13 @@ TEST_F(GeolocationProviderTest, StalePositionNotSent) { // is sent. EXPECT_CALL(second_observer, OnLocationUpdate(testing::_)).Times(0); provider()->AddObserver(&second_observer, options); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // The second observer should receive the new position now. EXPECT_CALL(second_observer, OnLocationUpdate(GeopositionEq(second_position))); SendMockLocation(second_position); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); provider()->RemoveObserver(&second_observer); EXPECT_FALSE(ProvidersStarted()); diff --git a/content/browser/geolocation/gps_location_provider_linux.cc b/content/browser/geolocation/gps_location_provider_linux.cc index 0481c62..e511e52 100644 --- a/content/browser/geolocation/gps_location_provider_linux.cc +++ b/content/browser/geolocation/gps_location_provider_linux.cc @@ -285,7 +285,7 @@ void GpsLocationProviderLinux::DoGpsPollTask() { void GpsLocationProviderLinux::ScheduleNextGpsPoll(int interval) { weak_factory_.InvalidateWeakPtrs(); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&GpsLocationProviderLinux::DoGpsPollTask, weak_factory_.GetWeakPtr()), diff --git a/content/browser/geolocation/gps_location_provider_unittest_linux.cc b/content/browser/geolocation/gps_location_provider_unittest_linux.cc index 6aaff15..985479f 100644 --- a/content/browser/geolocation/gps_location_provider_unittest_linux.cc +++ b/content/browser/geolocation/gps_location_provider_unittest_linux.cc @@ -53,7 +53,7 @@ class LocaionProviderListenerLoopQuitter // LocationProviderBase::ListenerInterface virtual void LocationUpdateAvailable( LocationProviderBase* provider) OVERRIDE { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } }; @@ -70,7 +70,7 @@ class GeolocationGpsProviderLinuxTests : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; BrowserThreadImpl ui_thread_; LocaionProviderListenerLoopQuitter location_listener_; scoped_ptr<GpsLocationProviderLinux> provider_; @@ -151,7 +151,7 @@ TEST_F(GeolocationGpsProviderLinuxTests, GetPosition) { MockLibGps::g_instance_->get_position_.timestamp = base::Time::FromDoubleT(200); EXPECT_TRUE(MockLibGps::g_instance_->get_position_.Validate()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(1, MockLibGps::g_instance_->get_position_calls_); EXPECT_EQ(1, MockLibGps::g_instance_->gps_open_calls_); EXPECT_EQ(1, MockLibGps::g_instance_->gps_read_calls_); @@ -160,7 +160,7 @@ TEST_F(GeolocationGpsProviderLinuxTests, GetPosition) { // Movement. This will block for up to half a second. MockLibGps::g_instance_->get_position_.latitude += 0.01; - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); provider_->GetPosition(&position); EXPECT_EQ(2, MockLibGps::g_instance_->get_position_calls_); EXPECT_EQ(1, MockLibGps::g_instance_->gps_open_calls_); @@ -194,11 +194,11 @@ TEST_F(GeolocationGpsProviderLinuxTests, LibGpsReconnect) { EXPECT_TRUE(MockLibGps::g_instance_->get_position_.Validate()); // This task makes gps_open() and LibGps::Start() to succeed after // 1500ms. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&EnableGpsOpenCallback), base::TimeDelta::FromMilliseconds(1500)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); provider_->GetPosition(&position); EXPECT_TRUE(position.Validate()); // 3 gps_open() calls are expected (2 failures and 1 success) diff --git a/content/browser/geolocation/location_arbitrator_impl_unittest.cc b/content/browser/geolocation/location_arbitrator_impl_unittest.cc index e2b39ee..1beb07f 100644 --- a/content/browser/geolocation/location_arbitrator_impl_unittest.cc +++ b/content/browser/geolocation/location_arbitrator_impl_unittest.cc @@ -144,7 +144,7 @@ class GeolocationLocationArbitratorTest : public testing::Test { scoped_refptr<FakeAccessTokenStore> access_token_store_; scoped_ptr<MockLocationObserver> observer_; scoped_ptr<TestingGeolocationArbitrator> arbitrator_; - MessageLoop loop_; + base::MessageLoop loop_; }; TEST_F(GeolocationLocationArbitratorTest, CreateDestroy) { diff --git a/content/browser/geolocation/mock_location_provider.cc b/content/browser/geolocation/mock_location_provider.cc index 76471af..7c083c7 100644 --- a/content/browser/geolocation/mock_location_provider.cc +++ b/content/browser/geolocation/mock_location_provider.cc @@ -104,10 +104,11 @@ class AutoMockLocationProvider : public MockLocationProvider { void UpdateListenersIfNeeded() { if (!listeners_updated_) { listeners_updated_ = true; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&MockLocationProvider::HandlePositionChanged, - weak_factory_.GetWeakPtr(), position_)); + weak_factory_.GetWeakPtr(), + position_)); } } diff --git a/content/browser/geolocation/network_location_provider.cc b/content/browser/geolocation/network_location_provider.cc index e4aac74..8cf98bb 100644 --- a/content/browser/geolocation/network_location_provider.cc +++ b/content/browser/geolocation/network_location_provider.cc @@ -194,7 +194,7 @@ bool NetworkLocationProvider::StartProvider(bool high_accuracy) { // provider and it will be deleted by ref counting. wifi_data_provider_ = WifiDataProvider::Register(this); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&NetworkLocationProvider::RequestPosition, weak_factory_.GetWeakPtr()), diff --git a/content/browser/geolocation/network_location_provider_unittest.cc b/content/browser/geolocation/network_location_provider_unittest.cc index 3b91466..ccbfc1b 100644 --- a/content/browser/geolocation/network_location_provider_unittest.cc +++ b/content/browser/geolocation/network_location_provider_unittest.cc @@ -31,7 +31,7 @@ class MessageLoopQuitListener : public LocationProviderBase::ListenerInterface { public: MessageLoopQuitListener() - : client_message_loop_(MessageLoop::current()), + : client_message_loop_(base::MessageLoop::current()), updated_provider_(NULL), movement_provider_(NULL) { CHECK(client_message_loop_); @@ -39,11 +39,11 @@ class MessageLoopQuitListener // ListenerInterface virtual void LocationUpdateAvailable( LocationProviderBase* provider) OVERRIDE { - EXPECT_EQ(client_message_loop_, MessageLoop::current()); + EXPECT_EQ(client_message_loop_, base::MessageLoop::current()); updated_provider_ = provider; client_message_loop_->Quit(); } - MessageLoop* client_message_loop_; + base::MessageLoop* client_message_loop_; LocationProviderBase* updated_provider_; LocationProviderBase* movement_provider_; }; @@ -324,7 +324,7 @@ class GeolocationNetworkProviderTest : public testing::Test { } GURL test_server_url_; - MessageLoop main_message_loop_; + base::MessageLoop main_message_loop_; scoped_refptr<FakeAccessTokenStore> access_token_store_; net::TestURLFetcherFactory url_fetcher_factory_; scoped_refptr<MockDeviceDataProviderImpl<WifiData> > wifi_data_provider_; @@ -332,7 +332,7 @@ class GeolocationNetworkProviderTest : public testing::Test { TEST_F(GeolocationNetworkProviderTest, CreateDestroy) { // Test fixture members were SetUp correctly. - EXPECT_EQ(&main_message_loop_, MessageLoop::current()); + EXPECT_EQ(&main_message_loop_, base::MessageLoop::current()); scoped_ptr<LocationProviderBase> provider(CreateProvider(true)); EXPECT_TRUE(NULL != provider.get()); provider.reset(); diff --git a/content/browser/geolocation/wifi_data_provider_chromeos_unittest.cc b/content/browser/geolocation/wifi_data_provider_chromeos_unittest.cc index 8fcb6c5..6672715 100644 --- a/content/browser/geolocation/wifi_data_provider_chromeos_unittest.cc +++ b/content/browser/geolocation/wifi_data_provider_chromeos_unittest.cc @@ -60,7 +60,7 @@ class GeolocationChromeOsWifiDataProviderTest : public testing::Test { message_loop_.RunUntilIdle(); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; scoped_refptr<WifiDataProviderChromeOs> provider_; chromeos::ShillManagerClient* manager_client_; chromeos::ShillManagerClient::TestInterface* manager_test_; diff --git a/content/browser/geolocation/wifi_data_provider_common_unittest.cc b/content/browser/geolocation/wifi_data_provider_common_unittest.cc index 84b1d15..341f392 100644 --- a/content/browser/geolocation/wifi_data_provider_common_unittest.cc +++ b/content/browser/geolocation/wifi_data_provider_common_unittest.cc @@ -61,7 +61,7 @@ class MockPollingPolicy :public PollingPolicyInterface { class MessageLoopQuitListener : public WifiDataProviderCommon::ListenerInterface { public: - explicit MessageLoopQuitListener(MessageLoop* message_loop) + explicit MessageLoopQuitListener(base::MessageLoop* message_loop) : message_loop_to_quit_(message_loop) { CHECK(message_loop_to_quit_ != NULL); } @@ -69,11 +69,11 @@ class MessageLoopQuitListener virtual void DeviceDataUpdateAvailable( DeviceDataProvider<WifiData>* provider) OVERRIDE { // Provider should call back on client's thread. - EXPECT_EQ(MessageLoop::current(), message_loop_to_quit_); + EXPECT_EQ(base::MessageLoop::current(), message_loop_to_quit_); provider_ = provider; message_loop_to_quit_->QuitNow(); } - MessageLoop* message_loop_to_quit_; + base::MessageLoop* message_loop_to_quit_; DeviceDataProvider<WifiData>* provider_; }; @@ -127,7 +127,7 @@ class GeolocationWifiDataProviderCommonTest : public testing::Test { } protected: - MessageLoop main_message_loop_; + base::MessageLoop main_message_loop_; MessageLoopQuitListener quit_listener_; scoped_refptr<WifiDataProviderCommonWithMock> provider_; MockWlanApi* wlan_api_; @@ -136,7 +136,7 @@ class GeolocationWifiDataProviderCommonTest : public testing::Test { TEST_F(GeolocationWifiDataProviderCommonTest, CreateDestroy) { // Test fixture members were SetUp correctly. - EXPECT_EQ(&main_message_loop_, MessageLoop::current()); + EXPECT_EQ(&main_message_loop_, base::MessageLoop::current()); EXPECT_TRUE(NULL != provider_.get()); EXPECT_TRUE(NULL != wlan_api_); } diff --git a/content/browser/geolocation/wifi_data_provider_linux_unittest.cc b/content/browser/geolocation/wifi_data_provider_linux_unittest.cc index 4585008..718fb5d 100644 --- a/content/browser/geolocation/wifi_data_provider_linux_unittest.cc +++ b/content/browser/geolocation/wifi_data_provider_linux_unittest.cc @@ -104,7 +104,7 @@ class GeolocationWifiDataProviderLinuxTest : public testing::Test { // DeviceDataProviderImplBase, a super class of WifiDataProviderLinux, // requires a message loop to be present. message_loop_ is defined here, // as it should outlive wifi_provider_linux_. - MessageLoop message_loop_; + base::MessageLoop message_loop_; scoped_refptr<dbus::MockBus> mock_bus_; scoped_refptr<dbus::MockObjectProxy> mock_network_manager_proxy_; scoped_refptr<dbus::MockObjectProxy> mock_access_point_proxy_; diff --git a/content/browser/geolocation/wifi_data_provider_unittest_win.cc b/content/browser/geolocation/wifi_data_provider_unittest_win.cc index e4cd77b..c74f42c 100644 --- a/content/browser/geolocation/wifi_data_provider_unittest_win.cc +++ b/content/browser/geolocation/wifi_data_provider_unittest_win.cc @@ -12,7 +12,7 @@ namespace content { TEST(GeolocationWin32WifiDataProviderTest, CreateDestroy) { // WifiDataProviderCommon requires the client to have a message loop. - MessageLoop dummy_loop; + base::MessageLoop dummy_loop; scoped_refptr<Win32WifiDataProvider> instance(new Win32WifiDataProvider); instance = NULL; SUCCEED(); diff --git a/content/browser/geolocation/win7_location_provider_unittest_win.cc b/content/browser/geolocation/win7_location_provider_unittest_win.cc index 9c2e299..6083db2 100644 --- a/content/browser/geolocation/win7_location_provider_unittest_win.cc +++ b/content/browser/geolocation/win7_location_provider_unittest_win.cc @@ -63,17 +63,17 @@ class MockWin7LocationApi : public Win7LocationApi { class LocationProviderListenerLoopQuitter : public LocationProviderBase::ListenerInterface { public: - explicit LocationProviderListenerLoopQuitter(MessageLoop* message_loop) + explicit LocationProviderListenerLoopQuitter(base::MessageLoop* message_loop) : message_loop_to_quit_(message_loop) { CHECK(message_loop_to_quit_ != NULL); } virtual void LocationUpdateAvailable(LocationProviderBase* provider) { - EXPECT_EQ(MessageLoop::current(), message_loop_to_quit_); + EXPECT_EQ(base::MessageLoop::current(), message_loop_to_quit_); provider_ = provider; message_loop_to_quit_->Quit(); } - MessageLoop* message_loop_to_quit_; + base::MessageLoop* message_loop_to_quit_; LocationProviderBase* provider_; }; @@ -97,7 +97,7 @@ class GeolocationProviderWin7Tests : public testing::Test { protected: MockWin7LocationApi* api_; LocationProviderListenerLoopQuitter location_listener_; - MessageLoop main_message_loop_; + base::MessageLoop main_message_loop_; Win7LocationProvider* provider_; }; diff --git a/content/browser/geolocation/win7_location_provider_win.cc b/content/browser/geolocation/win7_location_provider_win.cc index 66f88a0..ae33c2f 100644 --- a/content/browser/geolocation/win7_location_provider_win.cc +++ b/content/browser/geolocation/win7_location_provider_win.cc @@ -91,7 +91,7 @@ void Win7LocationProvider::DoPollTask() { } void Win7LocationProvider::ScheduleNextPoll(int interval) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&Win7LocationProvider::DoPollTask, weak_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(interval)); diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.h b/content/browser/gpu/browser_gpu_channel_host_factory.h index f9290bb..2d3c021 100644 --- a/content/browser/gpu/browser_gpu_channel_host_factory.h +++ b/content/browser/gpu/browser_gpu_channel_host_factory.h @@ -23,7 +23,7 @@ class BrowserGpuChannelHostFactory : public GpuChannelHostFactory { // GpuChannelHostFactory implementation. virtual bool IsMainThread() OVERRIDE; virtual bool IsIOThread() OVERRIDE; - virtual MessageLoop* GetMainLoop() OVERRIDE; + virtual base::MessageLoop* GetMainLoop() OVERRIDE; virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE; virtual base::WaitableEvent* GetShutDownEvent() OVERRIDE; virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory( diff --git a/content/browser/gpu/gpu_data_manager_impl_unittest.cc b/content/browser/gpu/gpu_data_manager_impl_unittest.cc index 95d7ea0..280be50 100644 --- a/content/browser/gpu/gpu_data_manager_impl_unittest.cc +++ b/content/browser/gpu/gpu_data_manager_impl_unittest.cc @@ -99,7 +99,7 @@ class GpuDataManagerImplTest : public testing::Test { void TestUnblockingDomainFrom3DAPIs( GpuDataManagerImpl::DomainGuilt guilt_level); - MessageLoop message_loop_; + base::MessageLoop message_loop_; }; // We use new method instead of GetInstance() method because we want diff --git a/content/browser/gpu/gpu_functional_browsertest.cc b/content/browser/gpu/gpu_functional_browsertest.cc index a07bbc5..6d31c2a 100644 --- a/content/browser/gpu/gpu_functional_browsertest.cc +++ b/content/browser/gpu/gpu_functional_browsertest.cc @@ -85,10 +85,11 @@ class GpuFunctionalTest : public ContentBrowserTest { bool result = false; BrowserThread::PostTaskAndReply( - BrowserThread::IO, FROM_HERE, + BrowserThread::IO, + FROM_HERE, base::Bind(&VerifyGPUProcessLaunch, &result), - MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); EXPECT_TRUE(result); } diff --git a/content/browser/gpu/shader_disk_cache_unittest.cc b/content/browser/gpu/shader_disk_cache_unittest.cc index f70f059..93ed979 100644 --- a/content/browser/gpu/shader_disk_cache_unittest.cc +++ b/content/browser/gpu/shader_disk_cache_unittest.cc @@ -42,7 +42,7 @@ class ShaderDiskCacheTest : public testing::Test { } base::ScopedTempDir temp_dir_; - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; TestBrowserThread cache_thread_; TestBrowserThread io_thread_; diff --git a/content/browser/histogram_synchronizer.cc b/content/browser/histogram_synchronizer.cc index b2db39b..5a1e6f9 100644 --- a/content/browser/histogram_synchronizer.cc +++ b/content/browser/histogram_synchronizer.cc @@ -201,7 +201,7 @@ void HistogramSynchronizer::FetchHistograms() { base::TimeDelta::FromMinutes(1)); } -void FetchHistogramsAsynchronously(MessageLoop* callback_thread, +void FetchHistogramsAsynchronously(base::MessageLoop* callback_thread, const base::Closure& callback, base::TimeDelta wait_time) { HistogramSynchronizer::FetchHistogramsAsynchronously( @@ -210,7 +210,7 @@ void FetchHistogramsAsynchronously(MessageLoop* callback_thread, // static void HistogramSynchronizer::FetchHistogramsAsynchronously( - MessageLoop* callback_thread, + base::MessageLoop* callback_thread, const base::Closure& callback, base::TimeDelta wait_time) { DCHECK(callback_thread != NULL); @@ -287,10 +287,10 @@ void HistogramSynchronizer::OnHistogramDataCollected( } void HistogramSynchronizer::SetCallbackTaskAndThread( - MessageLoop* callback_thread, + base::MessageLoop* callback_thread, const base::Closure& callback) { base::Closure old_callback; - MessageLoop* old_thread = NULL; + base::MessageLoop* old_thread = NULL; { base::AutoLock auto_lock(lock_); old_callback = callback_; @@ -307,7 +307,7 @@ void HistogramSynchronizer::SetCallbackTaskAndThread( void HistogramSynchronizer::ForceHistogramSynchronizationDoneCallback( int sequence_number) { base::Closure callback; - MessageLoop* thread = NULL; + base::MessageLoop* thread = NULL; { base::AutoLock lock(lock_); if (sequence_number != async_sequence_number_) @@ -320,7 +320,7 @@ void HistogramSynchronizer::ForceHistogramSynchronizationDoneCallback( InternalPostTask(thread, callback); } -void HistogramSynchronizer::InternalPostTask(MessageLoop* thread, +void HistogramSynchronizer::InternalPostTask(base::MessageLoop* thread, const base::Closure& callback) { if (callback.is_null() || !thread) return; diff --git a/content/browser/host_zoom_map_impl_unittest.cc b/content/browser/host_zoom_map_impl_unittest.cc index 055e061..ccb04e4 100644 --- a/content/browser/host_zoom_map_impl_unittest.cc +++ b/content/browser/host_zoom_map_impl_unittest.cc @@ -18,7 +18,7 @@ class HostZoomMapTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; TestBrowserThread ui_thread_; }; diff --git a/content/browser/in_process_webkit/indexed_db_browsertest.cc b/content/browser/in_process_webkit/indexed_db_browsertest.cc index f962e1d..45c0a69 100644 --- a/content/browser/in_process_webkit/indexed_db_browsertest.cc +++ b/content/browser/in_process_webkit/indexed_db_browsertest.cc @@ -113,7 +113,7 @@ class IndexedDBBrowserTest : public ContentBrowserTest { BrowserThread::WEBKIT_DEPRECATED))); EXPECT_TRUE(helper->Run()); // Wait for DidGetDiskUsage to be called. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); return disk_usage_; } private: diff --git a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc index f9d08be..ea0aa76 100644 --- a/content/browser/indexed_db/indexed_db_quota_client_unittest.cc +++ b/content/browser/indexed_db/indexed_db_quota_client_unittest.cc @@ -39,12 +39,12 @@ class IndexedDBQuotaClientTest : public testing::Test { kOriginOther("http://other"), usage_(0), weak_factory_(this), - message_loop_(MessageLoop::TYPE_IO), + message_loop_(base::MessageLoop::TYPE_IO), db_thread_(BrowserThread::DB, &message_loop_), webkit_thread_(BrowserThread::WEBKIT_DEPRECATED, &message_loop_), file_thread_(BrowserThread::FILE, &message_loop_), - file_user_blocking_thread_( - BrowserThread::FILE_USER_BLOCKING, &message_loop_), + file_user_blocking_thread_(BrowserThread::FILE_USER_BLOCKING, + &message_loop_), io_thread_(BrowserThread::IO, &message_loop_) { browser_context_.reset(new TestBrowserContext()); idb_context_ = static_cast<IndexedDBContextImpl*>( @@ -68,7 +68,7 @@ class IndexedDBQuotaClientTest : public testing::Test { // doesn't outlive BrowserThread::WEBKIT_DEPRECATED. idb_context_ = NULL; browser_context_.reset(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } int64 GetOriginUsage( @@ -80,7 +80,7 @@ class IndexedDBQuotaClientTest : public testing::Test { origin, type, base::Bind(&IndexedDBQuotaClientTest::OnGetOriginUsageComplete, weak_factory_.GetWeakPtr())); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_GT(usage_, -1); return usage_; } @@ -94,7 +94,7 @@ class IndexedDBQuotaClientTest : public testing::Test { type, base::Bind(&IndexedDBQuotaClientTest::OnGetOriginsComplete, weak_factory_.GetWeakPtr())); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); return origins_; } @@ -108,7 +108,7 @@ class IndexedDBQuotaClientTest : public testing::Test { type, host, base::Bind(&IndexedDBQuotaClientTest::OnGetOriginsComplete, weak_factory_.GetWeakPtr())); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); return origins_; } @@ -119,7 +119,7 @@ class IndexedDBQuotaClientTest : public testing::Test { origin_url, kTemp, base::Bind(&IndexedDBQuotaClientTest::OnDeleteOriginComplete, weak_factory_.GetWeakPtr())); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); return delete_status_; } @@ -163,7 +163,7 @@ class IndexedDBQuotaClientTest : public testing::Test { quota::StorageType type_; scoped_refptr<IndexedDBContextImpl> idb_context_; base::WeakPtrFactory<IndexedDBQuotaClientTest> weak_factory_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; BrowserThreadImpl db_thread_; BrowserThreadImpl webkit_thread_; BrowserThreadImpl file_thread_; diff --git a/content/browser/indexed_db/indexed_db_unittest.cc b/content/browser/indexed_db/indexed_db_unittest.cc index ba27198..869049d52 100644 --- a/content/browser/indexed_db/indexed_db_unittest.cc +++ b/content/browser/indexed_db/indexed_db_unittest.cc @@ -23,14 +23,13 @@ namespace content { class IndexedDBTest : public testing::Test { public: IndexedDBTest() - : message_loop_(MessageLoop::TYPE_IO), + : message_loop_(base::MessageLoop::TYPE_IO), webkit_thread_(BrowserThread::WEBKIT_DEPRECATED, &message_loop_), file_thread_(BrowserThread::FILE_USER_BLOCKING, &message_loop_), - io_thread_(BrowserThread::IO, &message_loop_) { - } + io_thread_(BrowserThread::IO, &message_loop_) {} protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; private: BrowserThreadImpl webkit_thread_; diff --git a/content/browser/loader/buffered_resource_handler.cc b/content/browser/loader/buffered_resource_handler.cc index b942bb4..c41c911 100644 --- a/content/browser/loader/buffered_resource_handler.cc +++ b/content/browser/loader/buffered_resource_handler.cc @@ -201,7 +201,7 @@ void BufferedResourceHandler::Resume() { NOTREACHED(); break; case STATE_REPLAYING: - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&BufferedResourceHandler::CallReplayReadCompleted, weak_ptr_factory_.GetWeakPtr())); diff --git a/content/browser/loader/resource_dispatcher_host_unittest.cc b/content/browser/loader/resource_dispatcher_host_unittest.cc index 3bf558a..5e1b440 100644 --- a/content/browser/loader/resource_dispatcher_host_unittest.cc +++ b/content/browser/loader/resource_dispatcher_host_unittest.cc @@ -113,7 +113,7 @@ static ResourceHostMsg_Request CreateResourceRequest( // Spin up the message loop to kick off the request. static void KickOffRequest() { - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } // We may want to move this to a shared space if it is useful for something else @@ -707,12 +707,12 @@ class ResourceDispatcherHostTest : public testing::Test, scoped_ptr<IPC::Message> ack( new ResourceHostMsg_DataReceived_ACK(msg.routing_id(), request_id)); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&GenerateIPCMessage, filter_, base::Passed(&ack))); } - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; BrowserThreadImpl ui_thread_; BrowserThreadImpl file_thread_; BrowserThreadImpl cache_thread_; @@ -877,7 +877,7 @@ TEST_F(ResourceDispatcherHostTest, Cancel) { // flush all the pending requests while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(0, host_.GetOutstandingRequestsMemoryCost(0)); @@ -917,7 +917,7 @@ TEST_F(ResourceDispatcherHostTest, CancelWhileStartIsDeferred) { // flush all the pending requests while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(was_deleted); @@ -935,7 +935,7 @@ TEST_F(ResourceDispatcherHostTest, CancelInResourceThrottleWillStartRequest) { // flush all the pending requests while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ResourceIPCAccumulator::ClassifiedMessages msgs; accum_.GetClassifiedMessages(&msgs); @@ -962,7 +962,7 @@ TEST_F(ResourceDispatcherHostTest, PausedStartError) { // flush all the pending requests while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(0, host_.pending_requests()); } @@ -991,7 +991,7 @@ TEST_F(ResourceDispatcherHostTest, ThrottleAndResumeTwice) { ASSERT_FALSE(GenericResourceThrottle::active_throttle()); // The request is started asynchronously. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Flush all the pending requests. while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} @@ -1021,7 +1021,7 @@ TEST_F(ResourceDispatcherHostTest, CancelInDelegate) { // flush all the pending requests while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(0, host_.GetOutstandingRequestsMemoryCost(0)); @@ -1092,7 +1092,7 @@ TEST_F(ResourceDispatcherHostTest, TestProcessCancel) { // Make sure all requests have finished stage one. test_url_1 will have // finished. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // TODO(mbelshe): // Now that the async IO path is in place, the IO always completes on the @@ -1396,7 +1396,7 @@ TEST_F(ResourceDispatcherHostTest, TooManyOutstandingRequests) { // Flush all the pending requests. while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(0, host_.GetOutstandingRequestsMemoryCost(filter_->child_id())); @@ -1777,7 +1777,7 @@ TEST_F(ResourceDispatcherHostTest, TransferNavigation) { new_render_view_id, new_request_id, request); bool msg_was_ok; host_.OnMessageReceived(transfer_request_msg, second_filter, &msg_was_ok); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Flush all the pending requests. while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} @@ -1839,7 +1839,7 @@ TEST_F(ResourceDispatcherHostTest, TransferNavigationAndThenRedirect) { new_render_view_id, new_request_id, request); bool msg_was_ok; host_.OnMessageReceived(transfer_request_msg, second_filter, &msg_was_ok); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Response data for "http://other.com/blerg": const std::string kResponseBody = "hello world"; @@ -1850,7 +1850,7 @@ TEST_F(ResourceDispatcherHostTest, TransferNavigationAndThenRedirect) { // OK, let the redirect happen. SetDelayedStartJobGeneration(false); CompleteStartRequest(second_filter, new_request_id); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Flush all the pending requests. while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} @@ -1859,7 +1859,7 @@ TEST_F(ResourceDispatcherHostTest, TransferNavigationAndThenRedirect) { ResourceHostMsg_FollowRedirect redirect_msg( new_render_view_id, new_request_id, false, GURL()); host_.OnMessageReceived(redirect_msg, second_filter, &msg_was_ok); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Flush all the pending requests. while (net::URLRequestTestJob::ProcessOnePendingMessage()) {} @@ -1968,7 +1968,7 @@ TEST_F(ResourceDispatcherHostTest, DelayedDataReceivedACKs) { host_.OnMessageReceived(msg, filter_.get(), &msg_was_ok); } - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); msgs.clear(); accum_.GetClassifiedMessages(&msgs); diff --git a/content/browser/loader/resource_loader.cc b/content/browser/loader/resource_loader.cc index ad5dd53..6319512 100644 --- a/content/browser/loader/resource_loader.cc +++ b/content/browser/loader/resource_loader.cc @@ -437,14 +437,14 @@ void ResourceLoader::Resume() { request_->FollowDeferredRedirect(); break; case DEFERRED_READ: - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ResourceLoader::ResumeReading, weak_ptr_factory_.GetWeakPtr())); break; case DEFERRED_FINISH: // Delay self-destruction since we don't know how we were reached. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ResourceLoader::CallDidFinishLoading, weak_ptr_factory_.GetWeakPtr())); @@ -493,9 +493,10 @@ void ResourceLoader::CancelRequestInternal(int error, bool from_renderer) { // If the request isn't in flight, then we won't get an asynchronous // notification from the request, so we have to signal ourselves to finish // this request. - MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&ResourceLoader::ResponseCompleted, - weak_ptr_factory_.GetWeakPtr())); + base::MessageLoop::current()->PostTask( + FROM_HERE, + base::Bind(&ResourceLoader::ResponseCompleted, + weak_ptr_factory_.GetWeakPtr())); } } @@ -572,11 +573,12 @@ void ResourceLoader::StartReading(bool is_continuation) { } else { // Else, trigger OnReadCompleted asynchronously to avoid starving the IO // thread in case the URLRequest can provide data synchronously. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ResourceLoader::OnReadCompleted, weak_ptr_factory_.GetWeakPtr(), - request_.get(), bytes_read)); + request_.get(), + bytes_read)); } } diff --git a/content/browser/loader/resource_loader_unittest.cc b/content/browser/loader/resource_loader_unittest.cc index 82394f9..84e57a5 100644 --- a/content/browser/loader/resource_loader_unittest.cc +++ b/content/browser/loader/resource_loader_unittest.cc @@ -146,9 +146,9 @@ class ResourceLoaderTest : public testing::Test, protected: // testing::Test: virtual void SetUp() OVERRIDE { - message_loop_.reset(new MessageLoop(MessageLoop::TYPE_IO)); - ui_thread_.reset(new BrowserThreadImpl(BrowserThread::UI, - message_loop_.get())); + message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_IO)); + ui_thread_.reset( + new BrowserThreadImpl(BrowserThread::UI, message_loop_.get())); io_thread_.reset(new BrowserThreadImpl(BrowserThread::IO, message_loop_.get())); } @@ -179,7 +179,7 @@ class ResourceLoaderTest : public testing::Test, virtual void DidReceiveResponse(ResourceLoader* loader) OVERRIDE {} virtual void DidFinishLoading(ResourceLoader* loader) OVERRIDE {} - scoped_ptr<MessageLoop> message_loop_; + scoped_ptr<base::MessageLoop> message_loop_; scoped_ptr<BrowserThreadImpl> ui_thread_; scoped_ptr<BrowserThreadImpl> io_thread_; diff --git a/content/browser/loader/resource_scheduler_unittest.cc b/content/browser/loader/resource_scheduler_unittest.cc index 96b755e..cfaf459 100644 --- a/content/browser/loader/resource_scheduler_unittest.cc +++ b/content/browser/loader/resource_scheduler_unittest.cc @@ -122,7 +122,7 @@ class ResourceSchedulerTest : public testing::Test { protected: ResourceSchedulerTest() : next_request_id_(0), - message_loop_(MessageLoop::TYPE_IO), + message_loop_(base::MessageLoop::TYPE_IO), ui_thread_(BrowserThread::UI, &message_loop_), io_thread_(BrowserThread::IO, &message_loop_) { scheduler_.OnClientCreated(kChildId, kRouteId); @@ -199,7 +199,7 @@ class ResourceSchedulerTest : public testing::Test { } int next_request_id_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; BrowserThreadImpl ui_thread_; BrowserThreadImpl io_thread_; ResourceDispatcherHostImpl rdh_; diff --git a/content/browser/media/media_internals_proxy.cc b/content/browser/media/media_internals_proxy.cc index 4ab19f1..0c214d1 100644 --- a/content/browser/media/media_internals_proxy.cc +++ b/content/browser/media/media_internals_proxy.cc @@ -154,10 +154,9 @@ void MediaInternalsProxy::AddNetEventOnUIThread(base::Value* entry) { // if an update is not already pending. if (!pending_net_updates_) { pending_net_updates_.reset(new base::ListValue()); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, - base::Bind( - &MediaInternalsProxy::SendNetEventsOnUIThread, this), + base::Bind(&MediaInternalsProxy::SendNetEventsOnUIThread, this), base::TimeDelta::FromMilliseconds( kMediaInternalsProxyEventDelayMilliseconds)); } diff --git a/content/browser/media/media_internals_unittest.cc b/content/browser/media/media_internals_unittest.cc index 591a287..5edd55d 100644 --- a/content/browser/media/media_internals_unittest.cc +++ b/content/browser/media/media_internals_unittest.cc @@ -53,7 +53,7 @@ class MediaInternalsTest : public testing::Test { internals_.reset(new MediaInternals()); } - MessageLoop loop_; + base::MessageLoop loop_; TestBrowserThread io_thread_; scoped_ptr<MediaInternals> internals_; }; diff --git a/content/browser/media/webrtc_internals_unittest.cc b/content/browser/media/webrtc_internals_unittest.cc index 7720f87..58c7d8d 100644 --- a/content/browser/media/webrtc_internals_unittest.cc +++ b/content/browser/media/webrtc_internals_unittest.cc @@ -56,7 +56,7 @@ class WebRTCInternalsTest : public testing::Test { return prefix + kstatic_part1 + id + kstatic_part2 + suffix; } - MessageLoop io_loop_; + base::MessageLoop io_loop_; TestBrowserThread io_thread_; }; diff --git a/content/browser/net/sqlite_persistent_cookie_store_unittest.cc b/content/browser/net/sqlite_persistent_cookie_store_unittest.cc index 9e47a42..cd0e078 100644 --- a/content/browser/net/sqlite_persistent_cookie_store_unittest.cc +++ b/content/browser/net/sqlite_persistent_cookie_store_unittest.cc @@ -135,7 +135,7 @@ class SQLitePersistentCookieStoreTest : public testing::Test { } protected: - MessageLoop main_loop_; + base::MessageLoop main_loop_; scoped_ptr<base::SequencedWorkerPoolOwner> pool_owner_; base::WaitableEvent loaded_event_; base::WaitableEvent key_loaded_event_; diff --git a/content/browser/net/view_http_cache_job_factory.cc b/content/browser/net/view_http_cache_job_factory.cc index 70e67e5..7738f8f 100644 --- a/content/browser/net/view_http_cache_job_factory.cc +++ b/content/browser/net/view_http_cache_job_factory.cc @@ -96,7 +96,7 @@ class ViewHttpCacheJob : public net::URLRequestJob { }; void ViewHttpCacheJob::Start() { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ViewHttpCacheJob::StartAsync, weak_factory_.GetWeakPtr())); } diff --git a/content/browser/plugin_data_remover_impl_browsertest.cc b/content/browser/plugin_data_remover_impl_browsertest.cc index f0b4ead..37672ee 100644 --- a/content/browser/plugin_data_remover_impl_browsertest.cc +++ b/content/browser/plugin_data_remover_impl_browsertest.cc @@ -25,7 +25,7 @@ class PluginDataRemoverTest : public ContentBrowserTest { PluginDataRemoverTest() {} void OnWaitableEventSignaled(base::WaitableEvent* waitable_event) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { diff --git a/content/browser/plugin_loader_posix_unittest.cc b/content/browser/plugin_loader_posix_unittest.cc index 6944384..c623892 100644 --- a/content/browser/plugin_loader_posix_unittest.cc +++ b/content/browser/plugin_loader_posix_unittest.cc @@ -79,7 +79,7 @@ class PluginLoaderPosixTest : public testing::Test { PluginServiceImpl::GetInstance()->Init(); } - MessageLoop* message_loop() { return &message_loop_; } + base::MessageLoop* message_loop() { return &message_loop_; } MockPluginLoaderPosix* plugin_loader() { return plugin_loader_.get(); } void AddThreePlugins() { @@ -97,7 +97,7 @@ class PluginLoaderPosixTest : public testing::Test { private: base::ShadowingAtExitManager at_exit_manager_; // Destroys PluginService. - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; BrowserThreadImpl file_thread_; BrowserThreadImpl io_thread_; diff --git a/content/browser/plugin_service_impl.cc b/content/browser/plugin_service_impl.cc index 2023b93..ff8aed4 100644 --- a/content/browser/plugin_service_impl.cc +++ b/content/browser/plugin_service_impl.cc @@ -581,7 +581,7 @@ string16 PluginServiceImpl::GetPluginDisplayNameByPath( void PluginServiceImpl::GetPlugins(const GetPluginsCallback& callback) { scoped_refptr<base::MessageLoopProxy> target_loop( - MessageLoop::current()->message_loop_proxy()); + base::MessageLoop::current()->message_loop_proxy()); if (LoadPluginListInProcess()) { BrowserThread::GetBlockingPool()-> diff --git a/content/browser/plugin_service_impl_browsertest.cc b/content/browser/plugin_service_impl_browsertest.cc index eaf5b66..102c492 100644 --- a/content/browser/plugin_service_impl_browsertest.cc +++ b/content/browser/plugin_service_impl_browsertest.cc @@ -106,8 +106,8 @@ class MockPluginProcessHostClient : public PluginProcessHost::Client, } void QuitMessageLoop() { - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - MessageLoop::QuitClosure()); + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, base::MessageLoop::QuitClosure()); } ResourceContext* context_; @@ -218,8 +218,8 @@ class MockCanceledPluginServiceClient : public PluginProcessHost::Client { }; void QuitUIMessageLoopFromIOThread() { - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - MessageLoop::QuitClosure()); + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, base::MessageLoop::QuitClosure()); } void OpenChannelAndThenCancel(PluginProcessHost::Client* client) { @@ -271,13 +271,13 @@ class MockCanceledBeforeSentPluginProcessHostClient set_host(host); // This gets called right before we request the plugin<=>renderer channel, // so we have to post a task to cancel it. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&PluginProcessHost::CancelPendingRequest, - base::Unretained(host), this)); - MessageLoop::current()->PostTask( - FROM_HERE, - base::Bind(&QuitUIMessageLoopFromIOThread)); + base::Unretained(host), + this)); + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&QuitUIMessageLoopFromIOThread)); } bool set_plugin_info_called() const { @@ -345,8 +345,8 @@ class MockCanceledAfterSentPluginProcessHostClient virtual void OnSentPluginChannelRequest() OVERRIDE { on_sent_plugin_channel_request_called_ = true; host()->CancelSentRequest(this); - BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - MessageLoop::QuitClosure()); + BrowserThread::PostTask( + BrowserThread::UI, FROM_HERE, base::MessageLoop::QuitClosure()); } bool on_sent_plugin_channel_request_called() const { diff --git a/content/browser/renderer_host/image_transport_factory.cc b/content/browser/renderer_host/image_transport_factory.cc index 249cb8e..1e566ac 100644 --- a/content/browser/renderer_host/image_transport_factory.cc +++ b/content/browser/renderer_host/image_transport_factory.cc @@ -231,7 +231,8 @@ class CompositorSwapClient // Recreating contexts directly from here causes issues, so post a task // instead. // TODO(piman): Fix the underlying issues. - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&CompositorSwapClient::OnLostContext, this->AsWeakPtr())); } @@ -261,7 +262,7 @@ class BrowserCompositorOutputSurfaceProxy arraysize(messages_to_filter), base::Bind(&BrowserCompositorOutputSurfaceProxy::OnMessageReceived, this), - MessageLoop::current()->message_loop_proxy()); + base::MessageLoop::current()->message_loop_proxy()); message_handler_set_ = true; } surface_map_.AddWithID(surface, surface_id); @@ -595,7 +596,7 @@ class GpuProcessTransportFactory } virtual void OnLostContext() OVERRIDE { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&GpuProcessTransportFactory::OnLostMainThreadSharedContext, factory_->callback_factory_.GetWeakPtr())); diff --git a/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc b/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc index 9285007..e3d2cd2 100644 --- a/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc +++ b/content/browser/renderer_host/java/java_bridge_dispatcher_host.cc @@ -138,7 +138,8 @@ void JavaBridgeDispatcherHost::CreateNPVariantParam(NPObject* object, void JavaBridgeDispatcherHost::CreateObjectStub(NPObject* object, int route_id) { - DCHECK_EQ(g_background_thread.Get().message_loop(), MessageLoop::current()); + DCHECK_EQ(g_background_thread.Get().message_loop(), + base::MessageLoop::current()); if (!channel_) { channel_ = JavaBridgeChannelHost::GetJavaBridgeChannelHost( render_view_host()->GetProcess()->GetID(), diff --git a/content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc b/content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc index 0e9a1b2..a09ac16 100644 --- a/content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc +++ b/content/browser/renderer_host/media/web_contents_video_capture_device_unittest.cc @@ -513,7 +513,7 @@ class WebContentsVideoCaptureDeviceTest : public testing::Test { // We run the UI message loop on the main thread. The capture device // will also spin up its own threads. - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; scoped_ptr<TestBrowserThread> ui_thread_; // Self-registering RenderProcessHostFactory. diff --git a/content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc b/content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc index 49a7f1f..cc46b2b 100644 --- a/content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc +++ b/content/browser/renderer_host/p2p/socket_host_tcp_unittest.cc @@ -183,7 +183,7 @@ TEST_F(P2PSocketHostTcpTest, SendAfterStunRequest) { // Verify that asynchronous writes are handled correctly. TEST_F(P2PSocketHostTcpTest, AsyncWrites) { - MessageLoop message_loop; + base::MessageLoop message_loop; socket_->set_async_write(true); diff --git a/content/browser/renderer_host/popup_menu_helper_mac.mm b/content/browser/renderer_host/popup_menu_helper_mac.mm index c46d568..4e6d1a1 100644 --- a/content/browser/renderer_host/popup_menu_helper_mac.mm +++ b/content/browser/renderer_host/popup_menu_helper_mac.mm @@ -53,7 +53,8 @@ void PopupMenuHelper::ShowPopupMenu( { // Make sure events can be pumped while the menu is up. - MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); + base::MessageLoop::ScopedNestableTaskAllower allow( + base::MessageLoop::current()); // One of the events that could be pumped is |window.close()|. // User-initiated event-tracking loops protect against this by diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc index 5fdc05b..51d9298 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc @@ -508,11 +508,11 @@ bool RenderProcessHostImpl::Init() { base::Thread::Options options; #if defined(OS_WIN) && !defined(OS_MACOSX) // In-process plugins require this to be a UI message loop. - options.message_loop_type = MessageLoop::TYPE_UI; + options.message_loop_type = base::MessageLoop::TYPE_UI; #else // We can't have multiple UI loops on Linux and Android, so we don't support // in-process plugins. - options.message_loop_type = MessageLoop::TYPE_DEFAULT; + options.message_loop_type = base::MessageLoop::TYPE_DEFAULT; #endif in_process_renderer_->StartWithOptions(options); @@ -1258,7 +1258,7 @@ void RenderProcessHostImpl::Cleanup() { Source<RenderProcessHost>(this), NotificationService::NoDetails()); - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); deleting_soon_ = true; // It's important not to wait for the DeleteTask to delete the channel // proxy. Kill it off now. That way, in case the profile is going away, the diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc index 016bc81..f2d095f 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -1714,7 +1714,7 @@ void RenderWidgetHostImpl::OnUpdateRect( bool post_callback = new_auto_size_.IsEmpty(); new_auto_size_ = params.view_size; if (post_callback) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&RenderWidgetHostImpl::DelayedAutoResized, weak_factory_.GetWeakPtr())); diff --git a/content/browser/renderer_host/render_widget_host_unittest.cc b/content/browser/renderer_host/render_widget_host_unittest.cc index 168fd1c..84945b9 100644 --- a/content/browser/renderer_host/render_widget_host_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_unittest.cc @@ -658,7 +658,7 @@ class RenderWidgetHostTest : public testing::Test { #endif // Process all pending tasks to avoid leaks. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } void SendInputEventACK(WebInputEvent::Type type, @@ -822,7 +822,7 @@ class RenderWidgetHostTest : public testing::Test { return reinterpret_cast<const WebInputEvent*>(data); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; scoped_ptr<TestBrowserContext> browser_context_; RenderWidgetHostProcess* process_; // Deleted automatically by the widget. @@ -1097,7 +1097,7 @@ TEST_F(RenderWidgetHostTest, GetBackingStore_RepaintAck) { // Test that we don't paint when we're hidden, but we still send the ACK. Most // of the rest of the painting is tested in the GetBackingStore* ones. TEST_F(RenderWidgetHostTest, HiddenPaint) { - BrowserThreadImpl ui_thread(BrowserThread::UI, MessageLoop::current()); + BrowserThreadImpl ui_thread(BrowserThread::UI, base::MessageLoop::current()); // Hide the widget, it should have sent out a message to the renderer. EXPECT_FALSE(host_->is_hidden_); host_->WasHidden(); @@ -1259,7 +1259,7 @@ TEST_F(RenderWidgetHostTest, CoalescesWheelEvents) { // The coalesced events can queue up a delayed ack // so that additional input events can be processed before // we turn off coalescing. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1U, process_->sink().message_count()); EXPECT_TRUE(process_->sink().GetUniqueMessageMatching( InputMsg_HandleInputEvent::ID)); @@ -1268,7 +1268,7 @@ TEST_F(RenderWidgetHostTest, CoalescesWheelEvents) { // One more time. SendInputEventACK(WebInputEvent::MouseWheel, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1U, process_->sink().message_count()); EXPECT_TRUE(process_->sink().GetUniqueMessageMatching( InputMsg_HandleInputEvent::ID)); @@ -1277,7 +1277,7 @@ TEST_F(RenderWidgetHostTest, CoalescesWheelEvents) { // After the final ack, the queue should be empty. SendInputEventACK(WebInputEvent::MouseWheel, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(0U, process_->sink().message_count()); SimulateGestureFlingStartEvent(0.f, 0.f, WebGestureEvent::Touchpad); @@ -1293,7 +1293,7 @@ TEST_F(RenderWidgetHostTest, CoalescesWheelEventsQueuedPhaseEndIsNotDropped) { EXPECT_EQ(1U, process_->sink().message_count()); SendInputEventACK(WebInputEvent::GestureScrollBegin, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Send a wheel event, should get sent directly. SimulateWheelEvent(0, -5, 0, false); @@ -1372,7 +1372,7 @@ TEST_F(RenderWidgetHostTest, CoalescesScrollGestureEvents) { // Check that the ACK sends the second message. SendInputEventACK(WebInputEvent::GestureScrollBegin, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1U, process_->sink().message_count()); EXPECT_TRUE(process_->sink().GetUniqueMessageMatching( InputMsg_HandleInputEvent::ID)); @@ -1381,7 +1381,7 @@ TEST_F(RenderWidgetHostTest, CoalescesScrollGestureEvents) { // Ack for queued coalesced event. SendInputEventACK(WebInputEvent::GestureScrollUpdate, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1U, process_->sink().message_count()); EXPECT_TRUE(process_->sink().GetUniqueMessageMatching( InputMsg_HandleInputEvent::ID)); @@ -1390,7 +1390,7 @@ TEST_F(RenderWidgetHostTest, CoalescesScrollGestureEvents) { // Ack for queued uncoalesced event. SendInputEventACK(WebInputEvent::GestureScrollUpdate, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1U, process_->sink().message_count()); EXPECT_TRUE(process_->sink().GetUniqueMessageMatching( InputMsg_HandleInputEvent::ID)); @@ -1399,7 +1399,7 @@ TEST_F(RenderWidgetHostTest, CoalescesScrollGestureEvents) { // After the final ack, the queue should be empty. SendInputEventACK(WebInputEvent::GestureScrollEnd, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(0U, process_->sink().message_count()); } @@ -1494,7 +1494,7 @@ TEST_F(RenderWidgetHostTest, CoalescesScrollAndPinchEvents) { // Check that the ACK sends the second message. SendInputEventACK(WebInputEvent::GestureScrollBegin, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1U, process_->sink().message_count()); EXPECT_TRUE(process_->sink().GetUniqueMessageMatching( InputMsg_HandleInputEvent::ID)); @@ -1521,7 +1521,7 @@ TEST_F(RenderWidgetHostTest, CoalescesScrollAndPinchEvents) { // Check that the ACK sends both scroll and pinch updates. SendInputEventACK(WebInputEvent::GesturePinchBegin, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(2U, process_->sink().message_count()); EXPECT_TRUE(process_->sink().GetFirstMessageMatching( InputMsg_HandleInputEvent::ID)); @@ -1580,7 +1580,7 @@ TEST_F(RenderWidgetHostTest, CoalescesScrollAndPinchEvents) { // Check that the ACK gets ignored. SendInputEventACK(WebInputEvent::GestureScrollUpdate, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(0U, process_->sink().message_count()); // The flag should have been flipped back to false. EXPECT_FALSE(host_->WillIgnoreNextACK()); @@ -1603,7 +1603,7 @@ TEST_F(RenderWidgetHostTest, CoalescesScrollAndPinchEvents) { // Check that the ACK sends the next scroll pinch pair. SendInputEventACK(WebInputEvent::GesturePinchUpdate, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(2U, process_->sink().message_count()); EXPECT_TRUE(process_->sink().GetFirstMessageMatching( InputMsg_HandleInputEvent::ID)); @@ -1614,13 +1614,13 @@ TEST_F(RenderWidgetHostTest, CoalescesScrollAndPinchEvents) { // Check that the ACK sends the second message. SendInputEventACK(WebInputEvent::GestureScrollUpdate, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(0U, process_->sink().message_count()); // Check that the ACK sends the second message. SendInputEventACK(WebInputEvent::GesturePinchUpdate, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1U, process_->sink().message_count()); EXPECT_TRUE(process_->sink().GetUniqueMessageMatching( InputMsg_HandleInputEvent::ID)); @@ -1629,7 +1629,7 @@ TEST_F(RenderWidgetHostTest, CoalescesScrollAndPinchEvents) { // Check that the queue is empty after ACK and no messages get sent. SendInputEventACK(WebInputEvent::GestureScrollUpdate, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(0U, process_->sink().message_count()); EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize()); } @@ -1652,13 +1652,13 @@ TEST_P(RenderWidgetHostWithSourceTest, GestureFlingCancelsFiltered) { EXPECT_TRUE(host_->FlingInProgress()); SendInputEventACK(WebInputEvent::GestureFlingStart, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); SimulateGestureEvent(WebInputEvent::GestureFlingCancel, source_device); EXPECT_FALSE(host_->FlingInProgress()); EXPECT_EQ(2U, process_->sink().message_count()); SendInputEventACK(WebInputEvent::GestureFlingCancel, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize()); // GFC before previous GFS is acked. @@ -1673,10 +1673,10 @@ TEST_P(RenderWidgetHostWithSourceTest, GestureFlingCancelsFiltered) { // Advance state realistically. SendInputEventACK(WebInputEvent::GestureFlingStart, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); SendInputEventACK(WebInputEvent::GestureFlingCancel, INPUT_EVENT_ACK_STATE_CONSUMED); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize()); // GFS is added to the queue if another event is pending @@ -1743,9 +1743,11 @@ TEST_F(RenderWidgetHostTest, DeferredGestureTapDown) { EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize()); // Wait long enough for first timeout and see if it fired. - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(10)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(10)); + base::MessageLoop::current()->Run(); EXPECT_EQ(1U, process_->sink().message_count()); EXPECT_EQ(1U, host_->GestureEventLastQueueEventSize()); @@ -1772,9 +1774,11 @@ TEST_F(RenderWidgetHostTest, DeferredGestureTapDownSentOnTap) { EXPECT_EQ(WebInputEvent::GestureTap, host_->GestureEventLastQueueEvent().type); - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(10)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(10)); + base::MessageLoop::current()->Run(); // If the deferral timer incorrectly fired, it sent an extra message. EXPECT_EQ(1U, process_->sink().message_count()); @@ -1794,9 +1798,11 @@ TEST_F(RenderWidgetHostTest, DeferredGestureTapDownOnlyOnce) { EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize()); // Wait long enough for the timeout and verify it fired. - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(10)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(10)); + base::MessageLoop::current()->Run(); EXPECT_EQ(1U, process_->sink().message_count()); EXPECT_EQ(1U, host_->GestureEventLastQueueEventSize()); @@ -1831,9 +1837,11 @@ TEST_F(RenderWidgetHostTest, DeferredGestureTapDownAnulledOnScroll) { EXPECT_EQ(WebInputEvent::GestureScrollBegin, host_->GestureEventLastQueueEvent().type); - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(10)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(10)); + base::MessageLoop::current()->Run(); // If the deferral timer incorrectly fired, it will send an extra message. EXPECT_EQ(1U, process_->sink().message_count()); @@ -1857,9 +1865,11 @@ TEST_F(RenderWidgetHostTest, DeferredGestureTapDownAnulledOnTapCancel) { EXPECT_EQ(0U, process_->sink().message_count()); EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize()); - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(10)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(10)); + base::MessageLoop::current()->Run(); // If the deferral timer incorrectly fired, it will send an extra message. EXPECT_EQ(0U, process_->sink().message_count()); @@ -1878,9 +1888,11 @@ TEST_F(RenderWidgetHostTest, DeferredGestureTapDownTapCancel) { EXPECT_EQ(0U, process_->sink().message_count()); EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize()); - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(10)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(10)); + base::MessageLoop::current()->Run(); EXPECT_EQ(1U, process_->sink().message_count()); EXPECT_EQ(1U, host_->GestureEventLastQueueEventSize()); @@ -1930,9 +1942,11 @@ TEST_F(RenderWidgetHostTest, DebounceDefersFollowingGestureEvents) { EXPECT_EQ(2U, host_->GestureEventLastQueueEventSize()); EXPECT_EQ(3U, host_->GestureEventDebouncingQueueSize()); - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(5)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(5)); + base::MessageLoop::current()->Run(); // The deferred events are correctly queued in coalescing queue. EXPECT_EQ(1U, process_->sink().message_count()); @@ -2977,9 +2991,11 @@ TEST_F(RenderWidgetHostTest, DontPostponeHangMonitorTimeout) { host_->StartHangMonitorTimeout(TimeDelta::FromSeconds(30)); // Wait long enough for first timeout and see if it fired. - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(10)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(10)); + base::MessageLoop::current()->Run(); EXPECT_TRUE(host_->unresponsive_timer_fired()); } @@ -2995,9 +3011,11 @@ TEST_F(RenderWidgetHostTest, StopAndStartHangMonitorTimeout) { host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); // Wait long enough for first timeout and see if it fired. - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(40)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(40)); + base::MessageLoop::current()->Run(); EXPECT_TRUE(host_->unresponsive_timer_fired()); } @@ -3012,9 +3030,11 @@ TEST_F(RenderWidgetHostTest, ShorterDelayHangMonitorTimeout) { host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(20)); // Wait long enough for the second timeout and see if it fired. - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(25)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(25)); + base::MessageLoop::current()->Run(); EXPECT_TRUE(host_->unresponsive_timer_fired()); } @@ -3033,9 +3053,11 @@ TEST_F(RenderWidgetHostTest, MultipleInputEvents) { INPUT_EVENT_ACK_STATE_CONSUMED); // Wait long enough for first timeout and see if it fired. - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(40)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(40)); + base::MessageLoop::current()->Run(); EXPECT_TRUE(host_->unresponsive_timer_fired()); } @@ -3493,9 +3515,11 @@ TEST_F(RenderWidgetHostTest, GestureScrollDebounceTimerOverscroll) { // enough overscroll to complete the gesture, the overscroll controller // will reset the state. The scroll-end should therefore be dispatched to the // renderer, and the gesture-event-filter should await an ACK for it. - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(15)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(15)); + base::MessageLoop::current()->Run(); EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_mode()); EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_delegate()->current_mode()); @@ -3612,9 +3636,11 @@ TEST_F(RenderWidgetHostTest, OverscrollWithTouchEvents) { SimulateGestureEvent(WebKit::WebInputEvent::GestureScrollEnd, WebGestureEvent::Touchscreen); - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(10)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(10)); + base::MessageLoop::current()->Run(); EXPECT_EQ(1U, process_->sink().message_count()); EXPECT_EQ(0U, host_->TouchEventQueueSize()); EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_mode()); @@ -3674,9 +3700,11 @@ TEST_F(RenderWidgetHostTest, TouchGestureEndDispatchedAfterOverscrollComplete) { EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_delegate()->completed_mode()); EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize()); EXPECT_EQ(1U, host_->GestureEventDebouncingQueueSize()); - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(10)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(10)); + base::MessageLoop::current()->Run(); EXPECT_EQ(1U, process_->sink().message_count()); process_->sink().ClearMessages(); EXPECT_EQ(1U, host_->GestureEventLastQueueEventSize()); @@ -3731,9 +3759,11 @@ TEST_F(RenderWidgetHostTest, TouchGestureEndDispatchedAfterOverscrollComplete) { EXPECT_EQ(0U, host_->GestureEventLastQueueEventSize()); EXPECT_EQ(1U, host_->GestureEventDebouncingQueueSize()); - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), TimeDelta::FromMilliseconds(10)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TimeDelta::FromMilliseconds(10)); + base::MessageLoop::current()->Run(); EXPECT_EQ(1U, process_->sink().message_count()); process_->sink().ClearMessages(); EXPECT_EQ(1U, host_->GestureEventLastQueueEventSize()); diff --git a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc index cfacd0c..9ad65fc 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura_unittest.cc @@ -110,7 +110,7 @@ class RenderWidgetHostViewAuraTest : public testing::Test { } protected: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; scoped_ptr<aura::test::AuraTestHelper> aura_test_helper_; scoped_ptr<BrowserContext> browser_context_; MockRenderWidgetHostDelegate delegate_; diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc index 493c82f..43d496b 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc @@ -84,7 +84,7 @@ void NotifyPluginProcessHostHelper(HWND window, HWND parent, int tries) { // it's most likely the one for this plugin, try a few more times after a // delay. if (tries > 0) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&NotifyPluginProcessHostHelper, window, parent, tries - 1), base::TimeDelta::FromMilliseconds(kTryDelayMs)); diff --git a/content/browser/renderer_host/render_widget_host_view_browsertest.cc b/content/browser/renderer_host/render_widget_host_view_browsertest.cc index 2235486..45cdd4b 100644 --- a/content/browser/renderer_host/render_widget_host_view_browsertest.cc +++ b/content/browser/renderer_host/render_widget_host_view_browsertest.cc @@ -77,7 +77,7 @@ class RenderWidgetHostViewBrowserTest : public ContentBrowserTest { // not be available immediately so wait for it. while (!CheckCompositingSurface()) { base::RunLoop run_loop; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, run_loop.QuitClosure(), base::TimeDelta::FromMilliseconds(10)); diff --git a/content/browser/renderer_host/render_widget_host_view_gtk.cc b/content/browser/renderer_host/render_widget_host_view_gtk.cc index 943054a..ece0421 100644 --- a/content/browser/renderer_host/render_widget_host_view_gtk.cc +++ b/content/browser/renderer_host/render_widget_host_view_gtk.cc @@ -928,7 +928,7 @@ void RenderWidgetHostViewGtk::Destroy() { // The RenderWidgetHost's destruction led here, so don't call it. host_ = NULL; - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } void RenderWidgetHostViewGtk::SetTooltipText(const string16& tooltip_text) { diff --git a/content/browser/renderer_host/render_widget_host_view_guest.cc b/content/browser/renderer_host/render_widget_host_view_guest.cc index 26f4cd5..6f02367 100644 --- a/content/browser/renderer_host/render_widget_host_view_guest.cc +++ b/content/browser/renderer_host/render_widget_host_view_guest.cc @@ -435,7 +435,7 @@ void RenderWidgetHostViewGuest::WillWmDestroy() { void RenderWidgetHostViewGuest::DestroyGuestView() { host_ = NULL; - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } bool RenderWidgetHostViewGuest::DispatchLongPressGestureEvent( diff --git a/content/browser/renderer_host/render_widget_host_view_guest_unittest.cc b/content/browser/renderer_host/render_widget_host_view_guest_unittest.cc index fbe45b7..5cac690 100644 --- a/content/browser/renderer_host/render_widget_host_view_guest_unittest.cc +++ b/content/browser/renderer_host/render_widget_host_view_guest_unittest.cc @@ -51,7 +51,7 @@ class RenderWidgetHostViewGuestTest : public testing::Test { } protected: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; scoped_ptr<BrowserContext> browser_context_; MockRenderWidgetHostDelegate delegate_; diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm index 0f2e117..2a72354 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm @@ -1017,7 +1017,7 @@ void RenderWidgetHostViewMac::ForwardMouseEvent(const WebMouseEvent& event) { void RenderWidgetHostViewMac::KillSelf() { if (!weak_factory_.HasWeakPtrs()) { [cocoa_view_ setHidden:YES]; - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&RenderWidgetHostViewMac::ShutdownHost, weak_factory_.GetWeakPtr())); } diff --git a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm index 519ad0f..460ec72 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac_editcommand_helper_unittest.mm @@ -105,7 +105,7 @@ TEST_F(RenderWidgetHostViewMacEditCommandHelperTest, NSArray* edit_command_strings = helper.GetEditSelectorNames(); // Set up a mock render widget and set expectations. - MessageLoopForUI message_loop; + base::MessageLoopForUI message_loop; TestBrowserContext browser_context; MockRenderProcessHost mock_process(&browser_context); MockRenderWidgetHostDelegate delegate; diff --git a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm index 2bd6683..9fa0d0e 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac_unittest.mm @@ -161,7 +161,7 @@ class RenderWidgetHostViewMacTest : public RenderViewHostImplTestHarness { // Make sure the rwhv_mac_ is gone once the superclass's |TearDown()| runs. rwhv_cocoa_.reset(); pool_.Recycle(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); pool_.Recycle(); // See comment in SetUp(). @@ -694,7 +694,7 @@ TEST_F(RenderWidgetHostViewMacTest, ScrollWheelEndEventDelivery) { // render view receives it. NSEvent* event2 = MockScrollWheelEventWithPhase(@selector(phaseEnded)); [NSApp postEvent:event2 atStart:NO]; - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_EQ(2U, process_host->sink().message_count()); // Clean up. diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc index 8b25d1f..000e532 100644 --- a/content/browser/renderer_host/render_widget_host_view_win.cc +++ b/content/browser/renderer_host/render_widget_host_view_win.cc @@ -1501,7 +1501,8 @@ void RenderWidgetHostViewWin::OnCancelMode() { SetWindowPos(NULL, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOREPOSITION | SWP_NOSIZE | SWP_NOZORDER); - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&RenderWidgetHostViewWin::ShutdownHost, weak_factory_.GetWeakPtr())); } diff --git a/content/browser/renderer_host/text_input_client_mac_unittest.mm b/content/browser/renderer_host/text_input_client_mac_unittest.mm index 9930b3e..20976ef 100644 --- a/content/browser/renderer_host/text_input_client_mac_unittest.mm +++ b/content/browser/renderer_host/text_input_client_mac_unittest.mm @@ -35,7 +35,7 @@ class MockRenderWidgetHostDelegate : public RenderWidgetHostDelegate { class TextInputClientMacTest : public testing::Test { public: TextInputClientMacTest() - : message_loop_(MessageLoop::TYPE_UI), + : message_loop_(base::MessageLoop::TYPE_UI), browser_context_(), process_factory_(), delegate_(), @@ -73,7 +73,7 @@ class TextInputClientMacTest : public testing::Test { private: friend class ScopedTestingThread; - MessageLoop message_loop_; + base::MessageLoop message_loop_; TestBrowserContext browser_context_; // Gets deleted when the last RWH in the "process" gets destroyed. diff --git a/content/browser/resolve_proxy_msg_helper_unittest.cc b/content/browser/resolve_proxy_msg_helper_unittest.cc index f0d1c2d..628df86 100644 --- a/content/browser/resolve_proxy_msg_helper_unittest.cc +++ b/content/browser/resolve_proxy_msg_helper_unittest.cc @@ -41,10 +41,10 @@ class ResolveProxyMsgHelperTest : public testing::Test, public IPC::Listener { ResolveProxyMsgHelperTest() : resolver_(new net::MockAsyncProxyResolver), - service_(new net::ProxyService( - new MockProxyConfigService, resolver_, NULL)), + service_( + new net::ProxyService(new MockProxyConfigService, resolver_, NULL)), helper_(new ResolveProxyMsgHelper(service_.get())), - message_loop_(MessageLoop::TYPE_IO), + message_loop_(base::MessageLoop::TYPE_IO), io_thread_(BrowserThread::IO, &message_loop_) { test_sink_.AddFilter(this); helper_->OnFilterAdded(&test_sink_); @@ -79,7 +79,7 @@ class ResolveProxyMsgHelperTest : public testing::Test, public IPC::Listener { return true; } - MessageLoop message_loop_; + base::MessageLoop message_loop_; BrowserThreadImpl io_thread_; IPC::TestSink test_sink_; }; diff --git a/content/browser/site_instance_impl_unittest.cc b/content/browser/site_instance_impl_unittest.cc index cf44325..fb322b1b 100644 --- a/content/browser/site_instance_impl_unittest.cc +++ b/content/browser/site_instance_impl_unittest.cc @@ -123,12 +123,12 @@ class SiteInstanceTest : public testing::Test { // We don't just do this in TearDown() because we create TestBrowserContext // objects in each test, which will be destructed before // TearDown() is called. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); message_loop_.RunUntilIdle(); } private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; TestBrowserThread ui_thread_; TestBrowserThread file_user_blocking_thread_; TestBrowserThread io_thread_; diff --git a/content/browser/speech/google_one_shot_remote_engine_unittest.cc b/content/browser/speech/google_one_shot_remote_engine_unittest.cc index 694e246..7f06f86 100644 --- a/content/browser/speech/google_one_shot_remote_engine_unittest.cc +++ b/content/browser/speech/google_one_shot_remote_engine_unittest.cc @@ -43,7 +43,7 @@ class GoogleOneShotRemoteEngineTest : public SpeechRecognitionEngineDelegate, } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; net::TestURLFetcherFactory url_fetcher_factory_; SpeechRecognitionErrorCode error_; SpeechRecognitionResults results_; diff --git a/content/browser/speech/google_streaming_remote_engine_unittest.cc b/content/browser/speech/google_streaming_remote_engine_unittest.cc index 8223fec..cd23d4b 100644 --- a/content/browser/speech/google_streaming_remote_engine_unittest.cc +++ b/content/browser/speech/google_streaming_remote_engine_unittest.cc @@ -79,7 +79,7 @@ class GoogleStreamingRemoteEngineTest : public SpeechRecognitionEngineDelegate, scoped_ptr<GoogleStreamingRemoteEngine> engine_under_test_; TestURLFetcherFactory url_fetcher_factory_; size_t last_number_of_upstream_chunks_seen_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; std::string response_buffer_; SpeechRecognitionErrorCode error_; std::queue<SpeechRecognitionResults> results_; diff --git a/content/browser/speech/speech_recognition_manager_impl.cc b/content/browser/speech/speech_recognition_manager_impl.cc index d8faf9d..ea49579 100644 --- a/content/browser/speech/speech_recognition_manager_impl.cc +++ b/content/browser/speech/speech_recognition_manager_impl.cc @@ -178,15 +178,21 @@ void SpeechRecognitionManagerImpl::RecognitionAllowedCallback(int session_id, #endif // defined(OS_IOS) if (is_allowed) { - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&SpeechRecognitionManagerImpl::DispatchEvent, - weak_factory_.GetWeakPtr(), session_id, EVENT_START)); + weak_factory_.GetWeakPtr(), + session_id, + EVENT_START)); } else { OnRecognitionError(session_id, SpeechRecognitionError( SPEECH_RECOGNITION_ERROR_NOT_ALLOWED)); - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&SpeechRecognitionManagerImpl::DispatchEvent, - weak_factory_.GetWeakPtr(), session_id, EVENT_ABORT)); + weak_factory_.GetWeakPtr(), + session_id, + EVENT_ABORT)); } } @@ -225,9 +231,12 @@ void SpeechRecognitionManagerImpl::AbortSession(int session_id) { BrowserMainLoop::GetMediaStreamManager()->CancelRequest(context.label); #endif // !defined(OS_IOS) - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&SpeechRecognitionManagerImpl::DispatchEvent, - weak_factory_.GetWeakPtr(), session_id, EVENT_ABORT)); + weak_factory_.GetWeakPtr(), + session_id, + EVENT_ABORT)); } void SpeechRecognitionManagerImpl::StopAudioCaptureForSession(int session_id) { @@ -242,9 +251,12 @@ void SpeechRecognitionManagerImpl::StopAudioCaptureForSession(int session_id) { BrowserMainLoop::GetMediaStreamManager()->CancelRequest(context.label); #endif // !defined(OS_IOS) - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&SpeechRecognitionManagerImpl::DispatchEvent, - weak_factory_.GetWeakPtr(), session_id, EVENT_STOP_CAPTURE)); + weak_factory_.GetWeakPtr(), + session_id, + EVENT_STOP_CAPTURE)); } // Here begins the SpeechRecognitionEventListener interface implementation, @@ -331,9 +343,12 @@ void SpeechRecognitionManagerImpl::OnAudioEnd(int session_id) { delegate_listener->OnAudioEnd(session_id); if (SpeechRecognitionEventListener* listener = GetListener(session_id)) listener->OnAudioEnd(session_id); - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&SpeechRecognitionManagerImpl::DispatchEvent, - weak_factory_.GetWeakPtr(), session_id, EVENT_AUDIO_ENDED)); + weak_factory_.GetWeakPtr(), + session_id, + EVENT_AUDIO_ENDED)); } void SpeechRecognitionManagerImpl::OnRecognitionResults( @@ -390,7 +405,8 @@ void SpeechRecognitionManagerImpl::OnRecognitionEnd(int session_id) { delegate_listener->OnRecognitionEnd(session_id); if (SpeechRecognitionEventListener* listener = GetListener(session_id)) listener->OnRecognitionEnd(session_id); - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&SpeechRecognitionManagerImpl::DispatchEvent, weak_factory_.GetWeakPtr(), session_id, diff --git a/content/browser/speech/speech_recognizer_unittest.cc b/content/browser/speech/speech_recognizer_unittest.cc index 4c061c2..9b55ec5 100644 --- a/content/browser/speech/speech_recognizer_unittest.cc +++ b/content/browser/speech/speech_recognizer_unittest.cc @@ -56,7 +56,7 @@ class SpeechRecognizerTest : public SpeechRecognitionEventListener, recognizer_ = new SpeechRecognizer( this, kTestingSessionId, kOneShotMode, sr_engine); audio_manager_.reset(new media::MockAudioManager( - MessageLoop::current()->message_loop_proxy())); + base::MessageLoop::current()->message_loop_proxy())); recognizer_->SetAudioManagerForTests(audio_manager_.get()); int audio_packet_length_bytes = @@ -162,7 +162,7 @@ class SpeechRecognizerTest : public SpeechRecognitionEventListener, } protected: - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; BrowserThreadImpl io_thread_; scoped_refptr<SpeechRecognizer> recognizer_; scoped_ptr<AudioManager> audio_manager_; @@ -185,7 +185,7 @@ TEST_F(SpeechRecognizerTest, StopNoData) { // Check for callbacks when stopping record before any audio gets recorded. recognizer_->StartRecognition(); recognizer_->StopAudioCapture(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(recognition_started_); EXPECT_FALSE(audio_started_); EXPECT_FALSE(result_received_); @@ -198,7 +198,7 @@ TEST_F(SpeechRecognizerTest, CancelNoData) { // recorded. recognizer_->StartRecognition(); recognizer_->AbortRecognition(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(recognition_started_); EXPECT_FALSE(audio_started_); EXPECT_FALSE(result_received_); @@ -210,7 +210,7 @@ TEST_F(SpeechRecognizerTest, StopWithData) { // Start recording, give some data and then stop. This should wait for the // network callback to arrive before completion. recognizer_->StartRecognition(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); TestAudioInputController* controller = audio_input_controller_factory_.controller(); ASSERT_TRUE(controller); @@ -223,14 +223,14 @@ TEST_F(SpeechRecognizerTest, StopWithData) { for (size_t i = 0; i < kNumChunks; ++i) { controller->event_handler()->OnData(controller, &audio_packet_[0], audio_packet_.size()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); net::TestURLFetcher* fetcher = url_fetcher_factory_.GetFetcherByID(0); ASSERT_TRUE(fetcher); EXPECT_EQ(i + 1, fetcher->upload_chunks().size()); } recognizer_->StopAudioCapture(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(audio_started_); EXPECT_TRUE(audio_ended_); EXPECT_FALSE(recognition_ended_); @@ -249,7 +249,7 @@ TEST_F(SpeechRecognizerTest, StopWithData) { fetcher->SetResponseString( "{\"status\":0,\"hypotheses\":[{\"utterance\":\"123\"}]}"); fetcher->delegate()->OnURLFetchComplete(fetcher); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(recognition_ended_); EXPECT_TRUE(result_received_); EXPECT_EQ(SPEECH_RECOGNITION_ERROR_NONE, error_); @@ -259,15 +259,15 @@ TEST_F(SpeechRecognizerTest, StopWithData) { TEST_F(SpeechRecognizerTest, CancelWithData) { // Start recording, give some data and then cancel. recognizer_->StartRecognition(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); TestAudioInputController* controller = audio_input_controller_factory_.controller(); ASSERT_TRUE(controller); controller->event_handler()->OnData(controller, &audio_packet_[0], audio_packet_.size()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); recognizer_->AbortRecognition(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_TRUE(url_fetcher_factory_.GetFetcherByID(0)); EXPECT_TRUE(recognition_started_); EXPECT_TRUE(audio_started_); @@ -280,18 +280,18 @@ TEST_F(SpeechRecognizerTest, ConnectionError) { // Start recording, give some data and then stop. Issue the network callback // with a connection error and verify that the recognizer bubbles the error up recognizer_->StartRecognition(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); TestAudioInputController* controller = audio_input_controller_factory_.controller(); ASSERT_TRUE(controller); controller->event_handler()->OnData(controller, &audio_packet_[0], audio_packet_.size()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); net::TestURLFetcher* fetcher = url_fetcher_factory_.GetFetcherByID(0); ASSERT_TRUE(fetcher); recognizer_->StopAudioCapture(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(audio_started_); EXPECT_TRUE(audio_ended_); EXPECT_FALSE(recognition_ended_); @@ -307,7 +307,7 @@ TEST_F(SpeechRecognizerTest, ConnectionError) { fetcher->set_response_code(0); fetcher->SetResponseString(std::string()); fetcher->delegate()->OnURLFetchComplete(fetcher); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(recognition_ended_); EXPECT_FALSE(result_received_); EXPECT_EQ(SPEECH_RECOGNITION_ERROR_NETWORK, error_); @@ -318,18 +318,18 @@ TEST_F(SpeechRecognizerTest, ServerError) { // Start recording, give some data and then stop. Issue the network callback // with a 500 error and verify that the recognizer bubbles the error up recognizer_->StartRecognition(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); TestAudioInputController* controller = audio_input_controller_factory_.controller(); ASSERT_TRUE(controller); controller->event_handler()->OnData(controller, &audio_packet_[0], audio_packet_.size()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); net::TestURLFetcher* fetcher = url_fetcher_factory_.GetFetcherByID(0); ASSERT_TRUE(fetcher); recognizer_->StopAudioCapture(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(audio_started_); EXPECT_TRUE(audio_ended_); EXPECT_FALSE(recognition_ended_); @@ -344,7 +344,7 @@ TEST_F(SpeechRecognizerTest, ServerError) { fetcher->set_response_code(500); fetcher->SetResponseString("Internal Server Error"); fetcher->delegate()->OnURLFetchComplete(fetcher); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(recognition_ended_); EXPECT_FALSE(result_received_); EXPECT_EQ(SPEECH_RECOGNITION_ERROR_NETWORK, error_); @@ -354,12 +354,12 @@ TEST_F(SpeechRecognizerTest, ServerError) { TEST_F(SpeechRecognizerTest, AudioControllerErrorNoData) { // Check if things tear down properly if AudioInputController threw an error. recognizer_->StartRecognition(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); TestAudioInputController* controller = audio_input_controller_factory_.controller(); ASSERT_TRUE(controller); controller->event_handler()->OnError(controller); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(recognition_started_); EXPECT_FALSE(audio_started_); EXPECT_FALSE(result_received_); @@ -371,14 +371,14 @@ TEST_F(SpeechRecognizerTest, AudioControllerErrorWithData) { // Check if things tear down properly if AudioInputController threw an error // after giving some audio data. recognizer_->StartRecognition(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); TestAudioInputController* controller = audio_input_controller_factory_.controller(); ASSERT_TRUE(controller); controller->event_handler()->OnData(controller, &audio_packet_[0], audio_packet_.size()); controller->event_handler()->OnError(controller); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_TRUE(url_fetcher_factory_.GetFetcherByID(0)); EXPECT_TRUE(recognition_started_); EXPECT_TRUE(audio_started_); @@ -391,7 +391,7 @@ TEST_F(SpeechRecognizerTest, NoSpeechCallbackIssued) { // Start recording and give a lot of packets with audio samples set to zero. // This should trigger the no-speech detector and issue a callback. recognizer_->StartRecognition(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); TestAudioInputController* controller = audio_input_controller_factory_.controller(); ASSERT_TRUE(controller); @@ -403,7 +403,7 @@ TEST_F(SpeechRecognizerTest, NoSpeechCallbackIssued) { controller->event_handler()->OnData(controller, &audio_packet_[0], audio_packet_.size()); } - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(recognition_started_); EXPECT_TRUE(audio_started_); EXPECT_FALSE(result_received_); @@ -417,7 +417,7 @@ TEST_F(SpeechRecognizerTest, NoSpeechCallbackNotIssued) { // treated as normal speech input and the no-speech detector should not get // triggered. recognizer_->StartRecognition(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); TestAudioInputController* controller = audio_input_controller_factory_.controller(); ASSERT_TRUE(controller); @@ -439,13 +439,13 @@ TEST_F(SpeechRecognizerTest, NoSpeechCallbackNotIssued) { audio_packet_.size()); } - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(SPEECH_RECOGNITION_ERROR_NONE, error_); EXPECT_TRUE(audio_started_); EXPECT_FALSE(audio_ended_); EXPECT_FALSE(recognition_ended_); recognizer_->AbortRecognition(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CheckFinalEventsConsistency(); } @@ -455,7 +455,7 @@ TEST_F(SpeechRecognizerTest, SetInputVolumeCallback) { // get the callback during estimation phase, then get zero for the silence // samples and proper volume for the loud audio. recognizer_->StartRecognition(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); TestAudioInputController* controller = audio_input_controller_factory_.controller(); ASSERT_TRUE(controller); @@ -470,19 +470,19 @@ TEST_F(SpeechRecognizerTest, SetInputVolumeCallback) { controller->event_handler()->OnData(controller, &audio_packet_[0], audio_packet_.size()); } - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(-1.0f, volume_); // No audio volume set yet. // The vector is already filled with zero value samples on create. controller->event_handler()->OnData(controller, &audio_packet_[0], audio_packet_.size()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FLOAT_EQ(0.74939233f, volume_); FillPacketWithTestWaveform(); controller->event_handler()->OnData(controller, &audio_packet_[0], audio_packet_.size()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FLOAT_EQ(0.89926866f, volume_); EXPECT_FLOAT_EQ(0.75071919f, noise_volume_); @@ -490,7 +490,7 @@ TEST_F(SpeechRecognizerTest, SetInputVolumeCallback) { EXPECT_FALSE(audio_ended_); EXPECT_FALSE(recognition_ended_); recognizer_->AbortRecognition(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CheckFinalEventsConsistency(); } diff --git a/content/browser/storage_partition_impl_unittest.cc b/content/browser/storage_partition_impl_unittest.cc index 8b68ef5..631ac7b 100644 --- a/content/browser/storage_partition_impl_unittest.cc +++ b/content/browser/storage_partition_impl_unittest.cc @@ -85,7 +85,7 @@ class StoragePartitionShaderClearTest : public testing::Test { size_t Size() { return cache_->Size(); } - MessageLoop* message_loop() { return &message_loop_; } + base::MessageLoop* message_loop() { return &message_loop_; } private: virtual void TearDown() OVERRIDE { @@ -94,7 +94,7 @@ class StoragePartitionShaderClearTest : public testing::Test { } base::ScopedTempDir temp_dir_; - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; TestBrowserThread ui_thread_; TestBrowserThread cache_thread_; TestBrowserThread io_thread_; diff --git a/content/browser/streams/stream_unittest.cc b/content/browser/streams/stream_unittest.cc index 2c9f34c..3452553 100644 --- a/content/browser/streams/stream_unittest.cc +++ b/content/browser/streams/stream_unittest.cc @@ -32,7 +32,7 @@ class StreamTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; scoped_ptr<StreamRegistry> registry_; private: @@ -138,7 +138,7 @@ TEST_F(StreamTest, Stream) { writer.Write(stream, buffer, kBufferSize); stream->Finalize(); reader.Read(stream); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_EQ(reader.buffer()->capacity(), kBufferSize); for (int i = 0; i < kBufferSize; i++) diff --git a/content/browser/streams/stream_url_request_job.cc b/content/browser/streams/stream_url_request_job.cc index 85e1a6d..4478d16 100644 --- a/content/browser/streams/stream_url_request_job.cc +++ b/content/browser/streams/stream_url_request_job.cc @@ -72,7 +72,7 @@ void StreamURLRequestJob::OnDataAvailable(Stream* stream) { // net::URLRequestJob methods. void StreamURLRequestJob::Start() { // Continue asynchronously. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&StreamURLRequestJob::DidStart, weak_factory_.GetWeakPtr())); } diff --git a/content/browser/streams/stream_url_request_job_unittest.cc b/content/browser/streams/stream_url_request_job_unittest.cc index bed96fa..37d9c4f 100644 --- a/content/browser/streams/stream_url_request_job_unittest.cc +++ b/content/browser/streams/stream_url_request_job_unittest.cc @@ -49,9 +49,7 @@ class StreamURLRequestJobTest : public testing::Test { StreamRegistry* registry_; }; - StreamURLRequestJobTest() - : message_loop_(MessageLoop::TYPE_IO) { - } + StreamURLRequestJobTest() : message_loop_(base::MessageLoop::TYPE_IO) {} virtual void SetUp() { registry_.reset(new StreamRegistry()); @@ -81,7 +79,7 @@ class StreamURLRequestJobTest : public testing::Test { request_->SetExtraRequestHeaders(extra_headers); request_->Start(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Verify response. EXPECT_TRUE(request_->status().is_success()); @@ -91,7 +89,7 @@ class StreamURLRequestJobTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; scoped_ptr<StreamRegistry> registry_; net::URLRequestContext url_request_context_; @@ -135,7 +133,7 @@ TEST_F(StreamURLRequestJobTest, TestGetNonExistentStreamRequest) { request_->set_method("GET"); request_->Start(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Verify response. EXPECT_FALSE(request_->status().is_success()); diff --git a/content/browser/system_message_window_win_unittest.cc b/content/browser/system_message_window_win_unittest.cc index 38566b5..25c77c9d 100644 --- a/content/browser/system_message_window_win_unittest.cc +++ b/content/browser/system_message_window_win_unittest.cc @@ -25,7 +25,7 @@ class SystemMessageWindowWinTest : public testing::Test { system_monitor_.AddDevicesChangedObserver(&observer_); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; base::SystemMonitor system_monitor_; base::MockDevicesChangedObserver observer_; SystemMessageWindowWin window_; diff --git a/content/browser/udev_linux.cc b/content/browser/udev_linux.cc index d9f31db..13f5494 100644 --- a/content/browser/udev_linux.cc +++ b/content/browser/udev_linux.cc @@ -32,8 +32,12 @@ UdevLinux::UdevLinux(const std::vector<UdevMonitorFilter>& filters, monitor_fd_ = udev_monitor_get_fd(monitor_); CHECK_GE(monitor_fd_, 0); - bool success = MessageLoopForIO::current()->WatchFileDescriptor(monitor_fd_, - true, MessageLoopForIO::WATCH_READ, &monitor_watcher_, this); + bool success = base::MessageLoopForIO::current()->WatchFileDescriptor( + monitor_fd_, + true, + base::MessageLoopForIO::WATCH_READ, + &monitor_watcher_, + this); CHECK(success); } diff --git a/content/browser/web_contents/interstitial_page_impl.cc b/content/browser/web_contents/interstitial_page_impl.cc index 33743c6..9673e98 100644 --- a/content/browser/web_contents/interstitial_page_impl.cc +++ b/content/browser/web_contents/interstitial_page_impl.cc @@ -268,7 +268,8 @@ void InterstitialPageImpl::Hide() { // Shutdown the RVH asynchronously, as we may have been called from a RVH // delegate method, and we can't delete the RVH out from under itself. - MessageLoop::current()->PostNonNestableTask(FROM_HERE, + base::MessageLoop::current()->PostNonNestableTask( + FROM_HERE, base::Bind(&InterstitialPageImpl::Shutdown, weak_ptr_factory_.GetWeakPtr(), render_view_host_)); diff --git a/content/browser/web_contents/navigation_controller_impl_unittest.cc b/content/browser/web_contents/navigation_controller_impl_unittest.cc index 1442be1..4a51897e 100644 --- a/content/browser/web_contents/navigation_controller_impl_unittest.cc +++ b/content/browser/web_contents/navigation_controller_impl_unittest.cc @@ -3422,8 +3422,8 @@ class NavigationControllerHistoryTest : public NavigationControllerTest { HistoryService* history = HistoryServiceFactory::GetForProfiles( profile(), Profile::IMPLICIT_ACCESS); if (history) { - history->SetOnBackendDestroyTask(MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + history->SetOnBackendDestroyTask(base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); } // Do normal cleanup before deleting the profile directory below. diff --git a/content/browser/web_contents/render_view_host_manager_unittest.cc b/content/browser/web_contents/render_view_host_manager_unittest.cc index 2639e8d..c4fd94a 100644 --- a/content/browser/web_contents/render_view_host_manager_unittest.cc +++ b/content/browser/web_contents/render_view_host_manager_unittest.cc @@ -130,7 +130,7 @@ class RenderViewHostManagerTest // a regression test for bug 9364. TEST_F(RenderViewHostManagerTest, NewTabPageProcesses) { set_should_create_webui(true); - BrowserThreadImpl ui_thread(BrowserThread::UI, MessageLoop::current()); + BrowserThreadImpl ui_thread(BrowserThread::UI, base::MessageLoop::current()); const GURL kChromeUrl("chrome://foo"); const GURL kDestUrl("http://www.google.com/"); @@ -195,7 +195,7 @@ TEST_F(RenderViewHostManagerTest, NewTabPageProcesses) { // for synchronous messages, which cannot be ignored without leaving the // renderer in a stuck state. See http://crbug.com/93427. TEST_F(RenderViewHostManagerTest, FilterMessagesWhileSwappedOut) { - BrowserThreadImpl ui_thread(BrowserThread::UI, MessageLoop::current()); + BrowserThreadImpl ui_thread(BrowserThread::UI, base::MessageLoop::current()); const GURL kChromeURL("chrome://foo"); const GURL kDestUrl("http://www.google.com/"); @@ -272,7 +272,7 @@ TEST_F(RenderViewHostManagerTest, FilterMessagesWhileSwappedOut) { // EnableViewSourceMode message is sent on every navigation regardless // RenderView is being newly created or reused. TEST_F(RenderViewHostManagerTest, AlwaysSendEnableViewSourceMode) { - BrowserThreadImpl ui_thread(BrowserThread::UI, MessageLoop::current()); + BrowserThreadImpl ui_thread(BrowserThread::UI, base::MessageLoop::current()); const GURL kChromeUrl("chrome://foo"); const GURL kUrl("view-source:http://foo"); @@ -591,7 +591,7 @@ TEST_F(RenderViewHostManagerTest, NavigateWithEarlyReNavigation) { // Tests WebUI creation. TEST_F(RenderViewHostManagerTest, WebUI) { set_should_create_webui(true); - BrowserThreadImpl ui_thread(BrowserThread::UI, MessageLoop::current()); + BrowserThreadImpl ui_thread(BrowserThread::UI, base::MessageLoop::current()); SiteInstance* instance = SiteInstance::Create(browser_context()); scoped_ptr<TestWebContents> web_contents( diff --git a/content/browser/web_contents/web_contents_drag_win.cc b/content/browser/web_contents/web_contents_drag_win.cc index c66391c..8174c97 100644 --- a/content/browser/web_contents/web_contents_drag_win.cc +++ b/content/browser/web_contents/web_contents_drag_win.cc @@ -178,7 +178,7 @@ void WebContentsDragWin::StartDragging(const WebDropData& drop_data, DCHECK(!drag_drop_thread_.get()); drag_drop_thread_.reset(new DragDropThread(this)); base::Thread::Options options; - options.message_loop_type = MessageLoop::TYPE_UI; + options.message_loop_type = base::MessageLoop::TYPE_UI; if (drag_drop_thread_->StartWithOptions(options)) { drag_drop_thread_->message_loop()->PostTask( FROM_HERE, @@ -364,7 +364,8 @@ bool WebContentsDragWin::DoDragging(const WebDropData& drop_data, retain_source->set_data(&data); data.SetInDragLoop(true); - MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); + base::MessageLoop::ScopedNestableTaskAllower allow( + base::MessageLoop::current()); DoDragDrop(ui::OSExchangeDataProviderWin::GetIDataObject(data), drag_source_, WebDragOpMaskToWinDragOpMask(ops), diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc index 8e4f455..7fe338c 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc @@ -158,19 +158,20 @@ class OverscrollWindowDelegate : public ImageWindowDelegate { // Listens to all mouse drag events during a drag and drop and sends them to // the renderer. -class WebDragSourceAura : public MessageLoopForUI::Observer, +class WebDragSourceAura : public base::MessageLoopForUI::Observer, public NotificationObserver { public: WebDragSourceAura(aura::Window* window, WebContentsImpl* contents) : window_(window), contents_(contents) { - MessageLoopForUI::current()->AddObserver(this); - registrar_.Add(this, NOTIFICATION_WEB_CONTENTS_DISCONNECTED, + base::MessageLoopForUI::current()->AddObserver(this); + registrar_.Add(this, + NOTIFICATION_WEB_CONTENTS_DISCONNECTED, Source<WebContents>(contents)); } virtual ~WebDragSourceAura() { - MessageLoopForUI::current()->RemoveObserver(this); + base::MessageLoopForUI::current()->RemoveObserver(this); } // MessageLoop::Observer implementation: @@ -1114,11 +1115,15 @@ void WebContentsViewAura::StartDragging( int result_op = 0; { gfx::NativeView content_native_view = GetContentNativeView(); - MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); - result_op = aura::client::GetDragDropClient(root_window)->StartDragAndDrop( - data, root_window, content_native_view, - event_info.event_location, ConvertFromWeb(operations), - event_info.event_source); + base::MessageLoop::ScopedNestableTaskAllower allow( + base::MessageLoop::current()); + result_op = aura::client::GetDragDropClient(root_window) + ->StartDragAndDrop(data, + root_window, + content_native_view, + event_info.event_location, + ConvertFromWeb(operations), + event_info.event_source); } // Bail out immediately if the contents view window is gone. Note that it is diff --git a/content/browser/web_contents/web_contents_view_mac.mm b/content/browser/web_contents/web_contents_view_mac.mm index f8cb4ae..cd4120e 100644 --- a/content/browser/web_contents/web_contents_view_mac.mm +++ b/content/browser/web_contents/web_contents_view_mac.mm @@ -138,7 +138,8 @@ void WebContentsViewMac::StartDragging( // The drag invokes a nested event loop, arrange to continue // processing events. - MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); + base::MessageLoop::ScopedNestableTaskAllower allow( + base::MessageLoop::current()); NSDragOperation mask = static_cast<NSDragOperation>(allowed_operations); NSPoint offset = NSPointFromCGPoint( gfx::PointAtOffsetFromOrigin(image_offset).ToCGPoint()); diff --git a/content/browser/web_contents/web_drag_dest_gtk.cc b/content/browser/web_contents/web_drag_dest_gtk.cc index fd2763f..6973821 100644 --- a/content/browser/web_contents/web_drag_dest_gtk.cc +++ b/content/browser/web_contents/web_drag_dest_gtk.cc @@ -284,7 +284,8 @@ void WebDragDestGtk::OnDragLeave(GtkWidget* sender, GdkDragContext* context, // preceded by a drag-leave. The renderer doesn't like getting the signals // in this order so delay telling it about the drag-leave till we are sure // we are not getting a drop as well. - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&WebDragDestGtk::DragLeave, method_factory_.GetWeakPtr())); } diff --git a/content/browser/web_contents/web_drag_source_gtk.cc b/content/browser/web_contents/web_drag_source_gtk.cc index 2f1a1cc..05af3f5 100644 --- a/content/browser/web_contents/web_drag_source_gtk.cc +++ b/content/browser/web_contents/web_drag_source_gtk.cc @@ -61,7 +61,7 @@ WebDragSourceGtk::~WebDragSourceGtk() { if (drop_data_) { gtk_grab_add(drag_widget_); gtk_grab_remove(drag_widget_); - MessageLoopForUI::current()->RemoveObserver(this); + base::MessageLoopForUI::current()->RemoveObserver(this); drop_data_.reset(); } @@ -148,7 +148,7 @@ bool WebDragSourceGtk::StartDragging(const WebDropData& drop_data, return false; } - MessageLoopForUI::current()->AddObserver(this); + base::MessageLoopForUI::current()->AddObserver(this); return true; } @@ -360,7 +360,7 @@ void WebDragSourceGtk::OnDragEnd(GtkWidget* sender, drag_pixbuf_ = NULL; } - MessageLoopForUI::current()->RemoveObserver(this); + base::MessageLoopForUI::current()->RemoveObserver(this); if (!download_url_.is_empty()) { gdk_property_delete(drag_context->source_window, diff --git a/content/browser/web_contents/web_drag_source_gtk.h b/content/browser/web_contents/web_drag_source_gtk.h index 90b8c01..4c3381f 100644 --- a/content/browser/web_contents/web_drag_source_gtk.h +++ b/content/browser/web_contents/web_drag_source_gtk.h @@ -30,7 +30,8 @@ class WebContentsImpl; // WebDragSourceGtk takes care of managing the drag from a WebContents // with Gtk. -class CONTENT_EXPORT WebDragSourceGtk : public MessageLoopForUI::Observer { +class CONTENT_EXPORT WebDragSourceGtk : + public base::MessageLoopForUI::Observer { public: explicit WebDragSourceGtk(WebContents* web_contents); virtual ~WebDragSourceGtk(); diff --git a/content/browser/webui/url_data_manager_backend.cc b/content/browser/webui/url_data_manager_backend.cc index 2fd411c..fc1a7068 100644 --- a/content/browser/webui/url_data_manager_backend.cc +++ b/content/browser/webui/url_data_manager_backend.cc @@ -225,10 +225,9 @@ URLRequestChromeJob::~URLRequestChromeJob() { void URLRequestChromeJob::Start() { // Start reading asynchronously so that all error reporting and data // callbacks happen as they would for network requests. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&URLRequestChromeJob::StartAsync, - weak_factory_.GetWeakPtr())); + base::Bind(&URLRequestChromeJob::StartAsync, weak_factory_.GetWeakPtr())); TRACE_EVENT_ASYNC_BEGIN1("browser", "DataManager:Request", this, "URL", request_->url().possibly_invalid_spec()); @@ -518,7 +517,7 @@ bool URLDataManagerBackend::StartRequest(const net::URLRequest* request, &render_view_id); // Forward along the request to the data source. - MessageLoop* target_message_loop = + base::MessageLoop* target_message_loop = source->source()->MessageLoopForRequestPath(path); if (!target_message_loop) { job->MimeTypeAvailable(source->source()->GetMimeType(path)); diff --git a/content/browser/worker_host/test/worker_browsertest.cc b/content/browser/worker_host/test/worker_browsertest.cc index d44fde6..b6ab62f 100644 --- a/content/browser/worker_host/test/worker_browsertest.cc +++ b/content/browser/worker_host/test/worker_browsertest.cc @@ -260,7 +260,7 @@ class WorkerTest : public ContentBrowserTest { for (WorkerProcessHostIterator iter; !iter.Done(); ++iter) (*cur_process_count)++; BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, MessageLoop::QuitClosure()); + BrowserThread::UI, FROM_HERE, base::MessageLoop::QuitClosure()); } bool WaitForWorkerProcessCount(int count) { diff --git a/content/common/child_process.cc b/content/common/child_process.cc index 6bfff5c..95bc331 100644 --- a/content/common/child_process.cc +++ b/content/common/child_process.cc @@ -51,7 +51,7 @@ ChildProcess::ChildProcess() // We can't recover from failing to start the IO thread. CHECK(io_thread_.StartWithOptions( - base::Thread::Options(MessageLoop::TYPE_IO, 0))); + base::Thread::Options(base::MessageLoop::TYPE_IO, 0))); #if defined(OS_ANDROID) // TODO(epenner): Move thread priorities to base. (crbug.com/170549) @@ -89,13 +89,13 @@ void ChildProcess::set_main_thread(ChildThread* thread) { void ChildProcess::AddRefProcess() { DCHECK(!main_thread_.get() || // null in unittests. - MessageLoop::current() == main_thread_->message_loop()); + base::MessageLoop::current() == main_thread_->message_loop()); ref_count_++; } void ChildProcess::ReleaseProcess() { DCHECK(!main_thread_.get() || // null in unittests. - MessageLoop::current() == main_thread_->message_loop()); + base::MessageLoop::current() == main_thread_->message_loop()); DCHECK(ref_count_); DCHECK(child_process_); if (--ref_count_) diff --git a/content/common/child_process.h b/content/common/child_process.h index 09e97d9..dc7df53 100644 --- a/content/common/child_process.h +++ b/content/common/child_process.h @@ -30,7 +30,7 @@ class CONTENT_EXPORT ChildProcess { // Takes ownership of the pointer. void set_main_thread(ChildThread* thread); - MessageLoop* io_message_loop() { return io_thread_.message_loop(); } + base::MessageLoop* io_message_loop() { return io_thread_.message_loop(); } base::MessageLoopProxy* io_message_loop_proxy() { return io_thread_.message_loop_proxy(); } diff --git a/content/common/child_thread.cc b/content/common/child_thread.cc index efb5e71..b301ab7 100644 --- a/content/common/child_thread.cc +++ b/content/common/child_thread.cc @@ -96,11 +96,14 @@ ChildThread::ChildThread(const std::string& channel_name) void ChildThread::Init() { on_channel_error_called_ = false; - message_loop_ = MessageLoop::current(); - channel_.reset(new IPC::SyncChannel(channel_name_, - IPC::Channel::MODE_CLIENT, this, - ChildProcess::current()->io_message_loop_proxy(), true, - ChildProcess::current()->GetShutDownEvent())); + message_loop_ = base::MessageLoop::current(); + channel_.reset( + new IPC::SyncChannel(channel_name_, + IPC::Channel::MODE_CLIENT, + this, + ChildProcess::current()->io_message_loop_proxy(), + true, + ChildProcess::current()->GetShutDownEvent())); #ifdef IPC_MESSAGE_LOG_ENABLED IPC::Logging::GetInstance()->SetIPCSender(this); #endif @@ -129,7 +132,7 @@ void ChildThread::Init() { channel_->AddFilter(new SuicideOnChannelErrorFilter()); #endif - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ChildThread::EnsureConnected, channel_connected_factory_.GetWeakPtr()), @@ -161,11 +164,11 @@ void ChildThread::OnChannelConnected(int32 peer_pid) { void ChildThread::OnChannelError() { set_on_channel_error_called(true); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } bool ChildThread::Send(IPC::Message* msg) { - DCHECK(MessageLoop::current() == message_loop()); + DCHECK(base::MessageLoop::current() == message_loop()); if (!channel_) { delete msg; return false; @@ -175,13 +178,13 @@ bool ChildThread::Send(IPC::Message* msg) { } void ChildThread::AddRoute(int32 routing_id, IPC::Listener* listener) { - DCHECK(MessageLoop::current() == message_loop()); + DCHECK(base::MessageLoop::current() == message_loop()); router_.AddRoute(routing_id, listener); } void ChildThread::RemoveRoute(int32 routing_id) { - DCHECK(MessageLoop::current() == message_loop()); + DCHECK(base::MessageLoop::current() == message_loop()); router_.RemoveRoute(routing_id); } @@ -273,7 +276,7 @@ bool ChildThread::OnControlMessageReceived(const IPC::Message& msg) { } void ChildThread::OnShutdown() { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } #if defined(IPC_MESSAGE_LOG_ENABLED) @@ -333,7 +336,7 @@ bool ChildThread::IsWebFrameValid(WebKit::WebFrame* frame) { void ChildThread::OnProcessFinalRelease() { if (on_channel_error_called_) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); return; } diff --git a/content/common/fileapi/webblobregistry_impl.cc b/content/common/fileapi/webblobregistry_impl.cc index c657684..529d7ac 100644 --- a/content/common/fileapi/webblobregistry_impl.cc +++ b/content/common/fileapi/webblobregistry_impl.cc @@ -31,7 +31,8 @@ WebBlobRegistryImpl::~WebBlobRegistryImpl() { void WebBlobRegistryImpl::registerBlobURL( const WebURL& url, WebBlobData& data) { - DCHECK(ChildThread::current()->message_loop() == MessageLoop::current()); + DCHECK(ChildThread::current()->message_loop() == + base::MessageLoop::current()); const size_t kLargeThresholdBytes = 250 * 1024; const size_t kMaxSharedMemoryBytes = 10 * 1024 * 1024; @@ -111,12 +112,14 @@ void WebBlobRegistryImpl::registerBlobURL( void WebBlobRegistryImpl::registerBlobURL( const WebURL& url, const WebURL& src_url) { - DCHECK(ChildThread::current()->message_loop() == MessageLoop::current()); + DCHECK(ChildThread::current()->message_loop() == + base::MessageLoop::current()); sender_->Send(new BlobHostMsg_CloneBlob(url, src_url)); } void WebBlobRegistryImpl::unregisterBlobURL(const WebURL& url) { - DCHECK(ChildThread::current()->message_loop() == MessageLoop::current()); + DCHECK(ChildThread::current()->message_loop() == + base::MessageLoop::current()); sender_->Send(new BlobHostMsg_RemoveBlob(url)); } diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc index 6688f25..91ff7a6 100644 --- a/content/common/gpu/client/gpu_channel_host.cc +++ b/content/common/gpu/client/gpu_channel_host.cc @@ -117,7 +117,7 @@ bool GpuChannelHost::Send(IPC::Message* message) { base::ThreadRestrictions::ScopedAllowWait allow_wait; return channel_->Send(message); } - } else if (MessageLoop::current()) { + } else if (base::MessageLoop::current()) { return sync_filter_->Send(message); } diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc index 9e7e9ad..e74a7ee 100644 --- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc +++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc @@ -1432,8 +1432,10 @@ void WebGraphicsContext3DCommandBufferImpl::OnSwapBuffersComplete() { typedef WebGraphicsContext3DSwapBuffersClient WGC3DSwapClient; // This may be called after tear-down of the RenderView. if (ShouldUseSwapClient()) { - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( - &WGC3DSwapClient::OnViewContextSwapBuffersComplete, swap_client_)); + base::MessageLoop::current()->PostTask( + FROM_HERE, + base::Bind(&WGC3DSwapClient::OnViewContextSwapBuffersComplete, + swap_client_)); } if (swapbuffers_complete_callback_) diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc index 1cef356..d116d84 100644 --- a/content/common/gpu/gpu_channel.cc +++ b/content/common/gpu/gpu_channel.cc @@ -585,7 +585,7 @@ void GpuChannel::OnScheduled() { // defer newly received messages until the ones in the queue have all been // handled by HandleMessage. HandleMessage is invoked as a // task to prevent reentrancy. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&GpuChannel::HandleMessage, weak_factory_.GetWeakPtr())); handle_messages_scheduled_ = true; @@ -703,7 +703,7 @@ void GpuChannel::LoseAllContexts() { } void GpuChannel::DestroySoon() { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&GpuChannel::OnDestroy, this)); } diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc index d46035e..d695ff5 100644 --- a/content/common/gpu/gpu_channel_manager.cc +++ b/content/common/gpu/gpu_channel_manager.cc @@ -278,7 +278,7 @@ uint64 GpuChannelManager::MessagesProcessed() { } void GpuChannelManager::LoseAllContexts() { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&GpuChannelManager::OnLoseAllContexts, weak_factory_.GetWeakPtr())); diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc index 9ebb287d..4934df5 100644 --- a/content/common/gpu/gpu_command_buffer_stub.cc +++ b/content/common/gpu/gpu_command_buffer_stub.cc @@ -311,10 +311,9 @@ void GpuCommandBufferStub::ScheduleDelayedWork(int64 delay) { delay = 0; } - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, - base::Bind(&GpuCommandBufferStub::PollWork, - AsWeakPtr()), + base::Bind(&GpuCommandBufferStub::PollWork, AsWeakPtr()), base::TimeDelta::FromMilliseconds(delay)); } diff --git a/content/common/gpu/gpu_memory_manager.cc b/content/common/gpu/gpu_memory_manager.cc index 756b572..4794b9f 100644 --- a/content/common/gpu/gpu_memory_manager.cc +++ b/content/common/gpu/gpu_memory_manager.cc @@ -215,9 +215,8 @@ void GpuMemoryManager::ScheduleManage( if (manage_immediate_scheduled_) return; if (schedule_manage_time == kScheduleManageNow) { - MessageLoop::current()->PostTask( - FROM_HERE, - base::Bind(&GpuMemoryManager::Manage, AsWeakPtr())); + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&GpuMemoryManager::Manage, AsWeakPtr())); manage_immediate_scheduled_ = true; if (!delayed_manage_callback_.IsCancelled()) delayed_manage_callback_.Cancel(); @@ -226,10 +225,10 @@ void GpuMemoryManager::ScheduleManage( return; delayed_manage_callback_.Reset(base::Bind(&GpuMemoryManager::Manage, AsWeakPtr())); - MessageLoop::current()->PostDelayedTask( - FROM_HERE, - delayed_manage_callback_.callback(), - base::TimeDelta::FromMilliseconds(kDelayedScheduleManageTimeoutMs)); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + delayed_manage_callback_.callback(), + base::TimeDelta::FromMilliseconds(kDelayedScheduleManageTimeoutMs)); } } diff --git a/content/common/npobject_stub.cc b/content/common/npobject_stub.cc index 668cb08..0e677ee 100644 --- a/content/common/npobject_stub.cc +++ b/content/common/npobject_stub.cc @@ -58,7 +58,7 @@ void NPObjectStub::DeleteSoon() { WebBindings::releaseObject(npobject); - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } } diff --git a/content/common/resource_dispatcher.cc b/content/common/resource_dispatcher.cc index 73f3ca6..b4addcb 100644 --- a/content/common/resource_dispatcher.cc +++ b/content/common/resource_dispatcher.cc @@ -567,9 +567,11 @@ void ResourceDispatcher::SetDefersLoading(int request_id, bool value) { FollowPendingRedirect(request_id, request_info); - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&ResourceDispatcher::FlushDeferredMessages, - weak_factory_.GetWeakPtr(), request_id)); + weak_factory_.GetWeakPtr(), + request_id)); } } diff --git a/content/common/resource_dispatcher_unittest.cc b/content/common/resource_dispatcher_unittest.cc index 5251ffb..7465cec 100644 --- a/content/common/resource_dispatcher_unittest.cc +++ b/content/common/resource_dispatcher_unittest.cc @@ -329,7 +329,7 @@ class DeferredResourceLoadingTest : public ResourceDispatcherTest, }; TEST_F(DeferredResourceLoadingTest, DeferredLoadTest) { - MessageLoop message_loop(MessageLoop::TYPE_IO); + base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); ResourceLoaderBridge* bridge = CreateBridge(); diff --git a/content/common/webmessageportchannel_impl.cc b/content/common/webmessageportchannel_impl.cc index 1833ec1..93e0232 100644 --- a/content/common/webmessageportchannel_impl.cc +++ b/content/common/webmessageportchannel_impl.cc @@ -80,11 +80,11 @@ void WebMessagePortChannelImpl::entangle(WebMessagePortChannel* channel) { void WebMessagePortChannelImpl::postMessage( const WebString& message, WebMessagePortChannelArray* channels) { - if (MessageLoop::current() != ChildThread::current()->message_loop()) { + if (base::MessageLoop::current() != ChildThread::current()->message_loop()) { ChildThread::current()->message_loop()->PostTask( FROM_HERE, - base::Bind(&WebMessagePortChannelImpl::postMessage, this, - message, channels)); + base::Bind( + &WebMessagePortChannelImpl::postMessage, this, message, channels)); return; } @@ -127,10 +127,9 @@ bool WebMessagePortChannelImpl::tryGetMessage( } void WebMessagePortChannelImpl::Init() { - if (MessageLoop::current() != ChildThread::current()->message_loop()) { + if (base::MessageLoop::current() != ChildThread::current()->message_loop()) { ChildThread::current()->message_loop()->PostTask( - FROM_HERE, - base::Bind(&WebMessagePortChannelImpl::Init, this)); + FROM_HERE, base::Bind(&WebMessagePortChannelImpl::Init, this)); return; } @@ -145,7 +144,7 @@ void WebMessagePortChannelImpl::Init() { void WebMessagePortChannelImpl::Entangle( scoped_refptr<WebMessagePortChannelImpl> channel) { - if (MessageLoop::current() != ChildThread::current()->message_loop()) { + if (base::MessageLoop::current() != ChildThread::current()->message_loop()) { ChildThread::current()->message_loop()->PostTask( FROM_HERE, base::Bind(&WebMessagePortChannelImpl::Entangle, this, channel)); @@ -157,10 +156,9 @@ void WebMessagePortChannelImpl::Entangle( } void WebMessagePortChannelImpl::QueueMessages() { - if (MessageLoop::current() != ChildThread::current()->message_loop()) { + if (base::MessageLoop::current() != ChildThread::current()->message_loop()) { ChildThread::current()->message_loop()->PostTask( - FROM_HERE, - base::Bind(&WebMessagePortChannelImpl::QueueMessages, this)); + FROM_HERE, base::Bind(&WebMessagePortChannelImpl::QueueMessages, this)); return; } // This message port is being sent elsewhere (perhaps to another process). @@ -177,7 +175,7 @@ void WebMessagePortChannelImpl::QueueMessages() { } void WebMessagePortChannelImpl::Send(IPC::Message* message) { - if (MessageLoop::current() != ChildThread::current()->message_loop()) { + if (base::MessageLoop::current() != ChildThread::current()->message_loop()) { DCHECK(!message->is_sync()); ChildThread::current()->message_loop()->PostTask( FROM_HERE, diff --git a/content/gpu/gpu_child_thread.cc b/content/gpu/gpu_child_thread.cc index 24b0cd6..a4bc0ff7 100644 --- a/content/gpu/gpu_child_thread.cc +++ b/content/gpu/gpu_child_thread.cc @@ -38,7 +38,7 @@ bool GpuProcessLogMessageHandler(int severity, // If we are not on main thread in child process, send through // the sync_message_filter; otherwise send directly. - if (MessageLoop::current() != + if (base::MessageLoop::current() != ChildProcess::current()->main_thread()->message_loop()) { ChildProcess::current()->main_thread()->sync_message_filter()->Send( new GpuHostMsg_OnLogMessage(severity, header, message)); @@ -127,7 +127,7 @@ void GpuChildThread::OnInitialize() { if (dead_on_arrival_) { VLOG(1) << "Exiting GPU process due to errors during initialization"; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); return; } @@ -193,7 +193,7 @@ void GpuChildThread::OnCollectGraphicsInfo() { #if defined(OS_WIN) if (!in_browser_process_) { // The unsandboxed GPU process fulfilled its duty. Rest in peace. - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } #endif // OS_WIN } diff --git a/content/gpu/gpu_info_collector_win.cc b/content/gpu/gpu_info_collector_win.cc index c085681..402a4b1 100644 --- a/content/gpu/gpu_info_collector_win.cc +++ b/content/gpu/gpu_info_collector_win.cc @@ -604,7 +604,7 @@ bool CollectBasicGraphicsInfo(content::GPUInfo* gpu_info) { // Collect basic information about supported D3D11 features. Delay for 45 // seconds so as not to regress performance tests. if (D3D11ShouldWork(*gpu_info)) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&CollectD3D11Support), base::TimeDelta::FromSeconds(45)); diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc index 7b45e54..6c1045f 100644 --- a/content/gpu/gpu_main.cc +++ b/content/gpu/gpu_main.cc @@ -107,7 +107,7 @@ int GpuMain(const MainFunctionParams& parameters) { // GpuMsg_Initialize message from the browser. bool dead_on_arrival = false; - MessageLoop::Type message_loop_type = MessageLoop::TYPE_IO; + base::MessageLoop::Type message_loop_type = base::MessageLoop::TYPE_IO; #if defined(OS_WIN) // Unless we're running on desktop GL, we don't need a UI message // loop, so avoid its use to work around apparent problems with some @@ -115,13 +115,13 @@ int GpuMain(const MainFunctionParams& parameters) { if (command_line.HasSwitch(switches::kUseGL) && command_line.GetSwitchValueASCII(switches::kUseGL) == gfx::kGLImplementationDesktopName) { - message_loop_type = MessageLoop::TYPE_UI; + message_loop_type = base::MessageLoop::TYPE_UI; } #elif defined(OS_LINUX) - message_loop_type = MessageLoop::TYPE_DEFAULT; + message_loop_type = base::MessageLoop::TYPE_DEFAULT; #endif - MessageLoop main_message_loop(message_loop_type); + base::MessageLoop main_message_loop(message_loop_type); base::PlatformThread::SetName("CrGpuMain"); // In addition to disabling the watchdog if the command line switch is diff --git a/content/gpu/gpu_watchdog_thread.cc b/content/gpu/gpu_watchdog_thread.cc index bbca3e9..09e710e 100644 --- a/content/gpu/gpu_watchdog_thread.cc +++ b/content/gpu/gpu_watchdog_thread.cc @@ -25,7 +25,7 @@ const int64 kCheckPeriodMs = 2000; GpuWatchdogThread::GpuWatchdogThread(int timeout) : base::Thread("Watchdog"), - watched_message_loop_(MessageLoop::current()), + watched_message_loop_(base::MessageLoop::current()), timeout_(base::TimeDelta::FromMilliseconds(timeout)), armed_(false), #if defined(OS_WIN) diff --git a/content/gpu/gpu_watchdog_thread.h b/content/gpu/gpu_watchdog_thread.h index 49c6236..22cc887 100644 --- a/content/gpu/gpu_watchdog_thread.h +++ b/content/gpu/gpu_watchdog_thread.h @@ -38,7 +38,7 @@ class GpuWatchdogThread : public base::Thread, // An object of this type intercepts the reception and completion of all tasks // on the watched thread and checks whether the watchdog is armed. - class GpuWatchdogTaskObserver : public MessageLoop::TaskObserver { + class GpuWatchdogTaskObserver : public base::MessageLoop::TaskObserver { public: explicit GpuWatchdogTaskObserver(GpuWatchdogThread* watchdog); virtual ~GpuWatchdogTaskObserver(); @@ -62,7 +62,7 @@ class GpuWatchdogThread : public base::Thread, base::TimeDelta GetWatchedThreadTime(); #endif - MessageLoop* watched_message_loop_; + base::MessageLoop* watched_message_loop_; base::TimeDelta timeout_; volatile bool armed_; GpuWatchdogTaskObserver task_observer_; diff --git a/content/plugin/plugin_channel.cc b/content/plugin/plugin_channel.cc index 3a27e61..781ca00 100644 --- a/content/plugin/plugin_channel.cc +++ b/content/plugin/plugin_channel.cc @@ -67,7 +67,7 @@ class PluginChannel::MessageFilter : public IPC::ChannelProxy::MessageFilter { return; // Delete the event when the stack unwinds as it could be in use now. - MessageLoop::current()->DeleteSoon( + base::MessageLoop::current()->DeleteSoon( FROM_HERE, modal_dialog_event_map_[render_view_id].event); modal_dialog_event_map_.erase(render_view_id); } @@ -200,7 +200,7 @@ base::WaitableEvent* PluginChannel::GetModalDialogEvent(int render_view_id) { } PluginChannel::~PluginChannel() { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&PluginReleaseCallback), base::TimeDelta::FromMinutes(kPluginReleaseTimeMinutes)); @@ -280,9 +280,11 @@ void PluginChannel::OnDestroyInstance(int instance_id, // Don't release the modal dialog event right away, but do it after the // stack unwinds since the plugin can be destroyed later if it's in use // right now. - MessageLoop::current()->PostNonNestableTask(FROM_HERE, base::Bind( - &MessageFilter::ReleaseModalDialogEvent, filter.get(), - render_view_id)); + base::MessageLoop::current()->PostNonNestableTask( + FROM_HERE, + base::Bind(&MessageFilter::ReleaseModalDialogEvent, + filter.get(), + render_view_id)); return; } } diff --git a/content/plugin/plugin_main.cc b/content/plugin/plugin_main.cc index 2f0817e..298fbd4 100644 --- a/content/plugin/plugin_main.cc +++ b/content/plugin/plugin_main.cc @@ -52,7 +52,7 @@ int PluginMain(const MainFunctionParams& parameters) { #endif InitializeChromeApplication(); #endif - MessageLoop main_message_loop(MessageLoop::TYPE_UI); + base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); base::PlatformThread::SetName("CrPluginMain"); base::PowerMonitor power_monitor; @@ -77,7 +77,7 @@ int PluginMain(const MainFunctionParams& parameters) { { ChildProcess plugin_process; plugin_process.set_main_thread(new PluginThread()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } return 0; diff --git a/content/plugin/plugin_thread.cc b/content/plugin/plugin_thread.cc index 595bf5b..8256ef6 100644 --- a/content/plugin/plugin_thread.cc +++ b/content/plugin/plugin_thread.cc @@ -58,7 +58,7 @@ class EnsureTerminateMessageFilter : public IPC::ChannelProxy::MessageFilter { // Ensure that we don't wait indefinitely for the plugin to shutdown. // as the browser does not terminate plugin processes on shutdown. // We achieve this by posting an exit process task on the IO thread. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&EnsureTerminateMessageFilter::Terminate, this), kPluginProcessTerminateTimeout); diff --git a/content/plugin/webplugin_delegate_stub.cc b/content/plugin/webplugin_delegate_stub.cc index e1e1e00..5c25961 100644 --- a/content/plugin/webplugin_delegate_stub.cc +++ b/content/plugin/webplugin_delegate_stub.cc @@ -65,9 +65,12 @@ WebPluginDelegateStub::~WebPluginDelegateStub() { if (channel_->in_send()) { // The delegate or an npobject is in the callstack, so don't delete it // right away. - MessageLoop::current()->PostNonNestableTask(FROM_HERE, - base::Bind(&DestroyWebPluginAndDelegate, plugin_scriptable_object_, - delegate_, webplugin_)); + base::MessageLoop::current()->PostNonNestableTask( + FROM_HERE, + base::Bind(&DestroyWebPluginAndDelegate, + plugin_scriptable_object_, + delegate_, + webplugin_)); } else { // Safe to delete right away. DestroyWebPluginAndDelegate( diff --git a/content/plugin/webplugin_proxy.cc b/content/plugin/webplugin_proxy.cc index 91980f6..43e177c 100644 --- a/content/plugin/webplugin_proxy.cc +++ b/content/plugin/webplugin_proxy.cc @@ -199,9 +199,11 @@ void WebPluginProxy::InvalidateRect(const gfx::Rect& rect) { waiting_for_paint_ = true; // Invalidates caused by calls to NPN_InvalidateRect/NPN_InvalidateRgn // need to be painted asynchronously as per the NPAPI spec. - MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&WebPluginProxy::OnPaint, weak_factory_.GetWeakPtr(), - damaged_rect_)); + base::MessageLoop::current()->PostTask( + FROM_HERE, + base::Bind(&WebPluginProxy::OnPaint, + weak_factory_.GetWeakPtr(), + damaged_rect_)); damaged_rect_ = gfx::Rect(); } } diff --git a/content/ppapi_plugin/broker_process_dispatcher.cc b/content/ppapi_plugin/broker_process_dispatcher.cc index c6d8592..68b6746 100644 --- a/content/ppapi_plugin/broker_process_dispatcher.cc +++ b/content/ppapi_plugin/broker_process_dispatcher.cc @@ -105,7 +105,7 @@ BrokerProcessDispatcher::~BrokerProcessDispatcher() { // plugin. This is the case for common plugins where they may be used on a // source and destination page of a navigation. We don't want to tear down // and re-start processes each time in these cases. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ChildProcess::ReleaseProcess, base::Unretained(ChildProcess::current())), diff --git a/content/ppapi_plugin/plugin_process_dispatcher.cc b/content/ppapi_plugin/plugin_process_dispatcher.cc index 34d46ab..12fe91b 100644 --- a/content/ppapi_plugin/plugin_process_dispatcher.cc +++ b/content/ppapi_plugin/plugin_process_dispatcher.cc @@ -32,7 +32,7 @@ PluginProcessDispatcher::~PluginProcessDispatcher() { // plugin. This is the case for common plugins where they may be used on a // source and destination page of a navigation. We don't want to tear down // and re-start processes each time in these cases. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ChildProcess::ReleaseProcess, base::Unretained(ChildProcess::current())), diff --git a/content/ppapi_plugin/ppapi_broker_main.cc b/content/ppapi_plugin/ppapi_broker_main.cc index 04315f5..e2c6097 100644 --- a/content/ppapi_plugin/ppapi_broker_main.cc +++ b/content/ppapi_plugin/ppapi_broker_main.cc @@ -19,7 +19,7 @@ int PpapiBrokerMain(const MainFunctionParams& parameters) { ChildProcess::WaitForDebugger("PpapiBroker"); } - MessageLoop main_message_loop(MessageLoop::TYPE_DEFAULT); + base::MessageLoop main_message_loop(base::MessageLoop::TYPE_DEFAULT); base::PlatformThread::SetName("CrPPAPIBrokerMain"); ChildProcess ppapi_broker_process; diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc index 62c87ac..25ea26e 100644 --- a/content/ppapi_plugin/ppapi_plugin_main.cc +++ b/content/ppapi_plugin/ppapi_plugin_main.cc @@ -79,7 +79,7 @@ int PpapiPluginMain(const MainFunctionParams& parameters) { #endif } - MessageLoop main_message_loop; + base::MessageLoop main_message_loop; base::PlatformThread::SetName("CrPPAPIMain"); #if defined(OS_LINUX) && defined(USE_NSS) diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc index 8cb454f..4f4be32 100644 --- a/content/ppapi_plugin/ppapi_thread.cc +++ b/content/ppapi_plugin/ppapi_thread.cc @@ -129,7 +129,7 @@ void PpapiThread::Shutdown() { bool PpapiThread::Send(IPC::Message* msg) { // Allow access from multiple threads. - if (MessageLoop::current() == message_loop()) + if (base::MessageLoop::current() == message_loop()) return ChildThread::Send(msg); return sync_message_filter()->Send(msg); diff --git a/content/public/test/download_test_observer.cc b/content/public/test/download_test_observer.cc index 6a0504e..3d91825 100644 --- a/content/public/test/download_test_observer.cc +++ b/content/public/test/download_test_observer.cc @@ -78,7 +78,7 @@ void DownloadUpdatedObserver::OnDownloadUpdated(DownloadItem* item) { if (filter_.Run(item_)) event_seen_ = true; if (waiting_ && event_seen_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } void DownloadUpdatedObserver::OnDownloadDestroyed(DownloadItem* item) { @@ -86,7 +86,7 @@ void DownloadUpdatedObserver::OnDownloadDestroyed(DownloadItem* item) { item_->RemoveObserver(this); item_ = NULL; if (waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } DownloadTestObserver::DownloadTestObserver( @@ -231,7 +231,7 @@ void DownloadTestObserver::DownloadInFinalState(DownloadItem* download) { void DownloadTestObserver::SignalIfFinished() { if (waiting_ && IsFinished()) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } DownloadTestObserverTerminal::DownloadTestObserverTerminal( @@ -379,7 +379,7 @@ void DownloadTestFlushObserver::PingIOThread(int cycle) { base::Bind(&DownloadTestFlushObserver::PingFileThread, this, cycle)); } else { BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, MessageLoop::QuitClosure()); + BrowserThread::UI, FROM_HERE, base::MessageLoop::QuitClosure()); } } @@ -415,7 +415,7 @@ void DownloadTestItemCreationObserver::DownloadItemCreationCallback( DCHECK_EQ(1u, called_back_count_); if (waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } const DownloadUrlParameters::OnStartedCallback diff --git a/content/public/test/fake_speech_recognition_manager.cc b/content/public/test/fake_speech_recognition_manager.cc index 3bc2946..8f89255 100644 --- a/content/public/test/fake_speech_recognition_manager.cc +++ b/content/public/test/fake_speech_recognition_manager.cc @@ -54,14 +54,16 @@ void FakeSpeechRecognitionManager::StartSession(int session_id) { if (should_send_fake_response_) { // Give the fake result in a short while. - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( - &FakeSpeechRecognitionManager::SetFakeRecognitionResult, - // This class does not need to be refcounted (typically done by - // PostTask) since it will outlive the test and gets released only - // when the test shuts down. Disabling refcounting here saves a bit - // of unnecessary code and the factory method can return a plain - // pointer below as required by the real code. - base::Unretained(this))); + base::MessageLoop::current()->PostTask( + FROM_HERE, + base::Bind( + &FakeSpeechRecognitionManager::SetFakeRecognitionResult, + // This class does not need to be refcounted (typically done by + // PostTask) since it will outlive the test and gets released only + // when the test shuts down. Disabling refcounting here saves a bit + // of unnecessary code and the factory method can return a plain + // pointer below as required by the real code. + base::Unretained(this))); } recognition_started_event_.Signal(); } diff --git a/content/public/test/mock_render_process_host.cc b/content/public/test/mock_render_process_host.cc index d877d44..235afa5 100644 --- a/content/public/test/mock_render_process_host.cc +++ b/content/public/test/mock_render_process_host.cc @@ -168,7 +168,7 @@ void MockRenderProcessHost::Cleanup() { NOTIFICATION_RENDERER_PROCESS_TERMINATED, Source<RenderProcessHost>(this), NotificationService::NoDetails()); - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); RenderProcessHostImpl::UnregisterHost(GetID()); } } diff --git a/content/public/test/mock_render_thread.h b/content/public/test/mock_render_thread.h index c8f1419..d90275c 100644 --- a/content/public/test/mock_render_thread.h +++ b/content/public/test/mock_render_thread.h @@ -38,7 +38,7 @@ class MockRenderThread : public RenderThread { // RenderThread implementation: virtual bool Send(IPC::Message* msg) OVERRIDE; - virtual MessageLoop* GetMessageLoop() OVERRIDE; + virtual base::MessageLoop* GetMessageLoop() OVERRIDE; virtual IPC::SyncChannel* GetChannel() OVERRIDE; virtual std::string GetLocale() OVERRIDE; virtual IPC::SyncMessageFilter* GetSyncMessageFilter() OVERRIDE; diff --git a/content/public/test/render_view_fake_resources_test.h b/content/public/test/render_view_fake_resources_test.h index cde8596..a9688d9 100644 --- a/content/public/test/render_view_fake_resources_test.h +++ b/content/public/test/render_view_fake_resources_test.h @@ -127,7 +127,7 @@ class RenderViewFakeResourcesTest : public ::testing::Test, static const int32 kViewId; // arbitrary id for our testing view - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; ContentRendererClient content_renderer_client_; // channel that the renderer uses to talk to the browser. // For this test, we will handle the browser end of the channel. diff --git a/content/public/test/render_view_test.cc b/content/public/test/render_view_test.cc index 8b575d0..da2513e 100644 --- a/content/public/test/render_view_test.cc +++ b/content/public/test/render_view_test.cc @@ -77,7 +77,7 @@ RenderViewTest::~RenderViewTest() { } void RenderViewTest::ProcessPendingMessages() { - msg_loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure()); + msg_loop_.PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); msg_loop_.Run(); } diff --git a/content/public/test/render_view_test.h b/content/public/test/render_view_test.h index 3b1e160..a30adac 100644 --- a/content/public/test/render_view_test.h +++ b/content/public/test/render_view_test.h @@ -124,7 +124,7 @@ class RenderViewTest : public testing::Test { virtual void TearDown() OVERRIDE; - MessageLoop msg_loop_; + base::MessageLoop msg_loop_; scoped_ptr<MockRenderProcess> mock_process_; // We use a naked pointer because we don't want to expose RenderViewImpl in // the embedder's namespace. diff --git a/content/public/test/test_browser_thread.cc b/content/public/test/test_browser_thread.cc index 6920ce0..f024a21 100644 --- a/content/public/test/test_browser_thread.cc +++ b/content/public/test/test_browser_thread.cc @@ -19,10 +19,9 @@ class TestBrowserThreadImpl : public BrowserThreadImpl { } TestBrowserThreadImpl(BrowserThread::ID identifier, - MessageLoop* message_loop) + base::MessageLoop* message_loop) : BrowserThreadImpl(identifier, message_loop), - notification_service_(NULL) { - } + notification_service_(NULL) {} virtual ~TestBrowserThreadImpl() { Stop(); @@ -50,9 +49,8 @@ TestBrowserThread::TestBrowserThread(BrowserThread::ID identifier) } TestBrowserThread::TestBrowserThread(BrowserThread::ID identifier, - MessageLoop* message_loop) - : impl_(new TestBrowserThreadImpl(identifier, message_loop)) { -} + base::MessageLoop* message_loop) + : impl_(new TestBrowserThreadImpl(identifier, message_loop)) {} TestBrowserThread::~TestBrowserThread() { Stop(); @@ -64,7 +62,7 @@ bool TestBrowserThread::Start() { bool TestBrowserThread::StartIOThread() { base::Thread::Options options; - options.message_loop_type = MessageLoop::TYPE_IO; + options.message_loop_type = base::MessageLoop::TYPE_IO; return impl_->StartWithOptions(options); } diff --git a/content/public/test/test_renderer_host.h b/content/public/test/test_renderer_host.h index 4c74aff..44b5ff8 100644 --- a/content/public/test/test_renderer_host.h +++ b/content/public/test/test_renderer_host.h @@ -168,7 +168,7 @@ class RenderViewHostTestHarness : public testing::Test { // SetUp(). scoped_ptr<BrowserContext> browser_context_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; private: // It is important not to use this directly in the implementation as diff --git a/content/public/test/test_utils.cc b/content/public/test/test_utils.cc index ab0fcd61..6c318c3 100644 --- a/content/public/test/test_utils.cc +++ b/content/public/test/test_utils.cc @@ -34,7 +34,8 @@ static void DeferredQuitRunLoop(const base::Closure& quit_task, if (num_quit_deferrals <= 0) { quit_task.Run(); } else { - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&DeferredQuitRunLoop, quit_task, num_quit_deferrals - 1)); } } @@ -63,7 +64,7 @@ class ScriptCallback { void ScriptCallback::ResultCallback(const base::Value* result) { if (result) result_.reset(result->DeepCopy()); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } // namespace @@ -74,7 +75,8 @@ void RunMessageLoop() { } void RunThisRunLoop(base::RunLoop* run_loop) { - MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); + base::MessageLoop::ScopedNestableTaskAllower allow( + base::MessageLoop::current()); // If we're running inside a browser test, we might need to allow the test // launcher to do extra work before/after running a nested message loop. @@ -90,8 +92,8 @@ void RunThisRunLoop(base::RunLoop* run_loop) { } void RunAllPendingInMessageLoop() { - MessageLoop::current()->PostTask(FROM_HERE, - MessageLoop::QuitWhenIdleClosure()); + base::MessageLoop::current()->PostTask( + FROM_HERE, base::MessageLoop::QuitWhenIdleClosure()); RunMessageLoop(); } @@ -127,7 +129,7 @@ scoped_ptr<base::Value> ExecuteScriptAndGetValue( string16(), // frame_xpath, UTF8ToUTF16(script), base::Bind(&ScriptCallback::ResultCallback, base::Unretained(&observer))); - MessageLoop* loop = MessageLoop::current(); + base::MessageLoop* loop = base::MessageLoop::current(); loop->Run(); return observer.result().Pass(); } diff --git a/content/renderer/accessibility/renderer_accessibility_complete.cc b/content/renderer/accessibility/renderer_accessibility_complete.cc index c59e0fd..9e5a97b 100644 --- a/content/renderer/accessibility/renderer_accessibility_complete.cc +++ b/content/renderer/accessibility/renderer_accessibility_complete.cc @@ -227,12 +227,11 @@ void RendererAccessibilityComplete::HandleAccessibilityNotification( // When no accessibility notifications are in-flight post a task to send // the notifications to the browser. We use PostTask so that we can queue // up additional notifications. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, - base::Bind( - &RendererAccessibilityComplete:: - SendPendingAccessibilityNotifications, - weak_factory_.GetWeakPtr())); + base::Bind(&RendererAccessibilityComplete:: + SendPendingAccessibilityNotifications, + weak_factory_.GetWeakPtr())); } } diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc index 1681649..002d2a5 100644 --- a/content/renderer/browser_plugin/browser_plugin.cc +++ b/content/renderer/browser_plugin/browser_plugin.cc @@ -732,7 +732,7 @@ void BrowserPlugin::OnUpdateRect( // with the last seen view size. if (container_ && !size_changed_in_flight_) { size_changed_in_flight_ = true; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&BrowserPlugin::SizeChangedDueToAutoSize, base::Unretained(this), @@ -1012,10 +1012,11 @@ void BrowserPlugin::WeakCallbackForPersistObject( // Asynchronously remove item from |alive_v8_permission_request_objects_|. // Note that we are using weak pointer for the following PostTask, so we // don't need to worry about BrowserPlugin going away. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&BrowserPlugin::OnRequestObjectGarbageCollected, - plugin, request_id)); + plugin, + request_id)); } } @@ -1182,7 +1183,7 @@ void BrowserPlugin::destroy() { // Will be a no-op if the mouse is not currently locked. if (render_view_) render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(this); - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } NPObject* BrowserPlugin::scriptableObject() { diff --git a/content/renderer/browser_plugin/mock_browser_plugin_manager.cc b/content/renderer/browser_plugin/mock_browser_plugin_manager.cc index e6da3bc..3759535 100644 --- a/content/renderer/browser_plugin/mock_browser_plugin_manager.cc +++ b/content/renderer/browser_plugin/mock_browser_plugin_manager.cc @@ -30,7 +30,7 @@ BrowserPlugin* MockBrowserPluginManager::CreateBrowserPlugin( void MockBrowserPluginManager::AllocateInstanceID( BrowserPlugin* browser_plugin) { int instance_id = ++browser_plugin_counter_; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&MockBrowserPluginManager::AllocateInstanceIDACK, this, diff --git a/content/renderer/devtools/devtools_agent.cc b/content/renderer/devtools/devtools_agent.cc index 1ab030a..674cbc5 100644 --- a/content/renderer/devtools/devtools_agent.cc +++ b/content/renderer/devtools/devtools_agent.cc @@ -47,19 +47,17 @@ namespace { class WebKitClientMessageLoopImpl : public WebDevToolsAgentClient::WebKitClientMessageLoop { public: - WebKitClientMessageLoopImpl() : message_loop_(MessageLoop::current()) { } - virtual ~WebKitClientMessageLoopImpl() { - message_loop_ = NULL; - } + WebKitClientMessageLoopImpl() : message_loop_(base::MessageLoop::current()) {} + virtual ~WebKitClientMessageLoopImpl() { message_loop_ = NULL; } virtual void run() { - MessageLoop::ScopedNestableTaskAllower allow(message_loop_); + base::MessageLoop::ScopedNestableTaskAllower allow(message_loop_); message_loop_->Run(); } virtual void quitNow() { message_loop_->QuitNow(); } private: - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; }; typedef std::map<int, DevToolsAgent*> IdToAgentMap; diff --git a/content/renderer/devtools/devtools_agent_filter.cc b/content/renderer/devtools/devtools_agent_filter.cc index 7a4e90b..76062d9 100644 --- a/content/renderer/devtools/devtools_agent_filter.cc +++ b/content/renderer/devtools/devtools_agent_filter.cc @@ -42,9 +42,8 @@ class MessageImpl : public WebDevToolsAgent::MessageDescriptor { DevToolsAgentFilter::DevToolsAgentFilter() : message_handled_(false), - render_thread_loop_(MessageLoop::current()), - current_routing_id_(0) { -} + render_thread_loop_(base::MessageLoop::current()), + current_routing_id_(0) {} bool DevToolsAgentFilter::OnMessageReceived(const IPC::Message& message) { // Dispatch debugger commands directly from IO. diff --git a/content/renderer/gpu/input_event_filter_unittest.cc b/content/renderer/gpu/input_event_filter_unittest.cc index b33c8fc..24064db 100644 --- a/content/renderer/gpu/input_event_filter_unittest.cc +++ b/content/renderer/gpu/input_event_filter_unittest.cc @@ -110,7 +110,7 @@ void AddMessagesToFilter(IPC::ChannelProxy::MessageFilter* message_filter, message_filter->OnMessageReceived(events[i]); } - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } void AddEventsToFilter(IPC::ChannelProxy::MessageFilter* message_filter, @@ -142,7 +142,7 @@ class InputEventFilterTest : public testing::Test { protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; // Used to record IPCs sent by the filter to the RenderWidgetHost. IPC::TestSink ipc_sink_; diff --git a/content/renderer/image_loading_helper.cc b/content/renderer/image_loading_helper.cc index c996984..ff6e2bd 100644 --- a/content/renderer/image_loading_helper.cc +++ b/content/renderer/image_loading_helper.cc @@ -95,7 +95,7 @@ void ImageLoadingHelper::DidDownloadImage( std::find(image_fetchers_.begin(), image_fetchers_.end(), fetcher); if (iter != image_fetchers_.end()) { image_fetchers_.weak_erase(iter); - MessageLoop::current()->DeleteSoon(FROM_HERE, fetcher); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, fetcher); } } diff --git a/content/renderer/load_progress_tracker.cc b/content/renderer/load_progress_tracker.cc index 79e058a..93b79ed 100644 --- a/content/renderer/load_progress_tracker.cc +++ b/content/renderer/load_progress_tracker.cc @@ -68,7 +68,7 @@ void LoadProgressTracker::DidChangeLoadProgress(WebKit::WebFrame* frame, if (weak_factory_.HasWeakPtrs()) return; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&LoadProgressTracker::SendChangeLoadProgress, weak_factory_.GetWeakPtr()), diff --git a/content/renderer/p2p/ipc_network_manager.cc b/content/renderer/p2p/ipc_network_manager.cc index 00ee114..34a65c5 100644 --- a/content/renderer/p2p/ipc_network_manager.cc +++ b/content/renderer/p2p/ipc_network_manager.cc @@ -26,9 +26,10 @@ IpcNetworkManager::~IpcNetworkManager() { void IpcNetworkManager::StartUpdating() { if (network_list_received_) { // Post a task to avoid reentrancy. - MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&IpcNetworkManager::SendNetworksChangedSignal, - weak_factory_.GetWeakPtr())); + base::MessageLoop::current()->PostTask( + FROM_HERE, + base::Bind(&IpcNetworkManager::SendNetworksChangedSignal, + weak_factory_.GetWeakPtr())); } ++start_count_; } diff --git a/content/renderer/p2p/ipc_socket_factory.cc b/content/renderer/p2p/ipc_socket_factory.cc index 3fd0556..d1f5686 100644 --- a/content/renderer/p2p/ipc_socket_factory.cc +++ b/content/renderer/p2p/ipc_socket_factory.cc @@ -73,7 +73,7 @@ class IpcPacketSocket : public talk_base::AsyncPacketSocket, P2PSocketType type_; // Message loop on which this socket was created and being used. - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; // Corresponding P2P socket client. scoped_refptr<P2PSocketClient> client_; @@ -105,12 +105,11 @@ class IpcPacketSocket : public talk_base::AsyncPacketSocket, IpcPacketSocket::IpcPacketSocket() : type_(P2P_SOCKET_UDP), - message_loop_(MessageLoop::current()), + message_loop_(base::MessageLoop::current()), state_(IS_UNINITIALIZED), send_packets_pending_(0), writable_signal_expected_(false), - error_(0) { -} + error_(0) {} IpcPacketSocket::~IpcPacketSocket() { if (state_ == IS_OPENING || state_ == IS_OPEN || @@ -122,7 +121,7 @@ IpcPacketSocket::~IpcPacketSocket() { bool IpcPacketSocket::Init(P2PSocketType type, P2PSocketClient* client, const talk_base::SocketAddress& local_address, const talk_base::SocketAddress& remote_address) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); DCHECK_EQ(state_, IS_UNINITIALIZED); type_ = type; @@ -151,7 +150,7 @@ void IpcPacketSocket::InitAcceptedTcp( P2PSocketClient* client, const talk_base::SocketAddress& local_address, const talk_base::SocketAddress& remote_address) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); DCHECK_EQ(state_, IS_UNINITIALIZED); client_ = client; @@ -163,23 +162,23 @@ void IpcPacketSocket::InitAcceptedTcp( // talk_base::AsyncPacketSocket interface. talk_base::SocketAddress IpcPacketSocket::GetLocalAddress() const { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); return local_address_; } talk_base::SocketAddress IpcPacketSocket::GetRemoteAddress() const { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); return remote_address_; } int IpcPacketSocket::Send(const void *data, size_t data_size) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); return SendTo(data, data_size, remote_address_); } int IpcPacketSocket::SendTo(const void *data, size_t data_size, const talk_base::SocketAddress& address) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); switch (state_) { case IS_UNINITIALIZED: @@ -221,7 +220,7 @@ int IpcPacketSocket::SendTo(const void *data, size_t data_size, } int IpcPacketSocket::Close() { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); client_->Close(); state_ = IS_CLOSED; @@ -230,7 +229,7 @@ int IpcPacketSocket::Close() { } talk_base::AsyncPacketSocket::State IpcPacketSocket::GetState() const { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); switch (state_) { case IS_UNINITIALIZED: @@ -267,17 +266,17 @@ int IpcPacketSocket::SetOption(talk_base::Socket::Option opt, int value) { } int IpcPacketSocket::GetError() const { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); return error_; } void IpcPacketSocket::SetError(int error) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); error_ = error; } void IpcPacketSocket::OnOpen(const net::IPEndPoint& address) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); if (!jingle_glue::IPEndPointToSocketAddress(address, &local_address_)) { // Always expect correct IPv4 address to be allocated. @@ -296,7 +295,7 @@ void IpcPacketSocket::OnOpen(const net::IPEndPoint& address) { void IpcPacketSocket::OnIncomingTcpConnection( const net::IPEndPoint& address, P2PSocketClient* client) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); scoped_ptr<IpcPacketSocket> socket(new IpcPacketSocket()); @@ -310,7 +309,7 @@ void IpcPacketSocket::OnIncomingTcpConnection( } void IpcPacketSocket::OnSendComplete() { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); --send_packets_pending_; DCHECK_GE(send_packets_pending_, 0); @@ -323,14 +322,14 @@ void IpcPacketSocket::OnSendComplete() { } void IpcPacketSocket::OnError() { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); state_ = IS_ERROR; error_ = ECONNABORTED; } void IpcPacketSocket::OnDataReceived(const net::IPEndPoint& address, const std::vector<char>& data) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); talk_base::SocketAddress address_lj; if (!jingle_glue::IPEndPointToSocketAddress(address, &address_lj)) { diff --git a/content/renderer/pepper/pepper_broker_impl_unittest.cc b/content/renderer/pepper/pepper_broker_impl_unittest.cc index aa61bf8..dc894a9 100644 --- a/content/renderer/pepper/pepper_broker_impl_unittest.cc +++ b/content/renderer/pepper/pepper_broker_impl_unittest.cc @@ -16,7 +16,7 @@ namespace content { class PepperBrokerImplTest : public ::testing::Test { protected: - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; // We need a render process for ppapi::proxy::ProxyChannel to work. MockRenderProcess mock_process_; }; diff --git a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc index 26788f8..2352673 100644 --- a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc +++ b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc @@ -70,10 +70,13 @@ class PepperDeviceEnumerationHostHelper::ScopedRequest bool succeeded, const std::vector<ppapi::DeviceRefData>& devices) { if (sync_call_) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&ScopedRequest::EnumerateDevicesCallbackBody, AsWeakPtr(), - request_id, succeeded, devices)); + base::Bind(&ScopedRequest::EnumerateDevicesCallbackBody, + AsWeakPtr(), + request_id, + succeeded, + devices)); } else { DCHECK_EQ(request_id_, request_id); callback_.Run(request_id, succeeded, devices); diff --git a/content/renderer/pepper/pepper_graphics_2d_host.cc b/content/renderer/pepper/pepper_graphics_2d_host.cc index 89a43e9..778f4f0 100644 --- a/content/renderer/pepper/pepper_graphics_2d_host.cc +++ b/content/renderer/pepper/pepper_graphics_2d_host.cc @@ -725,7 +725,7 @@ void PepperGraphics2DHost::SendOffscreenFlushAck() { void PepperGraphics2DHost::ScheduleOffscreenFlushAck() { offscreen_flush_pending_ = true; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&PepperGraphics2DHost::SendOffscreenFlushAck, weak_ptr_factory_.GetWeakPtr()), diff --git a/content/renderer/pepper/pepper_in_process_router.cc b/content/renderer/pepper/pepper_in_process_router.cc index 62f7dbd..acd4226 100644 --- a/content/renderer/pepper/pepper_in_process_router.cc +++ b/content/renderer/pepper/pepper_in_process_router.cc @@ -94,11 +94,11 @@ bool PepperInProcessRouter::SendToPlugin(IPC::Message* msg) { } else { CHECK(!pending_message_id_); // Dispatch plugin messages from the message loop. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&PepperInProcessRouter::DispatchPluginMsg, - weak_factory_.GetWeakPtr(), - base::Owned(message.release()))); + weak_factory_.GetWeakPtr(), + base::Owned(message.release()))); } return true; } diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc index 89e3be8..110e1bc 100644 --- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc +++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc @@ -1406,11 +1406,12 @@ int PepperPluginDelegateImpl::EnumerateDevices( PepperDeviceEnumerationEventHandler::FromPepperDeviceType(type), GURL()); #else - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind( &PepperDeviceEnumerationEventHandler::OnDevicesEnumerationFailed, - device_enumeration_event_handler_->AsWeakPtr(), request_id)); + device_enumeration_event_handler_->AsWeakPtr(), + request_id)); #endif return request_id; @@ -1423,12 +1424,12 @@ void PepperPluginDelegateImpl::StopEnumerateDevices(int request_id) { #if defined(ENABLE_WEBRTC) // Need to post task since this function might be called inside the callback // of EnumerateDevices. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, - base::Bind( - &MediaStreamDispatcher::StopEnumerateDevices, - render_view_->media_stream_dispatcher()->AsWeakPtr(), - request_id, device_enumeration_event_handler_.get()->AsWeakPtr())); + base::Bind(&MediaStreamDispatcher::StopEnumerateDevices, + render_view_->media_stream_dispatcher()->AsWeakPtr(), + request_id, + device_enumeration_event_handler_.get()->AsWeakPtr())); #endif } @@ -1570,10 +1571,11 @@ int PepperPluginDelegateImpl::OpenDevice(PP_DeviceType_Dev type, PepperDeviceEnumerationEventHandler::FromPepperDeviceType(type), GURL()); #else - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&PepperDeviceEnumerationEventHandler::OnDeviceOpenFailed, - device_enumeration_event_handler_->AsWeakPtr(), request_id)); + device_enumeration_event_handler_->AsWeakPtr(), + request_id)); #endif return request_id; diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 68b6450..28acc8b 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -729,7 +729,7 @@ void RenderThreadImpl::EnsureWebKitInitialized() { bool enable = command_line.HasSwitch(switches::kEnableThreadedCompositing); if (enable) { - MessageLoop* override_loop = + base::MessageLoop* override_loop = GetContentClient()->renderer()->OverrideCompositorMessageLoop(); if (override_loop) { compositor_message_loop_proxy_ = override_loop->message_loop_proxy(); @@ -854,7 +854,7 @@ scoped_ptr<base::SharedMemory> new ChildProcessHostMsg_SyncAllocateSharedMemory(size, &handle); // Allow calling this from the compositor thread. - if (MessageLoop::current() == message_loop()) + if (base::MessageLoop::current() == message_loop()) success = ChildThread::Send(message); else success = sync_message_filter()->Send(message); @@ -1097,7 +1097,8 @@ bool RenderThreadImpl::IsMainThread() { } bool RenderThreadImpl::IsIOThread() { - return MessageLoop::current() == ChildProcess::current()->io_message_loop(); + return base::MessageLoop::current() == + ChildProcess::current()->io_message_loop(); } MessageLoop* RenderThreadImpl::GetMainLoop() { @@ -1132,7 +1133,7 @@ int32 RenderThreadImpl::CreateViewCommandBuffer( &route_id); // Allow calling this from the compositor thread. - if (MessageLoop::current() == message_loop()) + if (base::MessageLoop::current() == message_loop()) ChildThread::Send(message); else sync_message_filter()->Send(message); @@ -1330,7 +1331,7 @@ void RenderThreadImpl::OnSetWebKitSharedTimersSuspended(bool suspend) { scoped_refptr<base::MessageLoopProxy> RenderThreadImpl::GetFileThreadMessageLoopProxy() { - DCHECK(message_loop() == MessageLoop::current()); + DCHECK(message_loop() == base::MessageLoop::current()); if (!file_thread_) { file_thread_.reset(new base::Thread("Renderer::FILE")); file_thread_->Start(); diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h index 8d2fd2a..be9b176 100644 --- a/content/renderer/render_thread_impl.h +++ b/content/renderer/render_thread_impl.h @@ -115,7 +115,7 @@ class CONTENT_EXPORT RenderThreadImpl : public RenderThread, // RenderThread implementation: virtual bool Send(IPC::Message* msg) OVERRIDE; - virtual MessageLoop* GetMessageLoop() OVERRIDE; + virtual base::MessageLoop* GetMessageLoop() OVERRIDE; virtual IPC::SyncChannel* GetChannel() OVERRIDE; virtual std::string GetLocale() OVERRIDE; virtual IPC::SyncMessageFilter* GetSyncMessageFilter() OVERRIDE; @@ -158,7 +158,7 @@ class CONTENT_EXPORT RenderThreadImpl : public RenderThread, // GpuChannelHostFactory implementation: virtual bool IsMainThread() OVERRIDE; virtual bool IsIOThread() OVERRIDE; - virtual MessageLoop* GetMainLoop() OVERRIDE; + virtual base::MessageLoop* GetMainLoop() OVERRIDE; virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE; virtual base::WaitableEvent* GetShutDownEvent() OVERRIDE; virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory( diff --git a/content/renderer/render_thread_impl_browsertest.cc b/content/renderer/render_thread_impl_browsertest.cc index 79eb6bc..d8dc67b 100644 --- a/content/renderer/render_thread_impl_browsertest.cc +++ b/content/renderer/render_thread_impl_browsertest.cc @@ -38,7 +38,7 @@ TEST_F(RenderThreadImplBrowserTest, ContentRendererClient content_renderer_client; SetRendererClientForTesting(&content_renderer_client); - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; std::string channel_id = IPC::Channel::GenerateVerifiedChannelID( std::string()); diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 5ea62ca..2150615 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -6286,10 +6286,12 @@ WebContentDetectionResult RenderViewImpl::detectContentAround( void RenderViewImpl::scheduleContentIntent(const WebURL& intent) { // Introduce a short delay so that the user can notice the content. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, - base::Bind(&RenderViewImpl::LaunchAndroidContentIntent, AsWeakPtr(), - intent, expected_content_intent_id_), + base::Bind(&RenderViewImpl::LaunchAndroidContentIntent, + AsWeakPtr(), + intent, + expected_content_intent_id_), base::TimeDelta::FromMilliseconds(kContentIntentDelayMilliseconds)); } diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index b681e5d..1939bb6 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc @@ -426,7 +426,7 @@ void RenderWidget::OnClose() { // If there is a Send call on the stack, then it could be dangerous to close // now. Post a task that only gets invoked when there are no nested message // loops. - MessageLoop::current()->PostNonNestableTask( + base::MessageLoop::current()->PostNonNestableTask( FROM_HERE, base::Bind(&RenderWidget::Close, this)); // Balances the AddRef taken when we called AddRoute. @@ -1325,7 +1325,7 @@ void RenderWidget::didInvalidateRect(const WebRect& rect) { // 2) Allows us to collect more damage rects before painting to help coalesce // the work that we will need to do. invalidation_task_posted_ = true; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&RenderWidget::InvalidationCallback, this)); } @@ -1366,7 +1366,7 @@ void RenderWidget::didScrollRect(int dx, int dy, // 2) Allows us to collect more damage rects before painting to help coalesce // the work that we will need to do. invalidation_task_posted_ = true; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&RenderWidget::InvalidationCallback, this)); } @@ -1610,7 +1610,7 @@ void RenderWidget::closeWidgetSoon() { // could be closed before the JS finishes executing. So instead, post a // message back to the message loop, which won't run until the JS is // complete, and then the Close message can be sent. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&RenderWidget::DoDeferredClose, this)); } diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc index b69c0df..cc8e584 100644 --- a/content/renderer/renderer_main.cc +++ b/content/renderer/renderer_main.cc @@ -64,7 +64,7 @@ static void HandleRendererErrorTestParameters(const CommandLine& command_line) { // This is a simplified version of the browser Jankometer, which measures // the processing time of tasks on the render thread. -class RendererMessageLoopObserver : public MessageLoop::TaskObserver { +class RendererMessageLoopObserver : public base::MessageLoop::TaskObserver { public: RendererMessageLoopObserver() : process_times_(base::Histogram::FactoryGet( @@ -88,7 +88,7 @@ class RendererMessageLoopObserver : public MessageLoop::TaskObserver { }; // For measuring memory usage after each task. Behind a command line flag. -class MemoryObserver : public MessageLoop::TaskObserver { +class MemoryObserver : public base::MessageLoop::TaskObserver { public: MemoryObserver() {} virtual ~MemoryObserver() {} @@ -145,12 +145,13 @@ int RendererMain(const MainFunctionParams& parameters) { #if defined(OS_MACOSX) // As long as we use Cocoa in the renderer (for the forseeable future as of // now; see http://crbug.com/13890 for info) we need to have a UI loop. - MessageLoop main_message_loop(MessageLoop::TYPE_UI); + base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); #else // The main message loop of the renderer services doesn't have IO or UI tasks, // unless in-process-plugins is used. - MessageLoop main_message_loop(RenderProcessImpl::InProcessPlugins() ? - MessageLoop::TYPE_UI : MessageLoop::TYPE_DEFAULT); + base::MessageLoop main_message_loop(RenderProcessImpl::InProcessPlugins() + ? base::MessageLoop::TYPE_UI + : base::MessageLoop::TYPE_DEFAULT); #endif main_message_loop.AddTaskObserver(&task_observer); @@ -231,7 +232,7 @@ int RendererMain(const MainFunctionParams& parameters) { pool->Recycle(); #endif TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); } } diff --git a/content/renderer/webplugin_delegate_proxy.cc b/content/renderer/webplugin_delegate_proxy.cc index bc0f057..c3459ed 100644 --- a/content/renderer/webplugin_delegate_proxy.cc +++ b/content/renderer/webplugin_delegate_proxy.cc @@ -168,14 +168,14 @@ class ResourceClientProxy : public webkit::npapi::WebPluginResourceClient { DCHECK(channel_ != NULL); channel_->Send(new PluginMsg_DidFinishLoading(instance_id_, resource_id_)); channel_ = NULL; - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } virtual void DidFail() OVERRIDE { DCHECK(channel_ != NULL); channel_->Send(new PluginMsg_DidFail(instance_id_, resource_id_)); channel_ = NULL; - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } virtual bool IsMultiByteResponseExpected() OVERRIDE { @@ -279,7 +279,7 @@ void WebPluginDelegateProxy::PluginDestroyed() { plugin_ = NULL; - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } bool WebPluginDelegateProxy::Initialize( diff --git a/content/shell/renderer/webkit_test_runner.cc b/content/shell/renderer/webkit_test_runner.cc index a090cea..a4c2d6b 100644 --- a/content/shell/renderer/webkit_test_runner.cc +++ b/content/shell/renderer/webkit_test_runner.cc @@ -221,7 +221,7 @@ void WebKitTestRunner::postTask(WebTask* task) { } void WebKitTestRunner::postDelayedTask(WebTask* task, long long ms) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&WebTask::run, base::Owned(task)), base::TimeDelta::FromMilliseconds(ms)); @@ -653,7 +653,7 @@ void WebKitTestRunner::CaptureDump() { } } - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(base::IgnoreResult(&WebKitTestRunner::Send), base::Unretained(this), diff --git a/content/shell/shell.cc b/content/shell/shell.cc index 521c9c5..5eac7af 100644 --- a/content/shell/shell.cc +++ b/content/shell/shell.cc @@ -77,7 +77,8 @@ Shell::~Shell() { } if (windows_.empty() && quit_message_loop_) - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); } Shell* Shell::CreateShell(WebContents* web_contents) { @@ -105,7 +106,7 @@ void Shell::CloseAllWindows() { std::vector<Shell*> open_windows(windows_); for (size_t i = 0; i < open_windows.size(); ++i) open_windows[i]->Close(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } void Shell::SetShellCreatedCallback( diff --git a/content/shell/shell_browser_main.cc b/content/shell/shell_browser_main.cc index 595999a..e6e45c3 100644 --- a/content/shell/shell_browser_main.cc +++ b/content/shell/shell_browser_main.cc @@ -120,7 +120,8 @@ int ShellBrowserMain(const content::MainFunctionParams& parameters) { if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kCheckLayoutTestSysDeps)) { - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); main_runner_->Run(); content::Shell::CloseAllWindows(); main_runner_->Shutdown(); @@ -170,7 +171,8 @@ int ShellBrowserMain(const content::MainFunctionParams& parameters) { break; } if (!ran_at_least_once) { - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); main_runner_->Run(); } exit_code = 0; diff --git a/content/shell/shell_browser_main_parts.cc b/content/shell/shell_browser_main_parts.cc index 738ca26..99ff7ce 100644 --- a/content/shell/shell_browser_main_parts.cc +++ b/content/shell/shell_browser_main_parts.cc @@ -91,7 +91,7 @@ void ShellBrowserMainParts::PreMainMessageLoopStart() { void ShellBrowserMainParts::PostMainMessageLoopStart() { #if defined(OS_ANDROID) - MessageLoopForUI::current()->Start(); + base::MessageLoopForUI::current()->Start(); #endif } diff --git a/content/shell/shell_url_request_context_getter.cc b/content/shell/shell_url_request_context_getter.cc index e3f6bd5..2fa6c39a 100644 --- a/content/shell/shell_url_request_context_getter.cc +++ b/content/shell/shell_url_request_context_getter.cc @@ -56,8 +56,8 @@ void InstallProtocolHandlers(net::URLRequestJobFactoryImpl* job_factory, ShellURLRequestContextGetter::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) : ignore_certificate_errors_(ignore_certificate_errors), base_path_(base_path), diff --git a/content/shell/webkit_test_controller.cc b/content/shell/webkit_test_controller.cc index bf7e24c..ab12295 100644 --- a/content/shell/webkit_test_controller.cc +++ b/content/shell/webkit_test_controller.cc @@ -252,7 +252,7 @@ bool WebKitTestController::PrepareForLayoutTest( if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoTimeout)) { watchdog_.Reset(base::Bind(&WebKitTestController::TimeoutHandler, base::Unretained(this))); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, watchdog_.callback(), base::TimeDelta::FromMilliseconds(kTestTimeoutMilliseconds + 1000)); @@ -424,7 +424,8 @@ void WebKitTestController::DiscardMainWindow() { WebContentsObserver::Observe(NULL); if (is_running_test_) { Shell::CloseAllWindows(); - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); } else if (main_window_) { main_window_->Close(); } @@ -463,7 +464,7 @@ void WebKitTestController::OnTestFinished(bool did_timeout) { printer_->PrintImageFooter(); RenderViewHost* render_view_host = main_window_->web_contents()->GetRenderViewHost(); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(base::IgnoreResult(&WebKitTestController::Send), base::Unretained(this), @@ -608,11 +609,12 @@ void WebKitTestController::OnCloseRemainingWindows() { if (open_windows[i] != main_window_) open_windows[i]->Close(); } - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } void WebKitTestController::OnResetDone() { - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); } } // namespace content diff --git a/content/test/content_browser_test.cc b/content/test/content_browser_test.cc index 27f3097..bcaa587 100644 --- a/content/test/content_browser_test.cc +++ b/content/test/content_browser_test.cc @@ -108,7 +108,7 @@ void ContentBrowserTest::RunTestOnMainThreadLoop() { #endif // Pump startup related events. - MessageLoopForUI::current()->RunUntilIdle(); + base::MessageLoopForUI::current()->RunUntilIdle(); #if defined(OS_MACOSX) pool.Recycle(); diff --git a/content/test/content_test_launcher.cc b/content/test/content_test_launcher.cc index 2a662e7..ae26552 100644 --- a/content/test/content_test_launcher.cc +++ b/content/test/content_test_launcher.cc @@ -75,7 +75,8 @@ class ContentBrowserTestSuite : public ContentTestSuiteBase { #if defined(OS_ANDROID) // This needs to be done before base::TestSuite::Initialize() is called, // as it also tries to set MessagePumpForUIFactory. - if (!MessageLoop::InitMessagePumpForUIFactory(&CreateMessagePumpForUI)) + if (!base::MessageLoop::InitMessagePumpForUIFactory( + &CreateMessagePumpForUI)) LOG(INFO) << "MessagePumpForUIFactory already set, unable to override."; #endif diff --git a/content/test/net/url_request_abort_on_end_job.cc b/content/test/net/url_request_abort_on_end_job.cc index 531e5a3..2173887 100644 --- a/content/test/net/url_request_abort_on_end_job.cc +++ b/content/test/net/url_request_abort_on_end_job.cc @@ -91,7 +91,7 @@ void URLRequestAbortOnEndJob::StartAsync() { } void URLRequestAbortOnEndJob::Start() { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&URLRequestAbortOnEndJob::StartAsync, weak_factory_.GetWeakPtr())); diff --git a/content/test/net/url_request_failed_job.cc b/content/test/net/url_request_failed_job.cc index b489296..dfeac52 100644 --- a/content/test/net/url_request_failed_job.cc +++ b/content/test/net/url_request_failed_job.cc @@ -51,10 +51,9 @@ URLRequestFailedJob::URLRequestFailedJob(net::URLRequest* request, URLRequestFailedJob::~URLRequestFailedJob() {} void URLRequestFailedJob::Start() { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&URLRequestFailedJob::StartAsync, - weak_factory_.GetWeakPtr())); + base::Bind(&URLRequestFailedJob::StartAsync, weak_factory_.GetWeakPtr())); } // static diff --git a/content/test/net/url_request_slow_download_job.cc b/content/test/net/url_request_slow_download_job.cc index 844ad36..7b46136 100644 --- a/content/test/net/url_request_slow_download_job.cc +++ b/content/test/net/url_request_slow_download_job.cc @@ -37,7 +37,7 @@ base::LazyInstance<URLRequestSlowDownloadJob::SlowJobsSet>::Leaky URLRequestSlowDownloadJob::pending_requests_ = LAZY_INSTANCE_INITIALIZER; void URLRequestSlowDownloadJob::Start() { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&URLRequestSlowDownloadJob::StartAsync, weak_factory_.GetWeakPtr())); @@ -186,7 +186,7 @@ bool URLRequestSlowDownloadJob::ReadRawData(net::IOBuffer* buf, int buf_size, buffer_ = buf; buffer_size_ = buf_size; SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING, 0)); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&URLRequestSlowDownloadJob::CheckDoneStatus, weak_factory_.GetWeakPtr()), @@ -215,7 +215,7 @@ void URLRequestSlowDownloadJob::CheckDoneStatus() { NotifyDone(net::URLRequestStatus( net::URLRequestStatus::FAILED, net::ERR_CONNECTION_RESET)); } else { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&URLRequestSlowDownloadJob::CheckDoneStatus, weak_factory_.GetWeakPtr()), diff --git a/content/test/webrtc_audio_device_test.cc b/content/test/webrtc_audio_device_test.cc index e37679c..7bd5b30 100644 --- a/content/test/webrtc_audio_device_test.cc +++ b/content/test/webrtc_audio_device_test.cc @@ -117,7 +117,7 @@ class MockRTCResourceContext : public ResourceContext { }; ACTION_P(QuitMessageLoop, loop_or_proxy) { - loop_or_proxy->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + loop_or_proxy->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } WebRTCAudioDeviceTest::WebRTCAudioDeviceTest() @@ -135,8 +135,8 @@ void WebRTCAudioDeviceTest::SetUp() { saved_content_renderer_.reset( new ReplaceContentClientRenderer(&content_renderer_client_)); mock_process_.reset(new WebRTCMockRenderProcess()); - ui_thread_.reset(new TestBrowserThread(BrowserThread::UI, - MessageLoop::current())); + ui_thread_.reset( + new TestBrowserThread(BrowserThread::UI, base::MessageLoop::current())); // Construct the resource context on the UI thread. resource_context_.reset(new MockRTCResourceContext); @@ -202,8 +202,8 @@ void WebRTCAudioDeviceTest::InitializeIOThread(const char* thread_name) { #endif // Set the current thread as the IO thread. - io_thread_.reset(new TestBrowserThread(BrowserThread::IO, - MessageLoop::current())); + io_thread_.reset( + new TestBrowserThread(BrowserThread::IO, base::MessageLoop::current())); // Populate our resource context. test_request_context_.reset(new net::TestURLRequestContext()); diff --git a/content/test/webrtc_audio_device_test.h b/content/test/webrtc_audio_device_test.h index ed9760d..f15e3bb 100644 --- a/content/test/webrtc_audio_device_test.h +++ b/content/test/webrtc_audio_device_test.h @@ -151,7 +151,7 @@ class WebRTCAudioDeviceTest : public ::testing::Test, public IPC::Listener { std::string GetTestDataPath(const base::FilePath::StringType& file_name); scoped_ptr<ReplaceContentClientRenderer> saved_content_renderer_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; ContentRendererClient content_renderer_client_; RenderThreadImpl* render_thread_; // Owned by mock_process_. scoped_ptr<WebRTCMockRenderProcess> mock_process_; diff --git a/content/utility/utility_main.cc b/content/utility/utility_main.cc index 42ae597..04f7714 100644 --- a/content/utility/utility_main.cc +++ b/content/utility/utility_main.cc @@ -23,7 +23,7 @@ namespace content { // Mainline routine for running as the utility process. int UtilityMain(const MainFunctionParams& parameters) { // The main message loop of the utility process. - MessageLoop main_message_loop; + base::MessageLoop main_message_loop; base::PlatformThread::SetName("CrUtilityMain"); base::PowerMonitor power_monitor; @@ -48,7 +48,7 @@ int UtilityMain(const MainFunctionParams& parameters) { } #endif - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); return 0; } diff --git a/content/worker/websharedworkerclient_proxy.cc b/content/worker/websharedworkerclient_proxy.cc index 7bbbdc4..4db74b8 100644 --- a/content/worker/websharedworkerclient_proxy.cc +++ b/content/worker/websharedworkerclient_proxy.cc @@ -207,10 +207,10 @@ void WebSharedWorkerClientProxy::EnsureWorkerContextTerminates() { // process, and avoids the crashed worker infobar from appearing to the new // page. It's ok to post several of theese, because the first executed task // will exit the message loop and subsequent ones won't be executed. - MessageLoop::current()->PostDelayedTask(FROM_HERE, - base::Bind( - &WebSharedWorkerClientProxy::workerContextDestroyed, - weak_factory_.GetWeakPtr()), + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::Bind(&WebSharedWorkerClientProxy::workerContextDestroyed, + weak_factory_.GetWeakPtr()), base::TimeDelta::FromSeconds(kMaxTimeForRunawayWorkerSeconds)); } diff --git a/content/worker/worker_main.cc b/content/worker/worker_main.cc index 58aca31..459e907 100644 --- a/content/worker/worker_main.cc +++ b/content/worker/worker_main.cc @@ -28,7 +28,7 @@ namespace content { // Mainline routine for running as the worker process. int WorkerMain(const MainFunctionParams& parameters) { // The main message loop of the worker process. - MessageLoop main_message_loop; + base::MessageLoop main_message_loop; base::PlatformThread::SetName("CrWorkerMain"); base::PowerMonitor power_monitor; @@ -67,7 +67,7 @@ int WorkerMain(const MainFunctionParams& parameters) { // Load the accelerator table from the browser executable and tell the // message loop to use it when translating messages. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); return 0; } |