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 /content/browser | |
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
Diffstat (limited to 'content/browser')
109 files changed, 558 insertions, 487 deletions
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) { |