diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-28 22:08:16 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-28 22:08:16 +0000 |
commit | b3a25098c4a6895e1acd139146d618094dbd4df8 (patch) | |
tree | a344a722e481f117b63e701ba26108339dd7296f /chrome | |
parent | 3d8ab9f85ac4bd6e49213ab5bfbd1e620e24d261 (diff) | |
download | chromium_src-b3a25098c4a6895e1acd139146d618094dbd4df8.zip chromium_src-b3a25098c4a6895e1acd139146d618094dbd4df8.tar.gz chromium_src-b3a25098c4a6895e1acd139146d618094dbd4df8.tar.bz2 |
chrome: Use base::MessageLoop. (Part 3)
This CL updates chrome/browser/* other than chrome/browser/ui which is in
another CL.
BUG=236029
TBR=brettw
Review URL: https://chromiumcodereview.appspot.com/14113053
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202664 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
571 files changed, 1863 insertions, 1809 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index 26ea4fb..2012af5 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -835,7 +835,7 @@ void RecordLastRunAppBundlePath() { // nested message loop and commands dispatched during this operation cause // havoc. if (SessionRestore::IsRestoring(lastProfile) && - MessageLoop::current()->IsNested()) + base::MessageLoop::current()->IsNested()) return; NSInteger tag = [sender tag]; diff --git a/chrome/browser/autocomplete/autocomplete_provider_unittest.cc b/chrome/browser/autocomplete/autocomplete_provider_unittest.cc index d16ac4d..25318a2 100644 --- a/chrome/browser/autocomplete/autocomplete_provider_unittest.cc +++ b/chrome/browser/autocomplete/autocomplete_provider_unittest.cc @@ -96,8 +96,8 @@ void TestProvider::Start(const AutocompleteInput& input, if (input.matches_requested() == AutocompleteInput::ALL_MATCHES) { done_ = false; - MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&TestProvider::Run, - this)); + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(&TestProvider::Run, this)); } } @@ -194,7 +194,7 @@ class AutocompleteProviderTest : public testing::Test, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::NotificationRegistrar registrar_; TestingProfile profile_; }; @@ -393,7 +393,7 @@ void AutocompleteProviderTest::RunQuery(const string16 query) { if (!controller_->done()) // The message loop will terminate when all autocomplete input has been // collected. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } void AutocompleteProviderTest::RunExactKeymatchTest( @@ -422,7 +422,7 @@ void AutocompleteProviderTest::Observe( const content::NotificationDetails& details) { if (controller_->done()) { result_.CopyFrom(controller_->result()); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } diff --git a/chrome/browser/autocomplete/contact_provider_chromeos_unittest.cc b/chrome/browser/autocomplete/contact_provider_chromeos_unittest.cc index 0add80b..99e215c 100644 --- a/chrome/browser/autocomplete/contact_provider_chromeos_unittest.cc +++ b/chrome/browser/autocomplete/contact_provider_chromeos_unittest.cc @@ -123,7 +123,7 @@ class ContactProviderTest : public testing::Test { return result; } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_ptr<TestingProfileManager> profile_manager_; diff --git a/chrome/browser/autocomplete/extension_app_provider_unittest.cc b/chrome/browser/autocomplete/extension_app_provider_unittest.cc index 29cf3ba..02e674e 100644 --- a/chrome/browser/autocomplete/extension_app_provider_unittest.cc +++ b/chrome/browser/autocomplete/extension_app_provider_unittest.cc @@ -33,7 +33,7 @@ class ExtensionAppProviderTest : public testing::Test { int num_cases); protected: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_refptr<ExtensionAppProvider> app_provider_; scoped_ptr<TestingProfile> profile_; diff --git a/chrome/browser/autocomplete/history_contents_provider_unittest.cc b/chrome/browser/autocomplete/history_contents_provider_unittest.cc index da15d1c..0701a14 100644 --- a/chrome/browser/autocomplete/history_contents_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_contents_provider_unittest.cc @@ -56,7 +56,7 @@ class HistoryContentsProviderTest : public testing::Test, // When we're waiting for asynchronous messages, we have to spin the message // loop. This will be exited in the OnProviderUpdate function when complete. if (input.matches_requested() == AutocompleteInput::ALL_MATCHES) - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } const ACMatches& matches() const { return provider_->matches(); } @@ -116,10 +116,11 @@ class HistoryContentsProviderTest : public testing::Test, // We must quit the message loop (if running) to return control to the test. // Note, calling Quit() directly will checkfail if the loop isn't running, // so we post a task, which is safe for either case. - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/autocomplete/history_quick_provider_unittest.cc b/chrome/browser/autocomplete/history_quick_provider_unittest.cc index 4ac113c..28c9821 100644 --- a/chrome/browser/autocomplete/history_quick_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_quick_provider_unittest.cc @@ -135,7 +135,7 @@ class HistoryQuickProviderTest : public testing::Test, // Pass-through functions to simplify our friendship with URLIndexPrivateData. bool UpdateURL(const history::URLRow& row); - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; @@ -228,7 +228,7 @@ void HistoryQuickProviderTest::RunTest(const string16 text, bool can_inline_top_result, string16 expected_fill_into_edit) { SCOPED_TRACE(text); // Minimal hint to query being run. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); AutocompleteInput input(text, string16::npos, string16(), GURL(),false, false, true, AutocompleteInput::ALL_MATCHES); provider_->Start(input, false); diff --git a/chrome/browser/autocomplete/history_url_provider.cc b/chrome/browser/autocomplete/history_url_provider.cc index 1bc460f..416d3d1 100644 --- a/chrome/browser/autocomplete/history_url_provider.cc +++ b/chrome/browser/autocomplete/history_url_provider.cc @@ -295,7 +295,7 @@ HistoryURLProviderParams::HistoryURLProviderParams( const std::string& languages, TemplateURL* default_search_provider, const SearchTermsData& search_terms_data) - : message_loop(MessageLoop::current()), + : message_loop(base::MessageLoop::current()), input(input), prevent_inline_autocomplete(input.prevent_inline_autocomplete()), trim_http(trim_http), diff --git a/chrome/browser/autocomplete/history_url_provider_unittest.cc b/chrome/browser/autocomplete/history_url_provider_unittest.cc index a4e49f40..a7feb11 100644 --- a/chrome/browser/autocomplete/history_url_provider_unittest.cc +++ b/chrome/browser/autocomplete/history_url_provider_unittest.cc @@ -187,7 +187,7 @@ class HistoryURLProviderTest : public testing::Test, void RunAdjustOffsetTest(const string16 text, size_t expected_offset); - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; ACMatches matches_; @@ -207,7 +207,7 @@ class HistoryURLProviderTestNoDB : public HistoryURLProviderTest { void HistoryURLProviderTest::OnProviderUpdate(bool updated_matches) { if (autocomplete_->done()) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void HistoryURLProviderTest::SetUpImpl(bool no_db) { @@ -266,7 +266,7 @@ void HistoryURLProviderTest::RunTest( *identified_input_type = input.type(); autocomplete_->Start(input, false); if (!autocomplete_->done()) - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); matches_ = autocomplete_->matches(); if (sort_matches_) { @@ -292,7 +292,7 @@ void HistoryURLProviderTest::RunAdjustOffsetTest(const string16 text, false, true, AutocompleteInput::ALL_MATCHES); autocomplete_->Start(input, false); if (!autocomplete_->done()) - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); matches_ = autocomplete_->matches(); ASSERT_GE(matches_.size(), 1U) << "Input text: " << text; @@ -547,7 +547,7 @@ TEST_F(HistoryURLProviderTest, EmptyVisits) { int pandora_relevance = matches_[0].relevance; // Run the message loop. When |autocomplete_| finishes the loop is quit. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(autocomplete_->done()); matches_ = autocomplete_->matches(); ASSERT_GT(matches_.size(), 0u); @@ -575,7 +575,7 @@ TEST_F(HistoryURLProviderTest, DontAutocompleteOnTrailingWhitespace) { AutocompleteInput::ALL_MATCHES); autocomplete_->Start(input, false); if (!autocomplete_->done()) - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // None of the matches should attempt to autocomplete. matches_ = autocomplete_->matches(); @@ -743,7 +743,7 @@ TEST_F(HistoryURLProviderTest, CrashDueToFixup) { AutocompleteInput::ALL_MATCHES); autocomplete_->Start(input, false); if (!autocomplete_->done()) - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } } diff --git a/chrome/browser/autocomplete/search_provider_unittest.cc b/chrome/browser/autocomplete/search_provider_unittest.cc index 188ce0a..b1db4b1 100644 --- a/chrome/browser/autocomplete/search_provider_unittest.cc +++ b/chrome/browser/autocomplete/search_provider_unittest.cc @@ -145,7 +145,7 @@ class SearchProviderTest : public testing::Test, const string16 keyword_term_; GURL keyword_url_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/autocomplete/shortcuts_provider_unittest.cc b/chrome/browser/autocomplete/shortcuts_provider_unittest.cc index bc7d6f3..0685fd3 100644 --- a/chrome/browser/autocomplete/shortcuts_provider_unittest.cc +++ b/chrome/browser/autocomplete/shortcuts_provider_unittest.cc @@ -155,7 +155,7 @@ class ShortcutsProviderTest : public testing::Test, std::vector<std::string> expected_urls, std::string expected_top_result); - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; @@ -225,7 +225,7 @@ void ShortcutsProviderTest::RunTest(const string16 text, std::string expected_top_result) { std::sort(expected_urls.begin(), expected_urls.end()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); AutocompleteInput input(text, string16::npos, string16(), GURL(), false, false, true, AutocompleteInput::ALL_MATCHES); provider_->Start(input, false); diff --git a/chrome/browser/autofill/autofill_browsertest.cc b/chrome/browser/autofill/autofill_browsertest.cc index 9a45a70..aee4806 100644 --- a/chrome/browser/autofill/autofill_browsertest.cc +++ b/chrome/browser/autofill/autofill_browsertest.cc @@ -153,7 +153,7 @@ class WindowedPersonalDataManagerObserver // PersonalDataManagerObserver: virtual void OnPersonalDataChanged() OVERRIDE { if (has_run_message_loop_) { - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); has_run_message_loop_ = false; } alerted_ = true; diff --git a/chrome/browser/autofill/autofill_interactive_uitest.cc b/chrome/browser/autofill/autofill_interactive_uitest.cc index b4f8208..96ffae1 100644 --- a/chrome/browser/autofill/autofill_interactive_uitest.cc +++ b/chrome/browser/autofill/autofill_interactive_uitest.cc @@ -130,7 +130,7 @@ class WindowedPersonalDataManagerObserver // PersonalDataManagerObserver: virtual void OnPersonalDataChanged() OVERRIDE { if (has_run_message_loop_) { - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); has_run_message_loop_ = false; } alerted_ = true; diff --git a/chrome/browser/autofill/risk/fingerprint_browsertest.cc b/chrome/browser/autofill/risk/fingerprint_browsertest.cc index f74bced..6d7b4e4 100644 --- a/chrome/browser/autofill/risk/fingerprint_browsertest.cc +++ b/chrome/browser/autofill/risk/fingerprint_browsertest.cc @@ -40,7 +40,7 @@ class AutofillRiskFingerprintTest : public InProcessBrowserTest { kScreenBounds(0, 0, 101, 71), kAvailableScreenBounds(0, 11, 101, 60), kUnavailableScreenBounds(0, 0, 101, 11), - message_loop_(MessageLoop::TYPE_UI) {} + message_loop_(base::MessageLoop::TYPE_UI) {} void GetFingerprintTestCallback(scoped_ptr<Fingerprint> fingerprint) { // Verify that all fields Chrome can fill have been filled. @@ -138,7 +138,7 @@ class AutofillRiskFingerprintTest : public InProcessBrowserTest { const gfx::Rect kScreenBounds; const gfx::Rect kAvailableScreenBounds; const gfx::Rect kUnavailableScreenBounds; - MessageLoop message_loop_; + base::MessageLoop message_loop_; }; // This test is flaky on Windows. See http://crbug.com/178356. diff --git a/chrome/browser/automation/chrome_frame_automation_provider_win_unittest.cc b/chrome/browser/automation/chrome_frame_automation_provider_win_unittest.cc index 1b9b9f0..3f9e9e4 100644 --- a/chrome/browser/automation/chrome_frame_automation_provider_win_unittest.cc +++ b/chrome/browser/automation/chrome_frame_automation_provider_win_unittest.cc @@ -25,7 +25,7 @@ class MockChromeFrameAutomationProvider typedef testing::Test AutomationProviderTest; TEST_F(AutomationProviderTest, TestInvalidChromeFrameMessage) { - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); IPC::Message bad_msg(1, -1, IPC::Message::PRIORITY_NORMAL); diff --git a/chrome/browser/automation/testing_automation_provider.cc b/chrome/browser/automation/testing_automation_provider.cc index 9ae23bd..6f71e26 100644 --- a/chrome/browser/automation/testing_automation_provider.cc +++ b/chrome/browser/automation/testing_automation_provider.cc @@ -295,7 +295,7 @@ void TestingAutomationProvider::OnBrowserRemoved(Browser* browser) { switches::kKeepAliveForTest)) { // If you change this, update Observer for chrome::SESSION_END // below. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&TestingAutomationProvider::OnRemoveProvider, this)); } diff --git a/chrome/browser/automation/url_request_automation_job.cc b/chrome/browser/automation/url_request_automation_job.cc index 8ccd5f0..8591261d 100644 --- a/chrome/browser/automation/url_request_automation_job.cc +++ b/chrome/browser/automation/url_request_automation_job.cc @@ -173,7 +173,7 @@ void URLRequestAutomationJob::Start() { if (!is_pending()) { // 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(&URLRequestAutomationJob::StartAsync, weak_factory_.GetWeakPtr())); @@ -212,7 +212,7 @@ bool URLRequestAutomationJob::ReadRawData( message_filter_->Send(new AutomationMsg_RequestRead(tab_, id_, buf_size)); SetStatus(net::URLRequestStatus(net::URLRequestStatus::IO_PENDING, 0)); } else { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&URLRequestAutomationJob::NotifyJobCompletionTask, weak_factory_.GetWeakPtr())); diff --git a/chrome/browser/background/background_contents_service.cc b/chrome/browser/background/background_contents_service.cc index 9b693d4..8bf6bca 100644 --- a/chrome/browser/background/background_contents_service.cc +++ b/chrome/browser/background/background_contents_service.cc @@ -60,9 +60,9 @@ void CloseBalloon(const std::string id) { } void ScheduleCloseBalloon(const std::string& extension_id) { - if (!MessageLoop::current()) // For unit_tests + if (!base::MessageLoop::current()) // For unit_tests return; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&CloseBalloon, kNotificationPrefix + extension_id)); } @@ -374,7 +374,7 @@ void BackgroundContentsService::Observe( // notifications for this extension to be cancelled by // DesktopNotificationService. For this reason, instead of showing the // balloon right now, we schedule it to show a little later. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ShowBalloon, extension, profile)); break; } diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc index 52298ad..881b775 100644 --- a/chrome/browser/background/background_mode_manager.cc +++ b/chrome/browser/background/background_mode_manager.cc @@ -530,8 +530,8 @@ void BackgroundModeManager::EndKeepAliveForStartup() { // We call this via the message queue to make sure we don't try to end // keep-alive (which can shutdown Chrome) before the message loop has // started. - MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&chrome::EndKeepAlive)); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::Bind(&chrome::EndKeepAlive)); } } diff --git a/chrome/browser/bookmarks/bookmark_expanded_state_tracker_unittest.cc b/chrome/browser/bookmarks/bookmark_expanded_state_tracker_unittest.cc index 17e85d5..ba54755 100644 --- a/chrome/browser/bookmarks/bookmark_expanded_state_tracker_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_expanded_state_tracker_unittest.cc @@ -26,7 +26,7 @@ class BookmarkExpandedStateTrackerTest : public testing::Test { private: scoped_ptr<TestingProfile> profile_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/bookmarks/bookmark_html_writer.cc b/chrome/browser/bookmarks/bookmark_html_writer.cc index 6ddd35b..620628a 100644 --- a/chrome/browser/bookmarks/bookmark_html_writer.cc +++ b/chrome/browser/bookmarks/bookmark_html_writer.cc @@ -417,7 +417,7 @@ void BookmarkFaviconFetcher::Observe( const content::NotificationSource& source, const content::NotificationDetails& details) { if (chrome::NOTIFICATION_PROFILE_DESTROYED == type && fetcher != NULL) { - MessageLoop::current()->DeleteSoon(FROM_HERE, fetcher); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, fetcher); fetcher = NULL; } } @@ -445,7 +445,7 @@ void BookmarkFaviconFetcher::ExecuteWriter() { profile_)), path_, favicons_map_.release(), observer_))); if (fetcher != NULL) { - MessageLoop::current()->DeleteSoon(FROM_HERE, fetcher); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, fetcher); fetcher = NULL; } } diff --git a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc index 66cfc3d..6ee04ee 100644 --- a/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_html_writer_unittest.cc @@ -128,7 +128,7 @@ class BookmarkHTMLWriterTest : public testing::Test { // Class that will notify message loop when file is written. class BookmarksObserver : public BookmarksExportObserver { public: - explicit BookmarksObserver(MessageLoop* loop) : loop_(loop) { + explicit BookmarksObserver(base::MessageLoop* loop) : loop_(loop) { DCHECK(loop); } @@ -137,14 +137,14 @@ class BookmarksObserver : public BookmarksExportObserver { } private: - MessageLoop* loop_; + base::MessageLoop* loop_; DISALLOW_COPY_AND_ASSIGN(BookmarksObserver); }; // Tests bookmark_html_writer by populating a BookmarkModel, writing it out by // way of bookmark_html_writer, then using the importer to read it back in. TEST_F(BookmarkHTMLWriterTest, Test) { - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread fake_ui_thread(BrowserThread::UI, &message_loop); content::TestBrowserThread fake_file_thread(BrowserThread::FILE, &message_loop); diff --git a/chrome/browser/bookmarks/bookmark_index_unittest.cc b/chrome/browser/bookmarks/bookmark_index_unittest.cc index f970aa9..d6eb132 100644 --- a/chrome/browser/bookmarks/bookmark_index_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_index_unittest.cc @@ -234,7 +234,7 @@ TEST_F(BookmarkIndexTest, EmptyMatchOnMultiwideLowercaseString) { TEST_F(BookmarkIndexTest, GetResultsSortedByTypedCount) { // This ensures MessageLoop::current() will exist, which is needed by // TestingProfile::BlockUntilHistoryProcessesPendingRequests(). - MessageLoop loop(MessageLoop::TYPE_DEFAULT); + base::MessageLoop loop(base::MessageLoop::TYPE_DEFAULT); content::TestBrowserThread ui_thread(BrowserThread::UI, &loop); content::TestBrowserThread file_thread(BrowserThread::FILE, &loop); diff --git a/chrome/browser/bookmarks/bookmark_model_unittest.cc b/chrome/browser/bookmarks/bookmark_model_unittest.cc index 5789977..ab57d44 100644 --- a/chrome/browser/bookmarks/bookmark_model_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_model_unittest.cc @@ -890,7 +890,7 @@ class BookmarkModelTestWithProfile : public testing::Test { BookmarkModel* bb_model_; private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; }; diff --git a/chrome/browser/bookmarks/bookmark_node_data_unittest.cc b/chrome/browser/bookmarks/bookmark_node_data_unittest.cc index 0750497..8ee4cd8 100644 --- a/chrome/browser/bookmarks/bookmark_node_data_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_node_data_unittest.cc @@ -27,7 +27,7 @@ class BookmarkNodeDataTest : public testing::Test { } private: - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; }; diff --git a/chrome/browser/bookmarks/bookmark_utils_unittest.cc b/chrome/browser/bookmarks/bookmark_utils_unittest.cc index a5f253d..45bdc58 100644 --- a/chrome/browser/bookmarks/bookmark_utils_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_utils_unittest.cc @@ -25,7 +25,7 @@ class BookmarkUtilsTest : public ::testing::Test { private: // Clipboard requires a message loop. - MessageLoopForUI loop; + base::MessageLoopForUI loop; }; TEST_F(BookmarkUtilsTest, GetBookmarksContainingText) { diff --git a/chrome/browser/browser_about_handler_unittest.cc b/chrome/browser/browser_about_handler_unittest.cc index de105be..c21f2e4 100644 --- a/chrome/browser/browser_about_handler_unittest.cc +++ b/chrome/browser/browser_about_handler_unittest.cc @@ -60,7 +60,7 @@ TEST_F(BrowserAboutHandlerTest, WillHandleBrowserAboutURL) { GURL(chrome_prefix + "host/path?query#ref"), } }; - MessageLoopForUI message_loop; + base::MessageLoopForUI message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); TestingProfile profile; diff --git a/chrome/browser/browser_keyevents_browsertest.cc b/chrome/browser/browser_keyevents_browsertest.cc index d765b55..a50d3fd 100644 --- a/chrome/browser/browser_keyevents_browsertest.cc +++ b/chrome/browser/browser_keyevents_browsertest.cc @@ -122,7 +122,7 @@ class TestFinishObserver : public content::NotificationObserver { if (dom_op_details->json == "\"FINISHED\"") { finished_ = true; if (waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index f63c5a0..0d1214d 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -292,9 +292,9 @@ void BrowserProcessImpl::PostDestroyThreads() { // our (other) recent requests (to save preferences). // Change the boolean so that the receiving thread will know that we did indeed // send the QuitTask that terminated the message loop. -static void PostQuit(MessageLoop* message_loop) { +static void PostQuit(base::MessageLoop* message_loop) { g_end_session_file_thread_has_completed = true; - message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } #elif defined(USE_X11) static void Signal(base::WaitableEvent* event) { @@ -334,14 +334,14 @@ unsigned int BrowserProcessImpl::ReleaseModule() { print_job_manager_.reset(); #endif - CHECK(MessageLoop::current()->is_running()); + CHECK(base::MessageLoop::current()->is_running()); #if defined(OS_MACOSX) - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(ChromeBrowserMainPartsMac::DidEndMainMessageLoop)); #endif - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } return module_ref_count_; } @@ -383,15 +383,17 @@ void BrowserProcessImpl::EndSession() { #elif defined(OS_WIN) BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, - base::Bind(PostQuit, MessageLoop::current())); + base::Bind(PostQuit, base::MessageLoop::current())); int quits_received = 0; do { - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ++quits_received; } while (!g_end_session_file_thread_has_completed); // If we did get extra quits, then we should re-post them to the message loop. - while (--quits_received > 0) - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + while (--quits_received > 0) { + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + } #else NOTIMPLEMENTED(); #endif diff --git a/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc index be0879b..a54b9bd 100644 --- a/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_cookie_helper_unittest.cc @@ -94,7 +94,7 @@ class BrowsingDataCookieHelperTest : public testing::Test { EXPECT_EQ("B", it->Name()); ASSERT_TRUE(++it == cookies.end()); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void DomainCookieCallback(const net::CookieList& cookies) { @@ -114,7 +114,7 @@ class BrowsingDataCookieHelperTest : public testing::Test { EXPECT_EQ("2", it->Value()); ASSERT_TRUE(++it == cookies.end()); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void DeleteCallback(const net::CookieList& cookies) { @@ -126,7 +126,7 @@ class BrowsingDataCookieHelperTest : public testing::Test { EXPECT_EQ("B", it->Name()); ASSERT_TRUE(++it == cookies.end()); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void CannedUniqueCallback(const net::CookieList& cookies) { @@ -209,7 +209,7 @@ class BrowsingDataCookieHelperTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; scoped_ptr<content::TestBrowserThread> ui_thread_; scoped_ptr<content::TestBrowserThread> io_thread_; scoped_ptr<TestingProfile> testing_profile_; @@ -227,7 +227,7 @@ TEST_F(BrowsingDataCookieHelperTest, FetchData) { base::Unretained(this))); // Blocks until BrowsingDataCookieHelperTest::FetchCallback is notified. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } TEST_F(BrowsingDataCookieHelperTest, DomainCookie) { @@ -240,7 +240,7 @@ TEST_F(BrowsingDataCookieHelperTest, DomainCookie) { base::Unretained(this))); // Blocks until BrowsingDataCookieHelperTest::FetchCallback is notified. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } TEST_F(BrowsingDataCookieHelperTest, DeleteCookie) { @@ -253,7 +253,7 @@ TEST_F(BrowsingDataCookieHelperTest, DeleteCookie) { base::Unretained(this))); // Blocks until BrowsingDataCookieHelperTest::FetchCallback is notified. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); net::CanonicalCookie cookie = cookie_list_[0]; cookie_helper->DeleteCookie(cookie); @@ -261,7 +261,7 @@ TEST_F(BrowsingDataCookieHelperTest, DeleteCookie) { cookie_helper->StartFetching( base::Bind(&BrowsingDataCookieHelperTest::DeleteCallback, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } TEST_F(BrowsingDataCookieHelperTest, CannedDomainCookie) { diff --git a/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc b/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc index 019a45b..ab1d7c3 100644 --- a/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_database_helper_browsertest.cc @@ -73,7 +73,7 @@ class StopTestOnCallback { ASSERT_EQ(1UL, database_info_list.size()); EXPECT_EQ(std::string(kTestIdentifier1), database_info_list.begin()->origin_identifier); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } private: diff --git a/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc index 5d30ec0..2f96b36 100644 --- a/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_database_helper_unittest.cc @@ -20,7 +20,7 @@ class CannedBrowsingDataDatabaseHelperTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; }; diff --git a/chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc index 922a169..d2f2ef3 100644 --- a/chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_file_system_helper_unittest.cc @@ -90,13 +90,13 @@ class BrowsingDataFileSystemHelperTest : public testing::Test { // Blocks on the current MessageLoop until Notify() is called. void BlockUntilNotified() { - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } // Unblocks the current MessageLoop. Should be called in response to some sort // of async activity in a callback method. void Notify() { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // Callback that should be executed in response to @@ -197,7 +197,7 @@ class BrowsingDataFileSystemHelperTest : public testing::Test { // message_loop_, as well as all the threads associated with it must be // defined before profile_ to prevent explosions. The threads also must be // defined in the order they're listed here. Oh how I love C++. - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; content::TestBrowserThread webkit_thread_; diff --git a/chrome/browser/browsing_data/browsing_data_helper_browsertest.h b/chrome/browser/browsing_data/browsing_data_helper_browsertest.h index 1f953e3..f60e36a 100644 --- a/chrome/browser/browsing_data/browsing_data_helper_browsertest.h +++ b/chrome/browser/browsing_data/browsing_data_helper_browsertest.h @@ -24,7 +24,7 @@ class BrowsingDataHelperCallback { } const std::list<T>& result() { - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); DCHECK(has_result_); return result_; } @@ -32,7 +32,7 @@ class BrowsingDataHelperCallback { void callback(const std::list<T>& info) { result_ = info; has_result_ = true; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } private: diff --git a/chrome/browser/browsing_data/browsing_data_local_storage_helper.cc b/chrome/browser/browsing_data/browsing_data_local_storage_helper.cc index 40e2036..906ba0a 100644 --- a/chrome/browser/browsing_data/browsing_data_local_storage_helper.cc +++ b/chrome/browser/browsing_data/browsing_data_local_storage_helper.cc @@ -128,10 +128,10 @@ void CannedBrowsingDataLocalStorageHelper::StartFetching( completion_callback_ = callback; // We post a task to emulate async fetching behavior. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&CannedBrowsingDataLocalStorageHelper:: - ConvertPendingInfo, this)); + base::Bind(&CannedBrowsingDataLocalStorageHelper::ConvertPendingInfo, + this)); } CannedBrowsingDataLocalStorageHelper::~CannedBrowsingDataLocalStorageHelper() {} @@ -144,7 +144,7 @@ void CannedBrowsingDataLocalStorageHelper::ConvertPendingInfo() { local_storage_info_.push_back( LocalStorageInfo(*iter, 0, base::Time())); } - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&CannedBrowsingDataLocalStorageHelper::CallCompletionCallback, this)); diff --git a/chrome/browser/browsing_data/browsing_data_local_storage_helper_browsertest.cc b/chrome/browser/browsing_data/browsing_data_local_storage_helper_browsertest.cc index b123b89..269c647 100644 --- a/chrome/browser/browsing_data/browsing_data_local_storage_helper_browsertest.cc +++ b/chrome/browser/browsing_data/browsing_data_local_storage_helper_browsertest.cc @@ -102,7 +102,7 @@ class StopTestOnCallback { for (size_t i = 0; i < arraysize(kTestHosts); ++i) { ASSERT_TRUE(test_hosts_found[i]) << kTestHosts[i]; } - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } private: diff --git a/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc index cafd2b6..017570c 100644 --- a/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_quota_helper_unittest.cc @@ -49,7 +49,7 @@ class BrowsingDataQuotaHelperTest : public testing::Test { helper_ = NULL; quota_manager_ = NULL; quota_info_.clear(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } protected: @@ -113,7 +113,7 @@ class BrowsingDataQuotaHelperTest : public testing::Test { fetching_completed_ = true; } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; content::TestBrowserThread io_thread_; @@ -132,7 +132,7 @@ class BrowsingDataQuotaHelperTest : public testing::Test { TEST_F(BrowsingDataQuotaHelperTest, Empty) { StartFetching(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(fetching_completed()); EXPECT_TRUE(quota_info().empty()); } @@ -148,7 +148,7 @@ TEST_F(BrowsingDataQuotaHelperTest, FetchData) { RegisterClient(kOrigins, arraysize(kOrigins)); StartFetching(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(fetching_completed()); std::set<QuotaInfo> expected, actual; @@ -177,7 +177,7 @@ TEST_F(BrowsingDataQuotaHelperTest, IgnoreExtensionsAndDevTools) { RegisterClient(kOrigins, arraysize(kOrigins)); StartFetching(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(fetching_completed()); std::set<QuotaInfo> expected, actual; @@ -193,16 +193,16 @@ TEST_F(BrowsingDataQuotaHelperTest, RevokeHostQuota) { SetPersistentHostQuota(kHost1, 1); SetPersistentHostQuota(kHost2, 10); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); RevokeHostQuota(kHost1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); GetPersistentHostQuota(kHost1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(0, quota()); GetPersistentHostQuota(kHost2); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(10, quota()); } diff --git a/chrome/browser/browsing_data/browsing_data_remover.cc b/chrome/browser/browsing_data/browsing_data_remover.cc index fd49924..1c5935b 100644 --- a/chrome/browser/browsing_data/browsing_data_remover.cc +++ b/chrome/browser/browsing_data/browsing_data_remover.cc @@ -653,7 +653,7 @@ void BrowsingDataRemover::NotifyAndDeleteIfDone() { // History requests aren't happy if you delete yourself from the callback. // As such, we do a delete later. - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } void BrowsingDataRemover::OnClearedHostnameResolutionCache() { diff --git a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc index 257e649..b976555 100644 --- a/chrome/browser/browsing_data/browsing_data_remover_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_remover_unittest.cc @@ -133,7 +133,7 @@ class AwaitCompletionHelper : public BrowsingDataRemover::Observer { if (!already_quit_) { DCHECK(!start_); start_ = true; - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } else { DCHECK(!start_); already_quit_ = false; @@ -143,7 +143,7 @@ class AwaitCompletionHelper : public BrowsingDataRemover::Observer { void Notify() { if (start_) { DCHECK(!already_quit_); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); start_ = false; } else { DCHECK(!already_quit_); @@ -240,7 +240,7 @@ class RemoveSafeBrowsingCookieTester : public RemoveCookieTester { SafeBrowsingService::CreateSafeBrowsingService(); browser_process_->SetSafeBrowsingService(sb_service); sb_service->Initialize(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Create a cookiemonster that does not have persistant storage, and replace // the SafeBrowsingService created one with it. @@ -252,7 +252,7 @@ class RemoveSafeBrowsingCookieTester : public RemoveCookieTester { virtual ~RemoveSafeBrowsingCookieTester() { browser_process_->safe_browsing_service()->ShutDown(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); browser_process_->SetSafeBrowsingService(NULL); } @@ -443,7 +443,7 @@ class RemoveAutofillTester : public autofill::PersonalDataManagerObserver { profiles.push_back(profile); personal_data_manager_->SetProfiles(&profiles); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); std::vector<autofill::CreditCard> cards; autofill::CreditCard card; @@ -458,12 +458,12 @@ class RemoveAutofillTester : public autofill::PersonalDataManagerObserver { cards.push_back(card); personal_data_manager_->SetCreditCards(&cards); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } private: virtual void OnPersonalDataChanged() OVERRIDE { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } autofill::PersonalDataManager* personal_data_manager_; @@ -655,7 +655,7 @@ class BrowsingDataRemoverTest : public testing::Test, // message_loop_, as well as all the threads associated with it must be // defined before profile_ to prevent explosions. Oh how I love C++. - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; content::TestBrowserThread webkit_thread_; diff --git a/chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.cc b/chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.cc index e18f5ec..77068b3 100644 --- a/chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.cc +++ b/chrome/browser/browsing_data/browsing_data_server_bound_cert_helper.cc @@ -198,7 +198,7 @@ void CannedBrowsingDataServerBoundCertHelper::StartFetching( return; // We post a task to emulate async fetching behavior. completion_callback_ = callback; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&CannedBrowsingDataServerBoundCertHelper::FinishFetching, this)); diff --git a/chrome/browser/browsing_data/browsing_data_server_bound_cert_helper_unittest.cc b/chrome/browser/browsing_data/browsing_data_server_bound_cert_helper_unittest.cc index 1443f54..58f397a 100644 --- a/chrome/browser/browsing_data/browsing_data_server_bound_cert_helper_unittest.cc +++ b/chrome/browser/browsing_data/browsing_data_server_bound_cert_helper_unittest.cc @@ -57,7 +57,7 @@ class BrowsingDataServerBoundCertHelperTest const net::ServerBoundCertStore::ServerBoundCertList& certs) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); server_bound_cert_list_ = certs; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // net::SSLConfigService::Observer implementation: @@ -66,7 +66,7 @@ class BrowsingDataServerBoundCertHelperTest } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; scoped_ptr<content::TestBrowserThread> ui_thread_; scoped_ptr<content::TestBrowserThread> io_thread_; scoped_ptr<TestingProfile> testing_profile_; @@ -87,7 +87,7 @@ TEST_F(BrowsingDataServerBoundCertHelperTest, FetchData) { // Blocks until BrowsingDataServerBoundCertHelperTest::FetchCallback is // notified. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ASSERT_EQ(2UL, server_bound_cert_list_.size()); net::ServerBoundCertStore::ServerBoundCertList::const_iterator it = @@ -116,7 +116,7 @@ TEST_F(BrowsingDataServerBoundCertHelperTest, DeleteCert) { helper->StartFetching( base::Bind(&BrowsingDataServerBoundCertHelperTest::FetchCallback, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(1, ssl_config_changed_count_); ASSERT_EQ(1UL, server_bound_cert_list_.size()); @@ -133,7 +133,7 @@ TEST_F(BrowsingDataServerBoundCertHelperTest, DeleteCert) { helper->StartFetching( base::Bind(&BrowsingDataServerBoundCertHelperTest::FetchCallback, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(2, ssl_config_changed_count_); ASSERT_EQ(0UL, server_bound_cert_list_.size()); } @@ -155,7 +155,7 @@ TEST_F(BrowsingDataServerBoundCertHelperTest, CannedUnique) { helper->StartFetching( base::Bind(&BrowsingDataServerBoundCertHelperTest::FetchCallback, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ASSERT_EQ(1UL, server_bound_cert_list_.size()); net::ServerBoundCertStore::ServerBoundCert& cert = diff --git a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc index 936856f..5452af6 100644 --- a/chrome/browser/browsing_data/cookies_tree_model_unittest.cc +++ b/chrome/browser/browsing_data/cookies_tree_model_unittest.cc @@ -341,7 +341,7 @@ class CookiesTreeModelTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_user_blocking_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/captive_portal/captive_portal_browsertest.cc b/chrome/browser/captive_portal/captive_portal_browsertest.cc index df3c769..7f97e9b 100644 --- a/chrome/browser/captive_portal/captive_portal_browsertest.cc +++ b/chrome/browser/captive_portal/captive_portal_browsertest.cc @@ -290,7 +290,7 @@ void URLRequestTimeoutOnDemandJob::MaybeStopWaitingForJobsOnIOThread() { last_num_jobs_to_wait_for_ = num_jobs_to_wait_for_; num_jobs_to_wait_for_ = 0; BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); } } @@ -579,7 +579,7 @@ void MultiNavigationObserver::Observe( if (waiting_for_navigation_ && num_navigations_to_wait_for_ == num_navigations_) { waiting_for_navigation_ = false; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } @@ -668,7 +668,7 @@ void FailLoadsAfterLoginObserver::Observe( tabs_needing_navigation_.size() == tabs_navigated_to_final_destination_.size()) { waiting_for_navigation_ = false; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } @@ -762,7 +762,7 @@ void CaptivePortalObserver::Observe( if (waiting_for_result_ && num_results_to_wait_for_ == num_results_received_) { waiting_for_result_ = false; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } diff --git a/chrome/browser/captive_portal/captive_portal_detector_unittest.cc b/chrome/browser/captive_portal/captive_portal_detector_unittest.cc index 568af8b..c0c1806 100644 --- a/chrome/browser/captive_portal/captive_portal_detector_unittest.cc +++ b/chrome/browser/captive_portal/captive_portal_detector_unittest.cc @@ -72,7 +72,7 @@ class CaptivePortalDetectorTest : public testing::Test, base::Unretained(&client))); ASSERT_TRUE(FetchingURL()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CompleteURLFetch(net_error, status_code, response_headers); @@ -96,7 +96,7 @@ class CaptivePortalDetectorTest : public testing::Test, base::Unretained(&client))); ASSERT_TRUE(FetchingURL()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); detector()->Cancel(); @@ -105,7 +105,7 @@ class CaptivePortalDetectorTest : public testing::Test, } private: - MessageLoop message_loop_; + base::MessageLoop message_loop_; // Definition order does matter. TestingProfile profile_; diff --git a/chrome/browser/captive_portal/captive_portal_service_unittest.cc b/chrome/browser/captive_portal/captive_portal_service_unittest.cc index cc0a4ff..3055703 100644 --- a/chrome/browser/captive_portal/captive_portal_service_unittest.cc +++ b/chrome/browser/captive_portal/captive_portal_service_unittest.cc @@ -167,7 +167,7 @@ class CaptivePortalServiceTest : public testing::Test, EXPECT_FALSE(FetchingURL()); ASSERT_TRUE(TimerRunning()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(CaptivePortalService::STATE_CHECKING_FOR_PORTAL, service()->state()); ASSERT_TRUE(FetchingURL()); @@ -199,7 +199,7 @@ class CaptivePortalServiceTest : public testing::Test, EXPECT_FALSE(FetchingURL()); ASSERT_TRUE(TimerRunning()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(FetchingURL()); EXPECT_FALSE(TimerRunning()); EXPECT_EQ(1, observer.num_results_received()); @@ -274,7 +274,7 @@ class CaptivePortalServiceTest : public testing::Test, // after the test. const CaptivePortalService::TestingState old_captive_portal_testing_state_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; // Note that the construction order of these matters. scoped_ptr<TestingProfile> profile_; @@ -372,7 +372,7 @@ TEST_F(CaptivePortalServiceTest, CaptivePortalPrefDisabledWhileRunning) { // Needed to create the URLFetcher, even if it never returns any results. service()->DetectCaptivePortal(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(FetchingURL()); EXPECT_FALSE(TimerRunning()); @@ -381,7 +381,7 @@ TEST_F(CaptivePortalServiceTest, CaptivePortalPrefDisabledWhileRunning) { EXPECT_TRUE(TimerRunning()); EXPECT_EQ(0, observer.num_results_received()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(FetchingURL()); EXPECT_FALSE(TimerRunning()); @@ -406,7 +406,7 @@ TEST_F(CaptivePortalServiceTest, CaptivePortalPrefDisabledWhilePending) { EXPECT_TRUE(TimerRunning()); EXPECT_EQ(0, observer.num_results_received()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(FetchingURL()); EXPECT_FALSE(TimerRunning()); @@ -432,7 +432,7 @@ TEST_F(CaptivePortalServiceTest, CaptivePortalPrefEnabledWhilePending) { EXPECT_FALSE(FetchingURL()); EXPECT_TRUE(TimerRunning()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_TRUE(FetchingURL()); EXPECT_FALSE(TimerRunning()); diff --git a/chrome/browser/captive_portal/captive_portal_tab_reloader.cc b/chrome/browser/captive_portal/captive_portal_tab_reloader.cc index dbf1a53..eb5c3ad 100644 --- a/chrome/browser/captive_portal/captive_portal_tab_reloader.cc +++ b/chrome/browser/captive_portal/captive_portal_tab_reloader.cc @@ -100,7 +100,7 @@ void CaptivePortalTabReloader::OnLoadCommitted(int net_error) { // If the tab needs to reload, do so asynchronously, to avoid reentrancy // issues. if (state_ == STATE_NEEDS_RELOAD) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&CaptivePortalTabReloader::ReloadTabIfNeeded, weak_factory_.GetWeakPtr())); diff --git a/chrome/browser/captive_portal/captive_portal_tab_reloader_unittest.cc b/chrome/browser/captive_portal/captive_portal_tab_reloader_unittest.cc index 2856826..e09242d 100644 --- a/chrome/browser/captive_portal/captive_portal_tab_reloader_unittest.cc +++ b/chrome/browser/captive_portal/captive_portal_tab_reloader_unittest.cc @@ -135,7 +135,7 @@ TEST_F(CaptivePortalTabReloaderTest, InternetConnected) { EXPECT_TRUE(tab_reloader().TimerRunning()); EXPECT_CALL(tab_reloader(), CheckForCaptivePortal()).Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(tab_reloader().TimerRunning()); EXPECT_EQ(CaptivePortalTabReloader::STATE_MAYBE_BROKEN_BY_PORTAL, tab_reloader().state()); @@ -183,7 +183,7 @@ TEST_F(CaptivePortalTabReloaderTest, NoResponse) { EXPECT_TRUE(tab_reloader().TimerRunning()); EXPECT_CALL(tab_reloader(), CheckForCaptivePortal()).Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(tab_reloader().TimerRunning()); EXPECT_EQ(CaptivePortalTabReloader::STATE_MAYBE_BROKEN_BY_PORTAL, tab_reloader().state()); @@ -224,7 +224,7 @@ TEST_F(CaptivePortalTabReloaderTest, Login) { tab_reloader().OnLoadStart(true); EXPECT_CALL(tab_reloader(), CheckForCaptivePortal()).Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(tab_reloader().TimerRunning()); EXPECT_EQ(CaptivePortalTabReloader::STATE_MAYBE_BROKEN_BY_PORTAL, tab_reloader().state()); @@ -250,7 +250,7 @@ TEST_F(CaptivePortalTabReloaderTest, Login) { tab_reloader().state()); EXPECT_CALL(tab_reloader(), ReloadTab()).Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE, tab_reloader().state()); } @@ -260,7 +260,7 @@ TEST_F(CaptivePortalTabReloaderTest, LoginLate) { tab_reloader().OnLoadStart(true); EXPECT_CALL(tab_reloader(), CheckForCaptivePortal()).Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(tab_reloader().TimerRunning()); EXPECT_EQ(CaptivePortalTabReloader::STATE_MAYBE_BROKEN_BY_PORTAL, tab_reloader().state()); @@ -376,7 +376,7 @@ TEST_F(CaptivePortalTabReloaderTest, SSLProtocolErrorAlreadyLoggedIn) { // The error page commits, which should trigger a reload. EXPECT_CALL(tab_reloader(), ReloadTab()).Times(1); tab_reloader().OnLoadCommitted(net::ERR_SSL_PROTOCOL_ERROR); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE, tab_reloader().state()); } @@ -387,7 +387,7 @@ TEST_F(CaptivePortalTabReloaderTest, AlreadyLoggedIn) { tab_reloader().OnLoadStart(true); EXPECT_CALL(tab_reloader(), CheckForCaptivePortal()).Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(tab_reloader().TimerRunning()); EXPECT_EQ(CaptivePortalTabReloader::STATE_MAYBE_BROKEN_BY_PORTAL, tab_reloader().state()); @@ -405,7 +405,7 @@ TEST_F(CaptivePortalTabReloaderTest, AlreadyLoggedIn) { tab_reloader().state()); EXPECT_CALL(tab_reloader(), ReloadTab()).Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE, tab_reloader().state()); } @@ -429,7 +429,7 @@ TEST_F(CaptivePortalTabReloaderTest, AlreadyLoggedInBeforeTimerTriggers) { tab_reloader().state()); EXPECT_CALL(tab_reloader(), ReloadTab()).Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE, tab_reloader().state()); } @@ -453,7 +453,7 @@ TEST_F(CaptivePortalTabReloaderTest, LoginWhileTimerRunning) { tab_reloader().state()); EXPECT_CALL(tab_reloader(), ReloadTab()).Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE, tab_reloader().state()); } @@ -475,7 +475,7 @@ TEST_F(CaptivePortalTabReloaderTest, BehindPortalResultWhileTimerRunning) { // The rest proceeds as normal. EXPECT_CALL(tab_reloader(), CheckForCaptivePortal()).Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(CaptivePortalTabReloader::STATE_MAYBE_BROKEN_BY_PORTAL, tab_reloader().state()); @@ -500,7 +500,7 @@ TEST_F(CaptivePortalTabReloaderTest, BehindPortalResultWhileTimerRunning) { tab_reloader().state()); EXPECT_CALL(tab_reloader(), ReloadTab()).Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE, tab_reloader().state()); } @@ -559,7 +559,7 @@ TEST_F(CaptivePortalTabReloaderTest, SSLCertErrorLogin) { TEST_F(CaptivePortalTabReloaderTest, HttpToHttpsRedirectInternetConnected) { tab_reloader().OnLoadStart(false); // There should be no captive portal check pending. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // HTTP to HTTPS redirect. tab_reloader().OnRedirect(true); @@ -568,7 +568,7 @@ TEST_F(CaptivePortalTabReloaderTest, HttpToHttpsRedirectInternetConnected) { EXPECT_TRUE(tab_reloader().TimerRunning()); EXPECT_CALL(tab_reloader(), CheckForCaptivePortal()).Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(tab_reloader().TimerRunning()); EXPECT_EQ(CaptivePortalTabReloader::STATE_MAYBE_BROKEN_BY_PORTAL, tab_reloader().state()); @@ -588,7 +588,7 @@ TEST_F(CaptivePortalTabReloaderTest, HttpToHttpsRedirectInternetConnected) { TEST_F(CaptivePortalTabReloaderTest, HttpToHttpsRedirectLogin) { tab_reloader().OnLoadStart(false); // There should be no captive portal check pending. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // HTTP to HTTPS redirect. tab_reloader().OnRedirect(true); @@ -596,7 +596,7 @@ TEST_F(CaptivePortalTabReloaderTest, HttpToHttpsRedirectLogin) { tab_reloader().state()); EXPECT_CALL(tab_reloader(), CheckForCaptivePortal()).Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(tab_reloader().TimerRunning()); EXPECT_EQ(CaptivePortalTabReloader::STATE_MAYBE_BROKEN_BY_PORTAL, tab_reloader().state()); @@ -622,7 +622,7 @@ TEST_F(CaptivePortalTabReloaderTest, HttpToHttpsRedirectLogin) { tab_reloader().state()); EXPECT_CALL(tab_reloader(), ReloadTab()).Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(CaptivePortalTabReloader::STATE_NONE, tab_reloader().state()); } @@ -638,7 +638,7 @@ TEST_F(CaptivePortalTabReloaderTest, HttpsToHttpRedirect) { EXPECT_FALSE(tab_reloader().TimerRunning()); // There should be no captive portal check pending after the redirect. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Logging in shouldn't do anything. tab_reloader().OnCaptivePortalResults(RESULT_BEHIND_CAPTIVE_PORTAL, @@ -657,7 +657,7 @@ TEST_F(CaptivePortalTabReloaderTest, HttpsToHttpsRedirect) { tab_reloader().state()); EXPECT_FALSE(tab_reloader().TimerRunning()); // Nothing should happen. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } // Check that an HTTPS to HTTP to HTTPS redirect results in no timer running. @@ -675,7 +675,7 @@ TEST_F(CaptivePortalTabReloaderTest, HttpsToHttpToHttpsRedirect) { tab_reloader().state()); EXPECT_FALSE(tab_reloader().TimerRunning()); // Nothing should happen. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } // Check that an HTTP to HTTP redirect results in the timer not running. @@ -688,7 +688,7 @@ TEST_F(CaptivePortalTabReloaderTest, HttpToHttpRedirect) { EXPECT_FALSE(tab_reloader().TimerRunning()); // There should be no captive portal check pending after the redirect. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Logging in shouldn't do anything. tab_reloader().OnCaptivePortalResults(RESULT_BEHIND_CAPTIVE_PORTAL, diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc index e341805..cfb1378 100644 --- a/chrome/browser/chrome_browser_main.cc +++ b/chrome/browser/chrome_browser_main.cc @@ -1625,7 +1625,7 @@ bool ChromeBrowserMainParts::MainMessageLoopRun(int* result_code) { startup_timer_->SignalStartupComplete( performance_monitor::StartupTimer::STARTUP_NORMAL); - DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); + DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); #if !defined(USE_AURA) && defined(TOOLKIT_VIEWS) views::AcceleratorHandler accelerator_handler; base::RunLoop run_loop(&accelerator_handler); diff --git a/chrome/browser/chrome_browser_main_android.cc b/chrome/browser/chrome_browser_main_android.cc index ea68eb3..f08ce27 100644 --- a/chrome/browser/chrome_browser_main_android.cc +++ b/chrome/browser/chrome_browser_main_android.cc @@ -69,13 +69,13 @@ void ChromeBrowserMainPartsAndroid::PreEarlyInitialization() { { TRACE_EVENT0("startup", "ChromeBrowserMainPartsAndroid::PreEarlyInitialization:CreateUiMsgLoop"); - main_message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); + main_message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); } { TRACE_EVENT0("startup", "ChromeBrowserMainPartsAndroid::PreEarlyInitialization:StartUiMsgLoop"); - MessageLoopForUI::current()->Start(); + base::MessageLoopForUI::current()->Start(); } CommandLine::ForCurrentProcess()->AppendSwitch( diff --git a/chrome/browser/chrome_browser_main_android.h b/chrome/browser/chrome_browser_main_android.h index e07fbd8..1439ac2 100644 --- a/chrome/browser/chrome_browser_main_android.h +++ b/chrome/browser/chrome_browser_main_android.h @@ -24,7 +24,7 @@ class ChromeBrowserMainPartsAndroid : public ChromeBrowserMainParts { virtual void ShowMissingLocaleMessageBox() OVERRIDE; private: - scoped_ptr<MessageLoop> main_message_loop_; + scoped_ptr<base::MessageLoop> main_message_loop_; scoped_ptr<CrashDumpManager> crash_dump_manager_; DISALLOW_COPY_AND_ASSIGN(ChromeBrowserMainPartsAndroid); diff --git a/chrome/browser/chrome_browser_main_x11.cc b/chrome/browser/chrome_browser_main_x11.cc index fadf018..a8b833a 100644 --- a/chrome/browser/chrome_browser_main_x11.cc +++ b/chrome/browser/chrome_browser_main_x11.cc @@ -32,7 +32,7 @@ const int kWaitForUIThreadSeconds = 10; int BrowserX11ErrorHandler(Display* d, XErrorEvent* error) { if (!g_in_x11_io_error_handler) - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ui::LogErrorEventDescription, d, *error)); return 0; diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_launcher.cc b/chrome/browser/chromeos/app_mode/kiosk_app_launcher.cc index fce4145..f90c254 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_launcher.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_launcher.cc @@ -64,7 +64,7 @@ class KioskAppLauncher::CryptohomedChecker } const int retry_delay_in_milliseconds = 500 * (1 << retry_count_); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&CryptohomedChecker::StartCheck, AsWeakPtr()), base::TimeDelta::FromMilliseconds(retry_delay_in_milliseconds)); diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_manager_browsertest.cc b/chrome/browser/chromeos/app_mode/kiosk_app_manager_browsertest.cc index a61dba7..0b66a91 100644 --- a/chrome/browser/chromeos/app_mode/kiosk_app_manager_browsertest.cc +++ b/chrome/browser/chromeos/app_mode/kiosk_app_manager_browsertest.cc @@ -76,7 +76,7 @@ class AppDataLoadWaiter : public KioskAppManagerObserver { } void Wait() { - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } bool loaded() const { return loaded_; } @@ -85,11 +85,11 @@ class AppDataLoadWaiter : public KioskAppManagerObserver { // KioskAppManagerObserver overrides: virtual void OnKioskAppDataChanged(const std::string& app_id) OVERRIDE { loaded_ = true; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } virtual void OnKioskAppDataLoadFailure(const std::string& app_id) OVERRIDE { loaded_ = false; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } KioskAppManager* manager_; diff --git a/chrome/browser/chromeos/attestation/attestation_ca_client_unittest.cc b/chrome/browser/chromeos/attestation/attestation_ca_client_unittest.cc index d3f54e2..4891c97 100644 --- a/chrome/browser/chromeos/attestation/attestation_ca_client_unittest.cc +++ b/chrome/browser/chromeos/attestation/attestation_ca_client_unittest.cc @@ -49,7 +49,7 @@ class AttestationCAClientTest : public ::testing::Test { fetcher->delegate()->OnURLFetchComplete(fetcher); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread io_thread_; net::TestURLFetcherFactory url_fetcher_factory_; diff --git a/chrome/browser/chromeos/attestation/attestation_policy_observer_unittest.cc b/chrome/browser/chromeos/attestation/attestation_policy_observer_unittest.cc index 34d7317..19ef480 100644 --- a/chrome/browser/chromeos/attestation/attestation_policy_observer_unittest.cc +++ b/chrome/browser/chromeos/attestation/attestation_policy_observer_unittest.cc @@ -66,23 +66,23 @@ const uint8 kTestKeyData[] = { }; void DBusCallbackFalse(const BoolDBusMethodCallback& callback) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, false)); } void DBusCallbackTrue(const BoolDBusMethodCallback& callback) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, true)); } void CertCallbackSuccess(const AttestationFlow::CertificateCallback& callback) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, true, "fake_cert")); } void StatusCallbackSuccess( const policy::CloudPolicyClient::StatusCallback& callback) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, true)); } @@ -91,7 +91,7 @@ class FakeDBusData { explicit FakeDBusData(const std::string& data) : data_(data) {} void operator() (const CryptohomeClient::DataMethodCallback& callback) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, DBUS_METHOD_CALL_SUCCESS, true, data_)); } @@ -105,7 +105,7 @@ class FakeDBusData { class AttestationPolicyObserverTest : public ::testing::Test { public: AttestationPolicyObserverTest() - : message_loop_(MessageLoop::TYPE_UI), + : message_loop_(base::MessageLoop::TYPE_UI), ui_thread_(content::BrowserThread::UI, &message_loop_) { // Remove the real DeviceSettingsProvider and replace it with a stub. CrosSettings* cros_settings = CrosSettings::Get(); @@ -235,7 +235,7 @@ class AttestationPolicyObserverTest : public ::testing::Test { return result; } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; ScopedTestDeviceSettingsService test_device_settings_service_; ScopedTestCrosSettings test_cros_settings_; diff --git a/chrome/browser/chromeos/audio/audio_mixer_alsa.cc b/chrome/browser/chromeos/audio/audio_mixer_alsa.cc index 6720880..e83b0dc 100644 --- a/chrome/browser/chromeos/audio/audio_mixer_alsa.cc +++ b/chrome/browser/chromeos/audio/audio_mixer_alsa.cc @@ -87,7 +87,7 @@ AudioMixerAlsa::AudioMixerAlsa() AudioMixerAlsa::~AudioMixerAlsa() { if (!thread_.get()) return; - DCHECK(MessageLoop::current() != thread_->message_loop()); + DCHECK(base::MessageLoop::current() != thread_->message_loop()); thread_->message_loop()->PostTask( FROM_HERE, base::Bind(&AudioMixerAlsa::Disconnect, @@ -190,7 +190,7 @@ void AudioMixerAlsa::SetCaptureMuteLocked(bool locked) { } void AudioMixerAlsa::Connect() { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); DCHECK(!alsa_mixer_); if (disconnected_event_.IsSignaled()) @@ -208,7 +208,7 @@ void AudioMixerAlsa::Connect() { } bool AudioMixerAlsa::ConnectInternal() { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); num_connection_attempts_++; int err; snd_mixer_t* handle = NULL; @@ -329,7 +329,7 @@ bool AudioMixerAlsa::ConnectInternal() { } void AudioMixerAlsa::Disconnect() { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); if (alsa_mixer_) { snd_mixer_close(alsa_mixer_); alsa_mixer_ = NULL; @@ -338,7 +338,7 @@ void AudioMixerAlsa::Disconnect() { } void AudioMixerAlsa::ApplyState() { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); if (!alsa_mixer_) return; @@ -377,7 +377,7 @@ void AudioMixerAlsa::ApplyState() { snd_mixer_elem_t* AudioMixerAlsa::FindElementWithName( snd_mixer_t* handle, const string& element_name) const { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); snd_mixer_selem_id_t* sid = NULL; // Using id_malloc/id_free API instead of id_alloca since the latter gives the @@ -397,7 +397,7 @@ snd_mixer_elem_t* AudioMixerAlsa::FindElementWithName( bool AudioMixerAlsa::GetElementVolume(snd_mixer_elem_t* element, double* current_volume_db) { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); alsa_long_t long_volume = 0; int alsa_result = snd_mixer_selem_get_playback_dB( element, static_cast<snd_mixer_selem_channel_id_t>(0), &long_volume); @@ -413,7 +413,7 @@ bool AudioMixerAlsa::GetElementVolume(snd_mixer_elem_t* element, bool AudioMixerAlsa::SetElementVolume(snd_mixer_elem_t* element, double new_volume_db, double rounding_bias) { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); alsa_long_t volume_low = 0; alsa_long_t volume_high = 0; int alsa_result = snd_mixer_selem_get_playback_volume_range( @@ -463,7 +463,7 @@ bool AudioMixerAlsa::SetElementVolume(snd_mixer_elem_t* element, } void AudioMixerAlsa::SetElementMuted(snd_mixer_elem_t* element, bool mute) { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); int alsa_result = snd_mixer_selem_set_playback_switch_all(element, !mute); if (alsa_result != 0) { LOG(WARNING) << "snd_mixer_selem_set_playback_switch_all() failed: " diff --git a/chrome/browser/chromeos/audio/audio_mixer_cras.cc b/chrome/browser/chromeos/audio/audio_mixer_cras.cc index 89de431..5e49dd8 100644 --- a/chrome/browser/chromeos/audio/audio_mixer_cras.cc +++ b/chrome/browser/chromeos/audio/audio_mixer_cras.cc @@ -44,7 +44,7 @@ AudioMixerCras::AudioMixerCras() AudioMixerCras::~AudioMixerCras() { if (!thread_.get()) return; - DCHECK(MessageLoop::current() != thread_->message_loop()); + DCHECK(base::MessageLoop::current() != thread_->message_loop()); base::ThreadRestrictions::ScopedAllowIO allow_io_for_thread_join; thread_->Stop(); @@ -139,7 +139,7 @@ void AudioMixerCras::SetCaptureMuteLocked(bool locked) { } void AudioMixerCras::Connect() { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); // Create the client structure. if (client_ == NULL && cras_client_create(&client_) < 0) { @@ -159,7 +159,7 @@ void AudioMixerCras::Connect() { } void AudioMixerCras::ApplyState() { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); if (!client_connected_) return; diff --git a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc index cf3b0d3..eabdea2 100644 --- a/chrome/browser/chromeos/chrome_browser_main_chromeos.cc +++ b/chrome/browser/chromeos/chrome_browser_main_chromeos.cc @@ -131,7 +131,7 @@ void ChromeOSVersionCallback(const std::string& version) { #endif -class MessageLoopObserver : public MessageLoopForUI::Observer { +class MessageLoopObserver : public base::MessageLoopForUI::Observer { virtual base::EventStatus WillProcessEvent( const base::NativeEvent& event) OVERRIDE { return base::EVENT_CONTINUE; @@ -448,7 +448,7 @@ void ChromeBrowserMainPartsChromeos::PreMainMessageLoopStart() { } void ChromeBrowserMainPartsChromeos::PostMainMessageLoopStart() { - MessageLoopForUI* message_loop = MessageLoopForUI::current(); + base::MessageLoopForUI* message_loop = base::MessageLoopForUI::current(); message_loop->AddObserver(g_message_loop_observer.Pointer()); dbus_services_.reset(new internal::DBusServices(parameters())); diff --git a/chrome/browser/chromeos/contacts/contact_database_unittest.cc b/chrome/browser/chromeos/contacts/contact_database_unittest.cc index c32cad0..f45addd 100644 --- a/chrome/browser/chromeos/contacts/contact_database_unittest.cc +++ b/chrome/browser/chromeos/contacts/contact_database_unittest.cc @@ -129,7 +129,7 @@ class ContactDatabaseTest : public testing::Test { message_loop_.Quit(); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; // Temporary directory where the database is saved. diff --git a/chrome/browser/chromeos/contacts/contact_manager_unittest.cc b/chrome/browser/chromeos/contacts/contact_manager_unittest.cc index 82984d8..237ae7a 100644 --- a/chrome/browser/chromeos/contacts/contact_manager_unittest.cc +++ b/chrome/browser/chromeos/contacts/contact_manager_unittest.cc @@ -80,7 +80,7 @@ class ContactManagerTest : public testing::Test { contact_manager_->Init(); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_ptr<TestingProfileManager> profile_manager_; diff --git a/chrome/browser/chromeos/contacts/gdata_contacts_service_unittest.cc b/chrome/browser/chromeos/contacts/gdata_contacts_service_unittest.cc index fbf8809..1be34fd 100644 --- a/chrome/browser/chromeos/contacts/gdata_contacts_service_unittest.cc +++ b/chrome/browser/chromeos/contacts/gdata_contacts_service_unittest.cc @@ -150,7 +150,7 @@ class GDataContactsServiceTest : public testing::Test { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); download_was_successful_ = true; downloaded_contacts_.swap(contacts); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // Handles failure for Download(). @@ -158,7 +158,7 @@ class GDataContactsServiceTest : public testing::Test { CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); download_was_successful_ = false; downloaded_contacts_.reset(new ScopedVector<contacts::Contact>()); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // Handles a request for downloading a file. Reads a requested file and @@ -174,7 +174,7 @@ class GDataContactsServiceTest : public testing::Test { return result.PassAs<net::test_server::HttpResponse>(); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; scoped_ptr<TestingProfile> profile_; diff --git a/chrome/browser/chromeos/contacts/google_contact_store_unittest.cc b/chrome/browser/chromeos/contacts/google_contact_store_unittest.cc index 90f5e62..377ce35 100644 --- a/chrome/browser/chromeos/contacts/google_contact_store_unittest.cc +++ b/chrome/browser/chromeos/contacts/google_contact_store_unittest.cc @@ -76,7 +76,7 @@ class GoogleContactStoreTest : public testing::Test { test_api_->SetGDataService(gdata_service_); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; TestContactStoreObserver observer_; diff --git a/chrome/browser/chromeos/dbus/service_provider_test_helper.h b/chrome/browser/chromeos/dbus/service_provider_test_helper.h index 17f6f8a..656e489 100644 --- a/chrome/browser/chromeos/dbus/service_provider_test_helper.h +++ b/chrome/browser/chromeos/dbus/service_provider_test_helper.h @@ -88,7 +88,7 @@ class ServiceProviderTestHelper { scoped_refptr<dbus::MockObjectProxy> mock_object_proxy_; dbus::ExportedObject::MethodCallCallback method_callback_; dbus::ObjectProxy::SignalCallback on_signal_callback_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; bool response_received_; scoped_ptr<dbus::Response> response_; }; diff --git a/chrome/browser/chromeos/drive/download_handler_unittest.cc b/chrome/browser/chromeos/drive/download_handler_unittest.cc index 3a0db7f0..5cba3ec 100644 --- a/chrome/browser/chromeos/drive/download_handler_unittest.cc +++ b/chrome/browser/chromeos/drive/download_handler_unittest.cc @@ -68,7 +68,7 @@ class DownloadHandlerTest : public testing::Test { protected: base::ScopedTempDir temp_dir_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_refptr<content::MockDownloadManager> download_manager_; MockFileSystem file_system_; diff --git a/chrome/browser/chromeos/drive/drive_app_registry_unittest.cc b/chrome/browser/chromeos/drive/drive_app_registry_unittest.cc index 2d9dff7..5363193 100644 --- a/chrome/browser/chromeos/drive/drive_app_registry_unittest.cc +++ b/chrome/browser/chromeos/drive/drive_app_registry_unittest.cc @@ -86,7 +86,7 @@ class DriveAppRegistryTest : public testing::Test { is_primary); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_ptr<TestingProfile> profile_; diff --git a/chrome/browser/chromeos/drive/drive_file_stream_reader_unittest.cc b/chrome/browser/chromeos/drive/drive_file_stream_reader_unittest.cc index 303dd3e..f266d21 100644 --- a/chrome/browser/chromeos/drive/drive_file_stream_reader_unittest.cc +++ b/chrome/browser/chromeos/drive/drive_file_stream_reader_unittest.cc @@ -59,7 +59,7 @@ class LocalReaderProxyTest : public ::testing::Test { worker_thread_.reset(); } - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; content::TestBrowserThread io_thread_; base::ScopedTempDir temp_dir_; @@ -112,7 +112,7 @@ class NetworkReaderProxyTest : public ::testing::Test { NetworkReaderProxyTest() : io_thread_(BrowserThread::IO, &message_loop_) { } - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; content::TestBrowserThread io_thread_; }; @@ -348,7 +348,7 @@ class DriveFileStreamReaderTest : public ::testing::Test { base::Unretained(this)); } - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/chromeos/drive/drive_integration_service_unittest.cc b/chrome/browser/chromeos/drive/drive_integration_service_unittest.cc index e84bedb..826f09f 100644 --- a/chrome/browser/chromeos/drive/drive_integration_service_unittest.cc +++ b/chrome/browser/chromeos/drive/drive_integration_service_unittest.cc @@ -36,7 +36,7 @@ class DriveIntegrationServiceTest : public testing::Test { } protected: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_ptr<TestingProfile> profile_; scoped_ptr<DriveIntegrationService> integration_service_; diff --git a/chrome/browser/chromeos/drive/drive_url_request_job_unittest.cc b/chrome/browser/chromeos/drive/drive_url_request_job_unittest.cc index 5274ce4..c5ca7df 100644 --- a/chrome/browser/chromeos/drive/drive_url_request_job_unittest.cc +++ b/chrome/browser/chromeos/drive/drive_url_request_job_unittest.cc @@ -202,7 +202,7 @@ class DriveURLRequestJobTest : public testing::Test { return true; } - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; @@ -222,7 +222,7 @@ TEST_F(DriveURLRequestJobTest, NonGetMethod) { request.set_method("POST"); // Set non "GET" method. request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(net::URLRequestStatus::FAILED, request.status().status()); EXPECT_EQ(net::ERR_METHOD_NOT_SUPPORTED, request.status().error()); @@ -239,7 +239,7 @@ TEST_F(DriveURLRequestJobTest, RegularFile) { url_request_context_.get(), test_network_delegate_.get()); request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(net::URLRequestStatus::SUCCESS, request.status().status()); // It looks weird, but the mime type for the "File 1.txt" is "audio/mpeg" @@ -264,7 +264,7 @@ TEST_F(DriveURLRequestJobTest, RegularFile) { url_request_context_.get(), test_network_delegate_.get()); request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(net::URLRequestStatus::SUCCESS, request.status().status()); std::string mime_type; @@ -286,7 +286,7 @@ TEST_F(DriveURLRequestJobTest, HostedDocument) { url_request_context_.get(), test_network_delegate_.get()); request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(net::URLRequestStatus::SUCCESS, request.status().status()); // Make sure that a hosted document triggers redirection. @@ -301,7 +301,7 @@ TEST_F(DriveURLRequestJobTest, RootDirectory) { url_request_context_.get(), test_network_delegate_.get()); request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(net::URLRequestStatus::FAILED, request.status().status()); EXPECT_EQ(net::ERR_FAILED, request.status().error()); @@ -313,7 +313,7 @@ TEST_F(DriveURLRequestJobTest, Directory) { url_request_context_.get(), test_network_delegate_.get()); request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(net::URLRequestStatus::FAILED, request.status().status()); EXPECT_EQ(net::ERR_FAILED, request.status().error()); @@ -325,7 +325,7 @@ TEST_F(DriveURLRequestJobTest, NonExistingFile) { url_request_context_.get(), test_network_delegate_.get()); request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(net::URLRequestStatus::FAILED, request.status().status()); EXPECT_EQ(net::ERR_FILE_NOT_FOUND, request.status().error()); @@ -337,7 +337,7 @@ TEST_F(DriveURLRequestJobTest, WrongFormat) { url_request_context_.get(), test_network_delegate_.get()); request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(net::URLRequestStatus::FAILED, request.status().status()); EXPECT_EQ(net::ERR_INVALID_URL, request.status().error()); @@ -352,7 +352,7 @@ TEST_F(DriveURLRequestJobTest, Cancel) { request.Start(); request.Cancel(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(net::URLRequestStatus::CANCELED, request.status().status()); } @@ -370,7 +370,7 @@ TEST_F(DriveURLRequestJobTest, RangeHeader) { "Range", "bytes=3-5", false /* overwrite */); request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(net::URLRequestStatus::SUCCESS, request.status().status()); @@ -393,7 +393,7 @@ TEST_F(DriveURLRequestJobTest, WrongRangeHeader) { "Range", "Wrong Range Header Value", false /* overwrite */); request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(net::URLRequestStatus::FAILED, request.status().status()); EXPECT_EQ(net::ERR_REQUEST_RANGE_NOT_SATISFIABLE, request.status().error()); diff --git a/chrome/browser/chromeos/drive/fake_file_system_unittest.cc b/chrome/browser/chromeos/drive/fake_file_system_unittest.cc index d00bd76..3d3384a 100644 --- a/chrome/browser/chromeos/drive/fake_file_system_unittest.cc +++ b/chrome/browser/chromeos/drive/fake_file_system_unittest.cc @@ -36,7 +36,7 @@ class FakeFileSystemTest : public ::testing::Test { ASSERT_TRUE(fake_file_system_->InitializeForTesting()); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_ptr<google_apis::FakeDriveService> fake_drive_service_; diff --git a/chrome/browser/chromeos/drive/file_cache_unittest.cc b/chrome/browser/chromeos/drive/file_cache_unittest.cc index 5a63b0d..151bdb2 100644 --- a/chrome/browser/chromeos/drive/file_cache_unittest.cc +++ b/chrome/browser/chromeos/drive/file_cache_unittest.cc @@ -522,7 +522,7 @@ class FileCacheTest : public testing::Test { return num_files_found; } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; base::ScopedTempDir temp_dir_; @@ -1264,7 +1264,7 @@ TEST_F(FileCacheTest, StoreToCacheNoSpace) { // Don't use TEST_F, as we don't want SetUp() and TearDown() for this test. TEST(FileCacheExtraTest, InitializationFailure) { - MessageLoopForUI message_loop; + base::MessageLoopForUI message_loop; content::TestBrowserThread ui_thread(content::BrowserThread::UI, &message_loop); diff --git a/chrome/browser/chromeos/drive/file_system/operation_test_base.h b/chrome/browser/chromeos/drive/file_system/operation_test_base.h index fb1b6c2..7d320c5 100644 --- a/chrome/browser/chromeos/drive/file_system/operation_test_base.h +++ b/chrome/browser/chromeos/drive/file_system/operation_test_base.h @@ -89,7 +89,7 @@ class OperationTestBase : public testing::Test { internal::FileCache* cache() { return cache_.get(); } private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; scoped_ptr<TestingProfile> profile_; diff --git a/chrome/browser/chromeos/drive/file_system_unittest.cc b/chrome/browser/chromeos/drive/file_system_unittest.cc index caadf8c..b2e09c2 100644 --- a/chrome/browser/chromeos/drive/file_system_unittest.cc +++ b/chrome/browser/chromeos/drive/file_system_unittest.cc @@ -47,7 +47,7 @@ const int64 kLotsOfSpace = internal::kMinFreeSpace * 10; // Counts the number of invocation, and if it increased up to |expected_counter| // quits the current message loop. void AsyncInitializationCallback( - int* counter, int expected_counter, MessageLoop* message_loop, + int* counter, int expected_counter, base::MessageLoop* message_loop, FileError error, scoped_ptr<ResourceEntry> entry) { if (error != FILE_ERROR_OK || !entry) { // If we hit an error case, quit the message loop immediately. @@ -367,7 +367,7 @@ class FileSystemTest : public testing::Test { EXPECT_EQ(entry.resource_id(), resource_id); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; scoped_ptr<TestingProfile> profile_; diff --git a/chrome/browser/chromeos/drive/file_system_util_unittest.cc b/chrome/browser/chromeos/drive/file_system_util_unittest.cc index 4639bb2..93a8720 100644 --- a/chrome/browser/chromeos/drive/file_system_util_unittest.cc +++ b/chrome/browser/chromeos/drive/file_system_util_unittest.cc @@ -92,7 +92,7 @@ TEST(FileSystemUtilTest, ExtractDrivePathFromFileSystemUrl) { base::ScopedTempDir temp_dir_; ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); - MessageLoop message_loop; + base::MessageLoop message_loop; scoped_refptr<fileapi::ExternalMountPoints> mount_points = fileapi::ExternalMountPoints::CreateRefCounted(); scoped_refptr<fileapi::FileSystemContext> context( diff --git a/chrome/browser/chromeos/drive/file_write_helper_unittest.cc b/chrome/browser/chromeos/drive/file_write_helper_unittest.cc index bb68996..4a80cec 100644 --- a/chrome/browser/chromeos/drive/file_write_helper_unittest.cc +++ b/chrome/browser/chromeos/drive/file_write_helper_unittest.cc @@ -77,7 +77,7 @@ class FileWriteHelperTest : public testing::Test { } protected: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_ptr<TestFileSystem> test_file_system_; }; diff --git a/chrome/browser/chromeos/drive/job_scheduler_unittest.cc b/chrome/browser/chromeos/drive/job_scheduler_unittest.cc index d455fd8b..0cf8546 100644 --- a/chrome/browser/chromeos/drive/job_scheduler_unittest.cc +++ b/chrome/browser/chromeos/drive/job_scheduler_unittest.cc @@ -161,7 +161,7 @@ class JobSchedulerTest : public testing::Test { ChangeConnectionType(net::NetworkChangeNotifier::CONNECTION_NONE); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_ptr<TestingProfile> profile_; scoped_ptr<JobScheduler> scheduler_; diff --git a/chrome/browser/chromeos/drive/local_file_reader_unittest.cc b/chrome/browser/chromeos/drive/local_file_reader_unittest.cc index 43b6ce5..dd8acf4 100644 --- a/chrome/browser/chromeos/drive/local_file_reader_unittest.cc +++ b/chrome/browser/chromeos/drive/local_file_reader_unittest.cc @@ -60,7 +60,7 @@ class LocalFileReaderTest : public ::testing::Test { worker_thread_.reset(); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; base::ScopedTempDir temp_dir_; scoped_ptr<base::Thread> worker_thread_; scoped_ptr<LocalFileReader> file_reader_; diff --git a/chrome/browser/chromeos/drive/remove_stale_cache_files_unittest.cc b/chrome/browser/chromeos/drive/remove_stale_cache_files_unittest.cc index 1d3d51e..6c46169 100644 --- a/chrome/browser/chromeos/drive/remove_stale_cache_files_unittest.cc +++ b/chrome/browser/chromeos/drive/remove_stale_cache_files_unittest.cc @@ -54,7 +54,7 @@ class RemoveStaleCacheFilesTest : public testing::Test { ASSERT_EQ(FILE_ERROR_OK, error); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; base::ScopedTempDir temp_dir_; diff --git a/chrome/browser/chromeos/drive/resource_metadata_unittest.cc b/chrome/browser/chromeos/drive/resource_metadata_unittest.cc index dc5a945..71ac23a 100644 --- a/chrome/browser/chromeos/drive/resource_metadata_unittest.cc +++ b/chrome/browser/chromeos/drive/resource_metadata_unittest.cc @@ -216,7 +216,7 @@ class ResourceMetadataTestOnUIThread : public testing::Test { resource_metadata_; private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; }; @@ -1198,7 +1198,7 @@ class ResourceMetadataTest : public testing::Test { } base::ScopedTempDir temp_dir_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_ptr<ResourceMetadata, test_util::DestroyHelperForTests> resource_metadata_; diff --git a/chrome/browser/chromeos/drive/search_metadata_unittest.cc b/chrome/browser/chromeos/drive/search_metadata_unittest.cc index ec892ff..0362d6e 100644 --- a/chrome/browser/chromeos/drive/search_metadata_unittest.cc +++ b/chrome/browser/chromeos/drive/search_metadata_unittest.cc @@ -215,7 +215,7 @@ class SearchMetadataTest : public testing::Test { EXPECT_EQ(FILE_ERROR_OK, error); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; base::ScopedTempDir temp_dir_; scoped_ptr<FakeFreeDiskSpaceGetter> fake_free_disk_space_getter_; diff --git a/chrome/browser/chromeos/drive/sync_client_unittest.cc b/chrome/browser/chromeos/drive/sync_client_unittest.cc index d88d687..e41bf43 100644 --- a/chrome/browser/chromeos/drive/sync_client_unittest.cc +++ b/chrome/browser/chromeos/drive/sync_client_unittest.cc @@ -215,7 +215,7 @@ class SyncClientTest : public testing::Test { } protected: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; base::ScopedTempDir temp_dir_; scoped_ptr<StrictMock<MockFileSystem> > mock_file_system_; diff --git a/chrome/browser/chromeos/drive/webkit_file_stream_reader_impl_unittest.cc b/chrome/browser/chromeos/drive/webkit_file_stream_reader_impl_unittest.cc index 8064fc2..687bd52 100644 --- a/chrome/browser/chromeos/drive/webkit_file_stream_reader_impl_unittest.cc +++ b/chrome/browser/chromeos/drive/webkit_file_stream_reader_impl_unittest.cc @@ -96,7 +96,7 @@ class WebkitFileStreamReaderImplTest : public ::testing::Test { base::Unretained(this)); } - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/chromeos/extensions/file_manager/file_manager_browsertest.cc b/chrome/browser/chromeos/extensions/file_manager/file_manager_browsertest.cc index 081e350..1e0bd76 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_manager_browsertest.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_manager_browsertest.cc @@ -217,7 +217,7 @@ class DriveTestVolume : public TestVolume { name, google_apis::test_util::CreateCopyResultCallback(&error, &resource_entry)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_TRUE(error == google_apis::HTTP_CREATED); ASSERT_TRUE(resource_entry); @@ -228,7 +228,7 @@ class DriveTestVolume : public TestVolume { time, google_apis::test_util::CreateCopyResultCallback(&error, &resource_entry)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_TRUE(error == google_apis::HTTP_SUCCESS); ASSERT_TRUE(resource_entry); CheckForUpdates(); @@ -264,7 +264,7 @@ class DriveTestVolume : public TestVolume { shared_with_me, google_apis::test_util::CreateCopyResultCallback(&error, &resource_entry)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_EQ(google_apis::HTTP_CREATED, error); ASSERT_TRUE(resource_entry); @@ -275,7 +275,7 @@ class DriveTestVolume : public TestVolume { time, google_apis::test_util::CreateCopyResultCallback(&error, &resource_entry)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_EQ(google_apis::HTTP_SUCCESS, error); ASSERT_TRUE(resource_entry); diff --git a/chrome/browser/chromeos/extensions/file_manager/file_manager_notifications.cc b/chrome/browser/chromeos/extensions/file_manager/file_manager_notifications.cc index 8331d82..166b8d1 100644 --- a/chrome/browser/chromeos/extensions/file_manager/file_manager_notifications.cc +++ b/chrome/browser/chromeos/extensions/file_manager/file_manager_notifications.cc @@ -319,7 +319,7 @@ void FileManagerNotifications::ShowNotificationDelayed( base::TimeDelta delay) { std::string notification_id = GetNotificationId(type, path); hidden_notifications_.erase(notification_id); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&FileManagerNotifications::ShowNotificationById, AsWeakPtr(), type, notification_id, GetMessage(type)), @@ -334,7 +334,7 @@ void FileManagerNotifications::HideNotification(NotificationType type, void FileManagerNotifications::HideNotificationDelayed( NotificationType type, const std::string& path, base::TimeDelta delay) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&FileManagerNotifications::HideNotification, AsWeakPtr(), type, path), diff --git a/chrome/browser/chromeos/input_method/candidate_window_view.cc b/chrome/browser/chromeos/input_method/candidate_window_view.cc index b9b9abc..7c482db 100644 --- a/chrome/browser/chromeos/input_method/candidate_window_view.cc +++ b/chrome/browser/chromeos/input_method/candidate_window_view.cc @@ -789,7 +789,7 @@ void CandidateWindowView::MaybeInitializeCandidateViews( for (size_t i = 0; i < candidate_views_.size(); ++i) { candidate_area_contents->RemoveChildView(candidate_views_[i]); // Delete the view after getting out the current message loop iteration. - MessageLoop::current()->DeleteSoon(FROM_HERE, candidate_views_[i]); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, candidate_views_[i]); } candidate_views_.clear(); selected_candidate_index_in_page_ = -1; // Invalidates the index. diff --git a/chrome/browser/chromeos/input_method/input_method_engine_ibus_browserttests.cc b/chrome/browser/chromeos/input_method/input_method_engine_ibus_browserttests.cc index 3877887..4a92aa7 100644 --- a/chrome/browser/chromeos/input_method/input_method_engine_ibus_browserttests.cc +++ b/chrome/browser/chromeos/input_method/input_method_engine_ibus_browserttests.cc @@ -135,7 +135,7 @@ class KeyEventDoneCallback { void Run(bool consumed) { if (consumed == expected_argument_) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); is_called_ = true; } } diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc index ee64734..a1b75d2 100644 --- a/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc +++ b/chrome/browser/chromeos/input_method/input_method_manager_impl_unittest.cc @@ -155,7 +155,7 @@ class InputMethodManagerImplTest : public testing::Test { MockIBusClient* mock_ibus_client_; MockDBusThreadManagerWithoutGMock* mock_dbus_thread_manager_; MockXKeyboard* xkeyboard_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; MockComponentExtIMEManagerDelegate* mock_delegate_; std::vector<ComponentExtensionIME> ime_list_; diff --git a/chrome/browser/chromeos/input_method/textinput_test_helper.cc b/chrome/browser/chromeos/input_method/textinput_test_helper.cc index 2bf5712..5132724 100644 --- a/chrome/browser/chromeos/input_method/textinput_test_helper.cc +++ b/chrome/browser/chromeos/input_method/textinput_test_helper.cc @@ -75,7 +75,7 @@ void TextInputTestHelper::OnTextInputTypeChanged( const ui::TextInputClient* client) { latest_text_input_type_ = client->GetTextInputType(); if (waiting_type_ == WAIT_ON_TEXT_INPUT_TYPE_CHANGED) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void TextInputTestHelper::OnInputMethodDestroyed( @@ -85,13 +85,13 @@ void TextInputTestHelper::OnInputMethodDestroyed( void TextInputTestHelper::OnFocus() { focus_state_ = true; if (waiting_type_ == WAIT_ON_FOCUS) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void TextInputTestHelper::OnBlur() { focus_state_ = false; if (waiting_type_ == WAIT_ON_BLUR) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void TextInputTestHelper::OnCaretBoundsChanged( @@ -102,7 +102,7 @@ void TextInputTestHelper::OnCaretBoundsChanged( !GetTextInputClient()->GetSelectionRange(&selection_range_)) return; if (waiting_type_ == WAIT_ON_CARET_BOUNDS_CHANGED) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void TextInputTestHelper::OnTextInputStateChanged( diff --git a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings_unittest.cc b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings_unittest.cc index 2ebf51b..bad84df 100644 --- a/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings_unittest.cc +++ b/chrome/browser/chromeos/kiosk_mode/kiosk_mode_settings_unittest.cc @@ -26,7 +26,7 @@ namespace chromeos { class KioskModeSettingsTest : public testing::Test { protected: KioskModeSettingsTest() - : message_loop_(MessageLoop::TYPE_UI), + : message_loop_(base::MessageLoop::TYPE_UI), ui_thread_(content::BrowserThread::UI, &message_loop_), file_thread_(content::BrowserThread::FILE, &message_loop_) { CrosSettings* cros_settings = CrosSettings::Get(); @@ -70,7 +70,7 @@ class KioskModeSettingsTest : public testing::Test { KioskModeSettings::Get()->set_initialized(false); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/chromeos/login/existing_user_controller_auto_login_unittest.cc b/chrome/browser/chromeos/login/existing_user_controller_auto_login_unittest.cc index 3a7cadf..36831d0 100644 --- a/chrome/browser/chromeos/login/existing_user_controller_auto_login_unittest.cc +++ b/chrome/browser/chromeos/login/existing_user_controller_auto_login_unittest.cc @@ -46,7 +46,7 @@ class ExistingUserControllerAutoLoginTest : public ::testing::Test { : auto_login_user_id_(policy::GenerateDeviceLocalAccountUserId( kAutoLoginAccountId, policy::DeviceLocalAccount::TYPE_PUBLIC_SESSION)), - message_loop_(MessageLoop::TYPE_UI), + message_loop_(base::MessageLoop::TYPE_UI), ui_thread_(content::BrowserThread::UI, &message_loop_), local_state_(TestingBrowserProcess::GetGlobal()), mock_user_manager_(new MockUserManager()), @@ -153,7 +153,7 @@ class ExistingUserControllerAutoLoginTest : public ::testing::Test { MockLoginDisplay* mock_login_display_; scoped_ptr<MockLoginDisplayHost> mock_login_display_host_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; ScopedTestingLocalState local_state_; diff --git a/chrome/browser/chromeos/login/login_browsertest.cc b/chrome/browser/chromeos/login/login_browsertest.cc index 74c2f2af..9dc8ded 100644 --- a/chrome/browser/chromeos/login/login_browsertest.cc +++ b/chrome/browser/chromeos/login/login_browsertest.cc @@ -209,7 +209,7 @@ IN_PROC_BROWSER_TEST_F(LoginCursorTest, CursorHidden) { EXPECT_TRUE(ui_test_utils::SendMouseMoveSync(gfx::Point())); EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible()); - MessageLoop::current()->DeleteSoon( + base::MessageLoop::current()->DeleteSoon( FROM_HERE, chromeos::LoginDisplayHostImpl::default_host()); } diff --git a/chrome/browser/chromeos/login/login_display_host_impl.cc b/chrome/browser/chromeos/login/login_display_host_impl.cc index 0953c6b..1a9cb25 100644 --- a/chrome/browser/chromeos/login/login_display_host_impl.cc +++ b/chrome/browser/chromeos/login/login_display_host_impl.cc @@ -584,9 +584,9 @@ void LoginDisplayHostImpl::ShutdownDisplayHost(bool post_quit_task) { shutting_down_ = true; registrar_.RemoveAll(); - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); if (post_quit_task) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void LoginDisplayHostImpl::StartAnimation() { diff --git a/chrome/browser/chromeos/login/login_performer.cc b/chrome/browser/chromeos/login/login_performer.cc index 2c24f7b..ab0a66e 100644 --- a/chrome/browser/chromeos/login/login_performer.cc +++ b/chrome/browser/chromeos/login/login_performer.cc @@ -109,7 +109,7 @@ void LoginPerformer::OnLoginFailure(const LoginFailure& failure) { VLOG(1) << "Online login timed out. " << "Granting user access based on offline auth only."; // ScreenLock is not active, it's ok to delete itself. - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } else { // COULD_NOT_MOUNT_CRYPTOHOME, COULD_NOT_MOUNT_TMPFS: // happens during offline auth only. @@ -150,7 +150,7 @@ void LoginPerformer::OnLoginSuccess( // 1. ScreenLock active (pending correct new password input) // 2. Pending online auth request. if (!pending_requests) - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); else initial_online_auth_pending_ = true; @@ -375,7 +375,7 @@ void LoginPerformer::ResolveInitialNetworkAuthFailure() { << "Online login failed with " << last_login_failure_.error().state(); // Resolving initial online auth failure, no ScreenLock is active. - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); return; case GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS: // Offline auth OK, so it might be the case of changed password. @@ -473,7 +473,7 @@ void LoginPerformer::ResolveScreenUnlocked() { DVLOG(1) << "Screen unlocked"; registrar_.RemoveAll(); // If screen was unlocked that was for a reason, should delete itself now. - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } void LoginPerformer::StartLoginCompletion() { diff --git a/chrome/browser/chromeos/login/login_utils_browsertest.cc b/chrome/browser/chromeos/login/login_utils_browsertest.cc index d29059a..cbcc7eb 100644 --- a/chrome/browser/chromeos/login/login_utils_browsertest.cc +++ b/chrome/browser/chromeos/login/login_utils_browsertest.cc @@ -134,7 +134,7 @@ void BlockLoop(base::WaitableEvent* completion, base::Callback<bool()> work) { do { completion->Wait(); } while (work.Run()); - MessageLoop::current()->QuitNow(); + base::MessageLoop::current()->QuitNow(); } void CopyLockResult(base::RunLoop* loop, @@ -159,7 +159,7 @@ class LoginUtilsTest : public testing::Test, LoginUtilsTest() : fake_io_thread_completion_(false, false), fake_io_thread_("fake_io_thread"), - loop_(MessageLoop::TYPE_IO), + loop_(base::MessageLoop::TYPE_IO), browser_process_(TestingBrowserProcess::GetGlobal()), local_state_(browser_process_), ui_thread_(BrowserThread::UI, &loop_), @@ -185,8 +185,8 @@ class LoginUtilsTest : public testing::Test, // A thread is needed to create a new MessageLoop, since there can be only // one loop per thread. fake_io_thread_.StartWithOptions( - base::Thread::Options(MessageLoop::TYPE_IO, 0)); - MessageLoop* fake_io_loop = fake_io_thread_.message_loop(); + base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); + base::MessageLoop* fake_io_loop = fake_io_thread_.message_loop(); // Make this loop enter the single task, BlockLoop(). Pass in the completion // event and the work callback. fake_io_thread_.StopSoon(); @@ -363,7 +363,7 @@ class LoginUtilsTest : public testing::Test, fake_io_thread_work_.Reset(); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, - MessageLoop::QuitWhenIdleClosure()); + base::MessageLoop::QuitWhenIdleClosure()); // If there was work then keep waiting for more work. // If there was no work then quit the fake IO loop. return has_work; @@ -504,7 +504,7 @@ class LoginUtilsTest : public testing::Test, base::WaitableEvent fake_io_thread_completion_; base::Thread fake_io_thread_; - MessageLoop loop_; + base::MessageLoop loop_; TestingBrowserProcess* browser_process_; ScopedTestingLocalState local_state_; diff --git a/chrome/browser/chromeos/login/merge_session_load_page_unittest.cc b/chrome/browser/chromeos/login/merge_session_load_page_unittest.cc index 8eef9c0..be5778d 100644 --- a/chrome/browser/chromeos/login/merge_session_load_page_unittest.cc +++ b/chrome/browser/chromeos/login/merge_session_load_page_unittest.cc @@ -50,10 +50,10 @@ class TestMergeSessionLoadPage : public MergeSessionLoadPage { class MergeSessionLoadPageTest : public ChromeRenderViewHostTestHarness { public: MergeSessionLoadPageTest() - : ui_thread_(BrowserThread::UI, MessageLoop::current()), + : ui_thread_(BrowserThread::UI, base::MessageLoop::current()), file_user_blocking_thread_( - BrowserThread::FILE_USER_BLOCKING, MessageLoop::current()), - io_thread_(BrowserThread::IO, MessageLoop::current()) { + BrowserThread::FILE_USER_BLOCKING, base::MessageLoop::current()), + io_thread_(BrowserThread::IO, base::MessageLoop::current()) { } void Navigate(const char* url, int page_id) { @@ -114,12 +114,12 @@ TEST_F(MergeSessionLoadPageTest, MergeSessionPageShown) { ShowInterstitial(kURL2); InterstitialPage* interstitial = GetMergeSessionLoadPage(); ASSERT_TRUE(interstitial); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Simulate merge session completion. UserManager::Get()->SetMergeSessionState( UserManager::MERGE_STATUS_DONE); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // The URL remains to be URL2. EXPECT_EQ(kURL2, web_contents()->GetURL().spec()); diff --git a/chrome/browser/chromeos/login/mock_login_status_consumer.cc b/chrome/browser/chromeos/login/mock_login_status_consumer.cc index 161bb05..a826ac6 100644 --- a/chrome/browser/chromeos/login/mock_login_status_consumer.cc +++ b/chrome/browser/chromeos/login/mock_login_status_consumer.cc @@ -17,25 +17,25 @@ MockConsumer::~MockConsumer() {} // static void MockConsumer::OnRetailModeSuccessQuit(const UserContext& user_context) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // static void MockConsumer::OnRetailModeSuccessQuitAndFail( const UserContext& user_context) { ADD_FAILURE() << "Retail mode login should have failed!"; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // static void MockConsumer::OnGuestSuccessQuit() { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // static void MockConsumer::OnGuestSuccessQuitAndFail() { ADD_FAILURE() << "Guest login should have failed!"; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // static @@ -43,7 +43,7 @@ void MockConsumer::OnSuccessQuit( const UserContext& user_context, bool pending_requests, bool using_oauth) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // static @@ -52,29 +52,29 @@ void MockConsumer::OnSuccessQuitAndFail( bool pending_requests, bool using_oauth) { ADD_FAILURE() << "Login should NOT have succeeded!"; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // static void MockConsumer::OnFailQuit(const LoginFailure& error) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // static void MockConsumer::OnFailQuitAndFail(const LoginFailure& error) { ADD_FAILURE() << "Login should not have failed!"; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // static void MockConsumer::OnMigrateQuit() { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // static void MockConsumer::OnMigrateQuitAndFail() { ADD_FAILURE() << "Should not have detected a PW change!"; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } // namespace chromeos diff --git a/chrome/browser/chromeos/login/mock_url_fetchers.cc b/chrome/browser/chromeos/login/mock_url_fetchers.cc index 8582ad6..8a45c12 100644 --- a/chrome/browser/chromeos/login/mock_url_fetchers.cc +++ b/chrome/browser/chromeos/login/mock_url_fetchers.cc @@ -32,7 +32,7 @@ ExpectCanceledFetcher::~ExpectCanceledFetcher() { } void ExpectCanceledFetcher::Start() { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ExpectCanceledFetcher::CompleteFetch, weak_factory_.GetWeakPtr()), @@ -41,7 +41,7 @@ void ExpectCanceledFetcher::Start() { void ExpectCanceledFetcher::CompleteFetch() { ADD_FAILURE() << "Fetch completed in ExpectCanceledFetcher!"; - MessageLoop::current()->Quit(); // Allow exiting even if we mess up. + base::MessageLoop::current()->Quit(); // Allow exiting even if we mess up. } GotCanceledFetcher::GotCanceledFetcher( diff --git a/chrome/browser/chromeos/login/online_attempt_unittest.cc b/chrome/browser/chromeos/login/online_attempt_unittest.cc index ac1a8de..34c089f 100644 --- a/chrome/browser/chromeos/login/online_attempt_unittest.cc +++ b/chrome/browser/chromeos/login/online_attempt_unittest.cc @@ -33,7 +33,7 @@ namespace chromeos { class OnlineAttemptTest : public testing::Test { public: OnlineAttemptTest() - : message_loop_(MessageLoop::TYPE_UI), + : message_loop_(base::MessageLoop::TYPE_UI), ui_thread_(BrowserThread::UI, &message_loop_), state_(UserContext(), "", "", "", User::USER_TYPE_REGULAR, false), resolver_(new MockAuthAttemptStateResolver) { @@ -72,14 +72,14 @@ class OnlineAttemptTest : public testing::Test { static void Quit() { BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, MessageLoop::QuitClosure()); + BrowserThread::UI, FROM_HERE, base::MessageLoop::QuitClosure()); } static void RunThreadTest() { - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; TestAttemptState state_; scoped_ptr<MockAuthAttemptStateResolver> resolver_; @@ -121,7 +121,7 @@ TEST_F(OnlineAttemptTest, LoginCancelRetry) { BrowserThread::UI, FROM_HERE, base::Bind(&OnlineAttemptTest::RunThreadTest)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(error == state_.online_outcome().error()); EXPECT_EQ(LoginFailure::NETWORK_AUTH_FAILED, @@ -149,7 +149,7 @@ TEST_F(OnlineAttemptTest, LoginTimeout) { // Post a task to cancel the login attempt. CancelLogin(attempt_.get()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(LoginFailure::LOGIN_TIMED_OUT, state_.online_outcome().reason()); } @@ -176,7 +176,7 @@ TEST_F(OnlineAttemptTest, HostedLoginRejected) { BrowserThread::UI, FROM_HERE, base::Bind(&OnlineAttemptTest::RunThreadTest)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(error, local_state.online_outcome()); EXPECT_EQ(LoginFailure::NETWORK_AUTH_FAILED, @@ -201,7 +201,7 @@ TEST_F(OnlineAttemptTest, FullLogin) { BrowserThread::UI, FROM_HERE, base::Bind(&OnlineAttemptTest::RunThreadTest)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(LoginFailure::LoginFailureNone(), local_state.online_outcome()); } diff --git a/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc b/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc index f491c19..64fb292 100644 --- a/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc +++ b/chrome/browser/chromeos/login/parallel_authenticator_unittest.cc @@ -57,7 +57,7 @@ class TestOnlineAttempt : public OnlineAttempt { class ParallelAuthenticatorTest : public testing::Test { public: ParallelAuthenticatorTest() - : message_loop_(MessageLoop::TYPE_UI), + : message_loop_(base::MessageLoop::TYPE_UI), ui_thread_(BrowserThread::UI, &message_loop_), file_thread_(BrowserThread::FILE, &message_loop_), io_thread_(BrowserThread::IO), @@ -199,7 +199,7 @@ class ParallelAuthenticatorTest : public testing::Test { auth_->set_online_attempt(new TestOnlineAttempt(state_.get(), auth_.get())); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc index 853d6215..3abd60b 100644 --- a/chrome/browser/chromeos/login/screen_locker.cc +++ b/chrome/browser/chromeos/login/screen_locker.cc @@ -222,7 +222,7 @@ void ScreenLocker::OnLoginSuccess( } else { // Add guard for case when something get broken in call chain to unlock // for sure. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ScreenLocker::UnlockOnLoginSuccess, weak_factory_.GetWeakPtr()), @@ -232,7 +232,7 @@ void ScreenLocker::OnLoginSuccess( } void ScreenLocker::UnlockOnLoginSuccess() { - DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI); + DCHECK(base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI); if (!authentication_capture_.get()) { LOG(WARNING) << "Call to UnlockOnLoginSuccess without previous " << "authentication success."; @@ -312,7 +312,7 @@ void ScreenLocker::SetLoginStatusConsumer( // static void ScreenLocker::Show() { content::RecordAction(UserMetricsAction("ScreenLocker_Show")); - DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI); + DCHECK(base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI); // Check whether the currently logged in user is a guest account and if so, // refuse to lock the screen (crosbug.com/23764). @@ -349,7 +349,7 @@ void ScreenLocker::Show() { // static void ScreenLocker::Hide() { - DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI); + DCHECK(base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI); // For a guest/demo user, screen_locker_ would have never been initialized. if (UserManager::Get()->IsLoggedInAsGuest() || UserManager::Get()->IsLoggedInAsDemoUser()) { @@ -371,7 +371,7 @@ void ScreenLocker::ScheduleDeletion() { VLOG(1) << "Posting task to delete ScreenLocker " << screen_locker_; ScreenLocker* screen_locker = screen_locker_; screen_locker_ = NULL; - MessageLoopForUI::current()->DeleteSoon(FROM_HERE, screen_locker); + base::MessageLoopForUI::current()->DeleteSoon(FROM_HERE, screen_locker); } // static @@ -384,7 +384,7 @@ void ScreenLocker::InitClass() { ScreenLocker::~ScreenLocker() { VLOG(1) << "Destroying ScreenLocker " << this; - DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI); + DCHECK(base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI); if (authenticator_) authenticator_->SetConsumer(NULL); diff --git a/chrome/browser/chromeos/login/screen_locker_browsertest.cc b/chrome/browser/chromeos/login/screen_locker_browsertest.cc index 31b8f901..72f3e86 100644 --- a/chrome/browser/chromeos/login/screen_locker_browsertest.cc +++ b/chrome/browser/chromeos/login/screen_locker_browsertest.cc @@ -58,7 +58,7 @@ class Waiter : public content::NotificationObserver { DCHECK(type == chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED || type == chrome::NOTIFICATION_FULLSCREEN_CHANGED); if (running_) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // Wait until the two conditions are met. diff --git a/chrome/browser/chromeos/login/screen_locker_tester.cc b/chrome/browser/chromeos/login/screen_locker_tester.cc index 8e644cc..75a71ea 100644 --- a/chrome/browser/chromeos/login/screen_locker_tester.cc +++ b/chrome/browser/chromeos/login/screen_locker_tester.cc @@ -81,7 +81,7 @@ void LoginAttemptObserver::WaitForAttempt() { void LoginAttemptObserver::LoginAttempted() { login_attempted_ = true; if (waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } diff --git a/chrome/browser/chromeos/login/screens/update_screen_browsertest.cc b/chrome/browser/chromeos/login/screens/update_screen_browsertest.cc index 81c21de..bb11ddd 100644 --- a/chrome/browser/chromeos/login/screens/update_screen_browsertest.cc +++ b/chrome/browser/chromeos/login/screens/update_screen_browsertest.cc @@ -353,7 +353,7 @@ IN_PROC_BROWSER_TEST_F(UpdateScreenTest, TestVoidNetwork) { .Times(1); EXPECT_CALL(*mock_screen_observer_, ShowErrorScreen()) .Times(1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); NotifyPortalDetectionCompleted(); } diff --git a/chrome/browser/chromeos/login/simple_web_view_dialog.cc b/chrome/browser/chromeos/login/simple_web_view_dialog.cc index 996f682..29f6494 100644 --- a/chrome/browser/chromeos/login/simple_web_view_dialog.cc +++ b/chrome/browser/chromeos/login/simple_web_view_dialog.cc @@ -138,7 +138,7 @@ SimpleWebViewDialog::~SimpleWebViewDialog() { if (web_view_container_.get()) { // WebView can't be deleted immediately, because it could be on the stack. web_view_->web_contents()->SetDelegate(NULL); - MessageLoop::current()->DeleteSoon( + base::MessageLoop::current()->DeleteSoon( FROM_HERE, web_view_container_.release()); } } diff --git a/chrome/browser/chromeos/login/tpm_password_fetcher.cc b/chrome/browser/chromeos/login/tpm_password_fetcher.cc index face9b1..e1e116e 100644 --- a/chrome/browser/chromeos/login/tpm_password_fetcher.cc +++ b/chrome/browser/chromeos/login/tpm_password_fetcher.cc @@ -66,7 +66,7 @@ void TpmPasswordFetcher::OnTpmGetPassword(DBusMethodCallStatus call_status, } void TpmPasswordFetcher::RescheduleFetch() { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&TpmPasswordFetcher::Fetch, weak_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(kTpmCheckIntervalMs)); diff --git a/chrome/browser/chromeos/login/user_flow.cc b/chrome/browser/chromeos/login/user_flow.cc index a4da1a3..d7302e8 100644 --- a/chrome/browser/chromeos/login/user_flow.cc +++ b/chrome/browser/chromeos/login/user_flow.cc @@ -56,7 +56,7 @@ ExtendedUserFlow::~ExtendedUserFlow() { void ExtendedUserFlow::UnregisterFlowSoon() { std::string id_copy(user_id()); - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&UnregisterFlow, id_copy)); } diff --git a/chrome/browser/chromeos/login/user_image_loader.cc b/chrome/browser/chromeos/login/user_image_loader.cc index 301d712..c67b5a4 100644 --- a/chrome/browser/chromeos/login/user_image_loader.cc +++ b/chrome/browser/chromeos/login/user_image_loader.cc @@ -51,7 +51,7 @@ void UserImageLoader::Start(const std::string& filepath, int size, const SequenceToken& token, const LoadedCallback& loaded_cb) { - target_message_loop_ = MessageLoop::current(); + target_message_loop_ = base::MessageLoop::current(); ImageInfo image_info(size, loaded_cb); base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); diff --git a/chrome/browser/chromeos/login/user_image_manager_browsertest.cc b/chrome/browser/chromeos/login/user_image_manager_browsertest.cc index 4dff6da..4e967e8 100644 --- a/chrome/browser/chromeos/login/user_image_manager_browsertest.cc +++ b/chrome/browser/chromeos/login/user_image_manager_browsertest.cc @@ -62,12 +62,12 @@ class UserImageManagerTest : public CrosInProcessBrowserTest, DCHECK(type == chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED); registrar_.Remove(this, chrome::NOTIFICATION_LOGIN_USER_IMAGE_CHANGED, content::NotificationService::AllSources()); - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } // UserManager::Observer overrides: virtual void LocalStateChanged(UserManager* user_manager) OVERRIDE { - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } // Adds given user to Local State, if not there. diff --git a/chrome/browser/chromeos/login/user_manager_unittest.cc b/chrome/browser/chromeos/login/user_manager_unittest.cc index 1e65fe0..b0fe8d8 100644 --- a/chrome/browser/chromeos/login/user_manager_unittest.cc +++ b/chrome/browser/chromeos/login/user_manager_unittest.cc @@ -30,7 +30,7 @@ namespace chromeos { class UserManagerTest : public testing::Test { public: UserManagerTest() - : message_loop_(MessageLoop::TYPE_UI), + : message_loop_(base::MessageLoop::TYPE_UI), ui_thread_(content::BrowserThread::UI, &message_loop_), file_thread_(content::BrowserThread::FILE, &message_loop_) { } @@ -122,7 +122,7 @@ class UserManagerTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc b/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc index 1304215..0bb93e6 100644 --- a/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc +++ b/chrome/browser/chromeos/login/wallpaper_manager_browsertest.cc @@ -85,11 +85,11 @@ class WallpaperManagerBrowserTest : public CrosInProcessBrowserTest, } void WaitAsyncWallpaperLoad() { - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } virtual void OnWallpaperDataChanged() OVERRIDE { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } protected: diff --git a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc index 373b142..361523c 100644 --- a/chrome/browser/chromeos/login/wizard_controller_browsertest.cc +++ b/chrome/browser/chromeos/login/wizard_controller_browsertest.cc @@ -307,7 +307,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ExistingUserController::current_controller()->CompleteLogin( UserContext(kUsername, kPassword, "")); // Run the tasks posted to complete the login: - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EnrollmentScreen* screen = WizardController::default_controller()->GetEnrollmentScreen(); @@ -318,7 +318,7 @@ IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, // Prevent browser launch when the profile is prepared: browser_shutdown::SetTryingToQuit(true); // Run the tasks posted to complete the login: - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } IN_PROC_BROWSER_TEST_F(WizardControllerFlowTest, ControlFlowResetScreen) { diff --git a/chrome/browser/chromeos/login/wizard_in_process_browser_test.cc b/chrome/browser/chromeos/login/wizard_in_process_browser_test.cc index 1284143..56e5364 100644 --- a/chrome/browser/chromeos/login/wizard_in_process_browser_test.cc +++ b/chrome/browser/chromeos/login/wizard_in_process_browser_test.cc @@ -43,9 +43,9 @@ void WizardInProcessBrowserTest::SetUpOnMainThread() { void WizardInProcessBrowserTest::CleanUpOnMainThread() { // LoginDisplayHost owns controllers and all windows. - MessageLoopForUI::current()->DeleteSoon(FROM_HERE, host_); + base::MessageLoopForUI::current()->DeleteSoon(FROM_HERE, host_); - MessageLoopForUI::current()->RunUntilIdle(); + base::MessageLoopForUI::current()->RunUntilIdle(); } } // namespace chromeos diff --git a/chrome/browser/chromeos/net/network_portal_detector_impl.cc b/chrome/browser/chromeos/net/network_portal_detector_impl.cc index 1ccf039..7f8d85e 100644 --- a/chrome/browser/chromeos/net/network_portal_detector_impl.cc +++ b/chrome/browser/chromeos/net/network_portal_detector_impl.cc @@ -286,9 +286,8 @@ void NetworkPortalDetectorImpl::DetectCaptivePortal( detection_task_.Reset( base::Bind(&NetworkPortalDetectorImpl::DetectCaptivePortalTask, weak_ptr_factory_.GetWeakPtr())); - MessageLoop::current()->PostDelayedTask(FROM_HERE, - detection_task_.callback(), - next_attempt_delay_); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, detection_task_.callback(), next_attempt_delay_); } void NetworkPortalDetectorImpl::DetectCaptivePortalTask() { @@ -322,9 +321,8 @@ void NetworkPortalDetectorImpl::DetectCaptivePortalTask() { request_timeout = request_timeout_for_testing_; else request_timeout = base::TimeDelta::FromSeconds(GetRequestTimeoutSec()); - MessageLoop::current()->PostDelayedTask(FROM_HERE, - detection_timeout_.callback(), - request_timeout); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, detection_timeout_.callback(), request_timeout); } void NetworkPortalDetectorImpl::PortalDetectionTimeout() { diff --git a/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc b/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc index 74807a7..6b497dd 100644 --- a/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc +++ b/chrome/browser/chromeos/net/network_portal_detector_impl_unittest.cc @@ -167,13 +167,13 @@ class NetworkPortalDetectorImplTest dbus::ObjectPath(service_path), flimflam::kStateProperty, base::StringValue(flimflam::kStatePortal), base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } void SetNetworkDeviceEnabled(const std::string& type, bool enabled) { NetworkHandler::Get()->network_state_handler()->SetTechnologyEnabled( type, enabled, network_handler::ErrorCallback()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } void SetConnected(const std::string& service_path) { @@ -181,12 +181,12 @@ class NetworkPortalDetectorImplTest dbus::ObjectPath(service_path), flimflam::kStateProperty, base::StringValue(flimflam::kStateOnline), base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } private: void SetupDefaultShillState() { - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ShillServiceClient::TestInterface* service_test = DBusThreadManager::Get()->GetShillServiceClient()->GetTestInterface(); service_test->ClearServices(); @@ -214,7 +214,7 @@ class NetworkPortalDetectorImplTest NetworkHandler::Initialize(); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; scoped_ptr<TestingProfile> profile_; scoped_ptr<NetworkPortalDetectorImpl> network_portal_detector_; }; @@ -377,7 +377,7 @@ TEST_F(NetworkPortalDetectorImplTest, PortalDetectionTimeout) { ASSERT_EQ(0, attempt_count()); SetConnected(kStubWireless1); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // First portal detection timeouts, next portal detection is // scheduled. @@ -440,7 +440,7 @@ TEST_F(NetworkPortalDetectorImplTest, FirstAttemptFailed) { ASSERT_EQ(base::TimeDelta::FromSeconds(0), next_attempt_delay()); // To run CaptivePortalDetector::DetectCaptivePortal(). - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CompleteURLFetch(net::OK, 204, NULL); ASSERT_TRUE(is_state_idle()); @@ -466,7 +466,7 @@ TEST_F(NetworkPortalDetectorImplTest, AllAttemptsFailed) { ASSERT_EQ(base::TimeDelta::FromSeconds(0), next_attempt_delay()); // To run CaptivePortalDetector::DetectCaptivePortal(). - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CompleteURLFetch(net::OK, 503, retry_after); ASSERT_TRUE(is_state_portal_detection_pending()); @@ -474,7 +474,7 @@ TEST_F(NetworkPortalDetectorImplTest, AllAttemptsFailed) { ASSERT_EQ(base::TimeDelta::FromSeconds(0), next_attempt_delay()); // To run CaptivePortalDetector::DetectCaptivePortal(). - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CompleteURLFetch(net::OK, 503, retry_after); ASSERT_TRUE(is_state_idle()); @@ -495,7 +495,7 @@ TEST_F(NetworkPortalDetectorImplTest, ProxyAuthRequired) { kStubWireless1); // To run CaptivePortalDetector::DetectCaptivePortal(). - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CompleteURLFetch(net::OK, 407, NULL); ASSERT_EQ(2, attempt_count()); @@ -504,7 +504,7 @@ TEST_F(NetworkPortalDetectorImplTest, ProxyAuthRequired) { kStubWireless1); // To run CaptivePortalDetector::DetectCaptivePortal(). - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CompleteURLFetch(net::OK, 407, NULL); ASSERT_EQ(3, attempt_count()); @@ -528,7 +528,7 @@ TEST_F(NetworkPortalDetectorImplTest, NoResponseButBehindPortal) { ASSERT_TRUE(is_state_portal_detection_pending()); // To run CaptivePortalDetector::DetectCaptivePortal(). - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CompleteURLFetch(net::ERR_CONNECTION_CLOSED, net::URLFetcher::RESPONSE_CODE_INVALID, @@ -537,7 +537,7 @@ TEST_F(NetworkPortalDetectorImplTest, NoResponseButBehindPortal) { ASSERT_TRUE(is_state_portal_detection_pending()); // To run CaptivePortalDetector::DetectCaptivePortal(). - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CompleteURLFetch(net::ERR_CONNECTION_CLOSED, net::URLFetcher::RESPONSE_CODE_INVALID, @@ -566,7 +566,7 @@ TEST_F(NetworkPortalDetectorImplTest, LazyDetectionForOnlineNetwork) { kStubWireless1); // To run CaptivePortalDetector::DetectCaptivePortal(). - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CompleteURLFetch(net::OK, 204, NULL); @@ -577,7 +577,7 @@ TEST_F(NetworkPortalDetectorImplTest, LazyDetectionForOnlineNetwork) { kStubWireless1); // To run CaptivePortalDetector::DetectCaptivePortal(). - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); disable_lazy_detection(); @@ -608,7 +608,7 @@ TEST_F(NetworkPortalDetectorImplTest, LazyDetectionForPortalNetwork) { kStubWireless1); // To run CaptivePortalDetector::DetectCaptivePortal(). - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CompleteURLFetch(net::ERR_CONNECTION_CLOSED, net::URLFetcher::RESPONSE_CODE_INVALID, @@ -619,7 +619,7 @@ TEST_F(NetworkPortalDetectorImplTest, LazyDetectionForPortalNetwork) { kStubWireless1); // To run CaptivePortalDetector::DetectCaptivePortal(). - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CompleteURLFetch(net::OK, 200, NULL); ASSERT_EQ(3, attempt_count()); @@ -628,7 +628,7 @@ TEST_F(NetworkPortalDetectorImplTest, LazyDetectionForPortalNetwork) { kStubWireless1); // To run CaptivePortalDetector::DetectCaptivePortal(). - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); disable_lazy_detection(); @@ -678,7 +678,7 @@ TEST_F(NetworkPortalDetectorImplTest, TestDetectionRestart) { ASSERT_TRUE(is_state_portal_detection_pending()); ASSERT_FALSE(start_detection_if_idle()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_TRUE(is_state_checking_for_portal()); CompleteURLFetch(net::OK, 200, NULL); @@ -701,13 +701,13 @@ TEST_F(NetworkPortalDetectorImplTest, RequestTimeouts) { // Second portal detection attempt for cellular1 uses 10sec timeout. ASSERT_TRUE(is_state_portal_detection_pending()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CheckRequestTimeoutAndCompleteAttempt(2, 10, net::ERR_CONNECTION_CLOSED, net::URLFetcher::RESPONSE_CODE_INVALID); // Third portal detection attempt for cellular1 uses 15sec timeout. ASSERT_TRUE(is_state_portal_detection_pending()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CheckRequestTimeoutAndCompleteAttempt(3, 15, net::ERR_CONNECTION_CLOSED, net::URLFetcher::RESPONSE_CODE_INVALID); @@ -716,7 +716,7 @@ TEST_F(NetworkPortalDetectorImplTest, RequestTimeouts) { // Check that in lazy detection for cellular1 15sec timeout is used. enable_lazy_detection(); ASSERT_TRUE(is_state_portal_detection_pending()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); disable_lazy_detection(); CheckRequestTimeoutAndCompleteAttempt(3, 15, net::ERR_CONNECTION_CLOSED, net::URLFetcher::RESPONSE_CODE_INVALID); @@ -731,14 +731,14 @@ TEST_F(NetworkPortalDetectorImplTest, RequestTimeouts) { // Second portal detection attempt for wifi1 also uses 5sec timeout. ASSERT_TRUE(is_state_portal_detection_pending()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CheckRequestTimeoutAndCompleteAttempt(2, 10, net::OK, 204); ASSERT_TRUE(is_state_idle()); // Check that in lazy detection for wifi1 5sec timeout is used. enable_lazy_detection(); ASSERT_TRUE(is_state_portal_detection_pending()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); disable_lazy_detection(); CheckRequestTimeoutAndCompleteAttempt(3, 15, net::OK, 204); ASSERT_TRUE(is_state_idle()); @@ -753,13 +753,13 @@ TEST_F(NetworkPortalDetectorImplTest, StartDetectionIfIdle) { CheckRequestTimeoutAndCompleteAttempt(1, 5, net::ERR_CONNECTION_CLOSED, net::URLFetcher::RESPONSE_CODE_INVALID); ASSERT_TRUE(is_state_portal_detection_pending()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Second portal detection attempt for wifi1 uses 10sec timeout. CheckRequestTimeoutAndCompleteAttempt(2, 10, net::ERR_CONNECTION_CLOSED, net::URLFetcher::RESPONSE_CODE_INVALID); ASSERT_TRUE(is_state_portal_detection_pending()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Second portal detection attempt for wifi1 uses 15sec timeout. CheckRequestTimeoutAndCompleteAttempt(3, 15, net::ERR_CONNECTION_CLOSED, @@ -770,7 +770,7 @@ TEST_F(NetworkPortalDetectorImplTest, StartDetectionIfIdle) { ASSERT_TRUE(is_state_portal_detection_pending()); // First portal detection attempt for wifi1 uses 5sec timeout. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); CheckRequestTimeoutAndCompleteAttempt(1, 5, net::OK, 204); ASSERT_TRUE(is_state_idle()); } diff --git a/chrome/browser/chromeos/offline/offline_load_page_unittest.cc b/chrome/browser/chromeos/offline/offline_load_page_unittest.cc index 19c8518..db56c59 100644 --- a/chrome/browser/chromeos/offline/offline_load_page_unittest.cc +++ b/chrome/browser/chromeos/offline/offline_load_page_unittest.cc @@ -53,10 +53,10 @@ class OfflineLoadPageTest : public ChromeRenderViewHostTestHarness { }; OfflineLoadPageTest() - : ui_thread_(BrowserThread::UI, MessageLoop::current()), + : ui_thread_(BrowserThread::UI, base::MessageLoop::current()), file_user_blocking_thread_( - BrowserThread::FILE_USER_BLOCKING, MessageLoop::current()), - io_thread_(BrowserThread::IO, MessageLoop::current()) { + BrowserThread::FILE_USER_BLOCKING, base::MessageLoop::current()), + io_thread_(BrowserThread::IO, base::MessageLoop::current()) { } virtual void SetUp() { @@ -117,11 +117,11 @@ TEST_F(OfflineLoadPageTest, OfflinePageProceed) { ShowInterstitial(kURL2); InterstitialPage* interstitial = GetOfflineLoadPage(); ASSERT_TRUE(interstitial); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Simulate the user clicking "proceed". interstitial->Proceed(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(OK, user_response()); @@ -144,7 +144,7 @@ TEST_F(OfflineLoadPageTest, OfflinePageDontProceed) { ShowInterstitial(kURL2); InterstitialPage* interstitial = GetOfflineLoadPage(); ASSERT_TRUE(interstitial); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Simulate the user clicking "don't proceed". interstitial->DontProceed(); diff --git a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc index f6de0a4..74e3203 100644 --- a/chrome/browser/chromeos/policy/device_local_account_browsertest.cc +++ b/chrome/browser/chromeos/policy/device_local_account_browsertest.cc @@ -172,8 +172,8 @@ class DeviceLocalAccountTest : public InProcessBrowserTest { virtual void CleanUpOnMainThread() OVERRIDE { // This shuts down the login UI. - MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&chrome::AttemptExit)); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::Bind(&chrome::AttemptExit)); base::RunLoop().RunUntilIdle(); } diff --git a/chrome/browser/chromeos/policy/device_status_collector_browsertest.cc b/chrome/browser/chromeos/policy/device_status_collector_browsertest.cc index 7d23452..12af15e 100644 --- a/chrome/browser/chromeos/policy/device_status_collector_browsertest.cc +++ b/chrome/browser/chromeos/policy/device_status_collector_browsertest.cc @@ -140,7 +140,7 @@ namespace policy { class DeviceStatusCollectorTest : public testing::Test { public: DeviceStatusCollectorTest() - : message_loop_(MessageLoop::TYPE_UI), + : message_loop_(base::MessageLoop::TYPE_UI), ui_thread_(content::BrowserThread::UI, &message_loop_), file_thread_(content::BrowserThread::FILE, &message_loop_), io_thread_(content::BrowserThread::IO, &message_loop_) { @@ -236,7 +236,7 @@ class DeviceStatusCollectorTest : public testing::Test { return policy::DeviceStatusCollector::kIdlePollIntervalSeconds * 1000; } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc b/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc index b5c1dfc..9f74d3f 100644 --- a/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc +++ b/chrome/browser/chromeos/policy/enrollment_handler_chromeos.cc @@ -298,7 +298,7 @@ void EnrollmentHandlerChromeOS::HandleLockDeviceResult( // InstallAttributes not ready yet, retry later. LOG(WARNING) << "Install Attributes not ready yet will retry in " << kLockRetryIntervalMs << "ms."; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&EnrollmentHandlerChromeOS::StartLockDevice, weak_factory_.GetWeakPtr(), diff --git a/chrome/browser/chromeos/policy/enterprise_install_attributes_unittest.cc b/chrome/browser/chromeos/policy/enterprise_install_attributes_unittest.cc index fbc3ec9..a239ef5 100644 --- a/chrome/browser/chromeos/policy/enterprise_install_attributes_unittest.cc +++ b/chrome/browser/chromeos/policy/enterprise_install_attributes_unittest.cc @@ -57,7 +57,7 @@ class EnterpriseInstallAttributesTest : public testing::Test { attribute->set_value(value); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; base::ScopedTempDir temp_dir_; scoped_ptr<chromeos::CryptohomeLibrary> cryptohome_; scoped_ptr<chromeos::CryptohomeClient> stub_cryptohome_client_; diff --git a/chrome/browser/chromeos/policy/network_configuration_updater_impl_cros_unittest.cc b/chrome/browser/chromeos/policy/network_configuration_updater_impl_cros_unittest.cc index ccde105..f2608c9 100644 --- a/chrome/browser/chromeos/policy/network_configuration_updater_impl_cros_unittest.cc +++ b/chrome/browser/chromeos/policy/network_configuration_updater_impl_cros_unittest.cc @@ -145,7 +145,7 @@ class NetworkConfigurationUpdaterTest : public testing::Test { StrictMock<chromeos::MockNetworkLibrary> network_library_; StrictMock<MockConfigurationPolicyProvider> provider_; scoped_ptr<PolicyServiceImpl> policy_service_; - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; }; diff --git a/chrome/browser/chromeos/policy/policy_cert_verifier_browsertest.cc b/chrome/browser/chromeos/policy/policy_cert_verifier_browsertest.cc index c39c460..fd440cf 100644 --- a/chrome/browser/chromeos/policy/policy_cert_verifier_browsertest.cc +++ b/chrome/browser/chromeos/policy/policy_cert_verifier_browsertest.cc @@ -93,7 +93,7 @@ class PolicyCertVerifierTest : public testing::Test { protected: crypto::ScopedTestNSSDB test_nssdb_; net::NSSCertDatabase* cert_db_; - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; TestingProfileManager profile_manager_; diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc index cde6337..5613959 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc +++ b/chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos_unittest.cc @@ -261,7 +261,7 @@ class UserCloudPolicyManagerChromeOSTest : public testing::Test { } // Required by the refresh scheduler that's created by the manager. - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; // Required to cleanup the URLRequestContextGetter of the |signin_profile_|. content::TestBrowserThread io_thread_; diff --git a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc index 7dc25de..9cb2b9c 100644 --- a/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc +++ b/chrome/browser/chromeos/policy/user_cloud_policy_store_chromeos_unittest.cc @@ -45,14 +45,14 @@ const char kSanitizedUsername[] = "0123456789ABCDEF0123456789ABCDEF012345678"; const char kDefaultHomepage[] = "http://chromium.org"; ACTION_P2(SendSanitizedUsername, call_status, sanitized_username) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(arg1, call_status, sanitized_username)); } class UserCloudPolicyStoreChromeOSTest : public testing::Test { protected: UserCloudPolicyStoreChromeOSTest() - : loop_(MessageLoop::TYPE_UI), + : loop_(base::MessageLoop::TYPE_UI), ui_thread_(content::BrowserThread::UI, &loop_), file_thread_(content::BrowserThread::FILE, &loop_) {} @@ -222,7 +222,7 @@ class UserCloudPolicyStoreChromeOSTest : public testing::Test { return tmp_dir_.path().AppendASCII("policy"); } - MessageLoop loop_; + base::MessageLoop loop_; chromeos::MockCryptohomeClient cryptohome_client_; chromeos::MockSessionManagerClient session_manager_client_; UserPolicyBuilder policy_; diff --git a/chrome/browser/chromeos/power/suspend_observer.cc b/chrome/browser/chromeos/power/suspend_observer.cc index fb6b85f..fd7eb21 100644 --- a/chrome/browser/chromeos/power/suspend_observer.cc +++ b/chrome/browser/chromeos/power/suspend_observer.cc @@ -57,7 +57,7 @@ void SuspendObserver::ScreenIsLocked() { // Run the callback asynchronously. ScreenIsLocked() is currently // called asynchronously after RequestLockScreen(), but this guards // against it being made synchronous later. - MessageLoop::current()->PostTask(FROM_HERE, screen_lock_callback_); + base::MessageLoop::current()->PostTask(FROM_HERE, screen_lock_callback_); screen_lock_callback_.Reset(); } else { LOG(WARNING) << "Locking screen without suspend."; diff --git a/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc b/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc index 614c8c7..660e195 100644 --- a/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc +++ b/chrome/browser/chromeos/proxy_config_service_impl_unittest.cc @@ -323,7 +323,7 @@ class ProxyConfigServiceImplTestBase : public TESTBASE { return proxy_config_service_->GetLatestProxyConfig(config); } - MessageLoop loop_; + base::MessageLoop loop_; scoped_ptr<ChromeProxyConfigService> proxy_config_service_; scoped_ptr<ProxyConfigServiceImpl> config_service_impl_; diff --git a/chrome/browser/chromeos/screensaver/screensaver_controller_browsertest.cc b/chrome/browser/chromeos/screensaver/screensaver_controller_browsertest.cc index a763b34..c9e547a 100644 --- a/chrome/browser/chromeos/screensaver/screensaver_controller_browsertest.cc +++ b/chrome/browser/chromeos/screensaver/screensaver_controller_browsertest.cc @@ -56,7 +56,7 @@ IN_PROC_BROWSER_TEST_F(ScreensaverControllerTest, Basic) { scoped_ptr<ScreensaverController> controller_; controller_.reset(new ScreensaverController()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Trigger idle. controller_->IdleNotify(0); @@ -74,7 +74,7 @@ IN_PROC_BROWSER_TEST_F(ScreensaverControllerTest, OutOfOrder) { scoped_ptr<ScreensaverController> controller_; controller_.reset(new ScreensaverController()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Trigger active. controller_->OnUserActivity(); diff --git a/chrome/browser/chromeos/settings/cros_settings_unittest.cc b/chrome/browser/chromeos/settings/cros_settings_unittest.cc index b119c98..49430a8 100644 --- a/chrome/browser/chromeos/settings/cros_settings_unittest.cc +++ b/chrome/browser/chromeos/settings/cros_settings_unittest.cc @@ -30,7 +30,7 @@ namespace chromeos { class CrosSettingsTest : public testing::Test { protected: CrosSettingsTest() - : message_loop_(MessageLoop::TYPE_UI), + : message_loop_(base::MessageLoop::TYPE_UI), ui_thread_(content::BrowserThread::UI, &message_loop_), local_state_(TestingBrowserProcess::GetGlobal()), settings_(DeviceSettingsService::Get()), @@ -89,7 +89,7 @@ class CrosSettingsTest : public testing::Test { response.set_policy_data_signature("false"); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; ScopedTestingLocalState local_state_; diff --git a/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc b/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc index c1b49da..6424ccb 100644 --- a/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc +++ b/chrome/browser/chromeos/settings/device_oauth2_token_service_unittest.cc @@ -37,7 +37,7 @@ class DeviceOAuth2TokenServiceTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; ScopedTestingLocalState scoped_testing_local_state_; }; diff --git a/chrome/browser/chromeos/settings/device_settings_service.cc b/chrome/browser/chromeos/settings/device_settings_service.cc index 6058e08..814df79 100644 --- a/chrome/browser/chromeos/settings/device_settings_service.cc +++ b/chrome/browser/chromeos/settings/device_settings_service.cc @@ -150,7 +150,7 @@ void DeviceSettingsService::GetOwnershipStatusAsync( const OwnershipStatusCallback& callback) { if (owner_key_.get()) { // If there is a key, report status immediately. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, owner_key_->public_key() ? OWNERSHIP_TAKEN : OWNERSHIP_NONE, diff --git a/chrome/browser/chromeos/settings/device_settings_test_helper.cc b/chrome/browser/chromeos/settings/device_settings_test_helper.cc index bcce8ce..508de87 100644 --- a/chrome/browser/chromeos/settings/device_settings_test_helper.cc +++ b/chrome/browser/chromeos/settings/device_settings_test_helper.cc @@ -23,10 +23,10 @@ void DeviceSettingsTestHelper::FlushLoops() { // between the message loop and the blocking pool. 2 iterations are currently // sufficient (key loading, signing). for (int i = 0; i < 2; ++i) { - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); content::BrowserThread::GetBlockingPool()->FlushForTesting(); } - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } void DeviceSettingsTestHelper::FlushStore() { @@ -186,7 +186,7 @@ ScopedDeviceSettingsTestHelper::~ScopedDeviceSettingsTestHelper() { } DeviceSettingsTestBase::DeviceSettingsTestBase() - : loop_(MessageLoop::TYPE_UI), + : loop_(base::MessageLoop::TYPE_UI), ui_thread_(content::BrowserThread::UI, &loop_), file_thread_(content::BrowserThread::FILE, &loop_), owner_key_util_(new MockOwnerKeyUtil()) {} diff --git a/chrome/browser/chromeos/settings/device_settings_test_helper.h b/chrome/browser/chromeos/settings/device_settings_test_helper.h index 0878c21..b6e0ab1 100644 --- a/chrome/browser/chromeos/settings/device_settings_test_helper.h +++ b/chrome/browser/chromeos/settings/device_settings_test_helper.h @@ -164,7 +164,7 @@ class DeviceSettingsTestBase : public testing::Test { // |device_settings_service_| and flushes the resulting load operation. void ReloadDeviceSettings(); - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/chromeos/settings/session_manager_operation_unittest.cc b/chrome/browser/chromeos/settings/session_manager_operation_unittest.cc index fa580ff..e2f1a44 100644 --- a/chrome/browser/chromeos/settings/session_manager_operation_unittest.cc +++ b/chrome/browser/chromeos/settings/session_manager_operation_unittest.cc @@ -73,7 +73,7 @@ class SessionManagerOperationTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/chromeos/system_key_event_listener.cc b/chrome/browser/chromeos/system_key_event_listener.cc index ebc81a6..685b0af 100644 --- a/chrome/browser/chromeos/system_key_event_listener.cc +++ b/chrome/browser/chromeos/system_key_event_listener.cc @@ -69,7 +69,7 @@ SystemKeyEventListener::SystemKeyEventListener() LOG(WARNING) << "Could not install Xkb Indicator observer"; } - MessageLoopForUI::current()->AddObserver(this); + base::MessageLoopForUI::current()->AddObserver(this); } SystemKeyEventListener::~SystemKeyEventListener() { @@ -79,7 +79,7 @@ SystemKeyEventListener::~SystemKeyEventListener() { void SystemKeyEventListener::Stop() { if (stopped_) return; - MessageLoopForUI::current()->RemoveObserver(this); + base::MessageLoopForUI::current()->RemoveObserver(this); stopped_ = true; } diff --git a/chrome/browser/chromeos/system_key_event_listener.h b/chrome/browser/chromeos/system_key_event_listener.h index 11654e1..0e811c9 100644 --- a/chrome/browser/chromeos/system_key_event_listener.h +++ b/chrome/browser/chromeos/system_key_event_listener.h @@ -12,7 +12,7 @@ typedef union _XEvent XEvent; namespace chromeos { -class SystemKeyEventListener : public MessageLoopForUI::Observer { +class SystemKeyEventListener : public base::MessageLoopForUI::Observer { public: // Observer for caps lock state changes. class CapsLockObserver { diff --git a/chrome/browser/chromeos/web_socket_proxy.cc b/chrome/browser/chromeos/web_socket_proxy.cc index 6131c73..bdfa418 100644 --- a/chrome/browser/chromeos/web_socket_proxy.cc +++ b/chrome/browser/chromeos/web_socket_proxy.cc @@ -437,7 +437,7 @@ class Conn { DISALLOW_COPY_AND_ASSIGN(Conn); }; -class SSLChan : public MessageLoopForIO::Watcher { +class SSLChan : public base::MessageLoopForIO::Watcher { public: static void Start(const net::AddressList& address_list, const net::HostPortPair& host_port_pair, @@ -585,7 +585,7 @@ class SSLChan : public MessageLoopForIO::Watcher { }; for (int i = arraysize(buf); i--;) { if (buf[i] && buf[i]->size() > 0) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&SSLChan::Proceed, weak_factory_.GetWeakPtr())); return; @@ -596,7 +596,7 @@ class SSLChan : public MessageLoopForIO::Watcher { socket_->Disconnect(); socket_.reset(); } - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } } @@ -639,11 +639,11 @@ class SSLChan : public MessageLoopForIO::Watcher { is_socket_write_pending_ = false; is_read_pipe_blocked_ = false; is_write_pipe_blocked_ = false; - MessageLoopForIO::current()->WatchFileDescriptor( - read_pipe_, false, MessageLoopForIO::WATCH_READ, + base::MessageLoopForIO::current()->WatchFileDescriptor( + read_pipe_, false, base::MessageLoopForIO::WATCH_READ, &read_pipe_controller_, this); - MessageLoopForIO::current()->WatchFileDescriptor( - write_pipe_, false, MessageLoopForIO::WATCH_WRITE, + base::MessageLoopForIO::current()->WatchFileDescriptor( + write_pipe_, false, base::MessageLoopForIO::WATCH_WRITE, &write_pipe_controller_, this); phase_ = PHASE_RUNNING; Proceed(); @@ -707,8 +707,8 @@ class SSLChan : public MessageLoopForIO::Watcher { proceed = true; } else if (rv == -1 && errno == EAGAIN) { is_read_pipe_blocked_ = true; - MessageLoopForIO::current()->WatchFileDescriptor( - read_pipe_, false, MessageLoopForIO::WATCH_READ, + base::MessageLoopForIO::current()->WatchFileDescriptor( + read_pipe_, false, base::MessageLoopForIO::WATCH_READ, &read_pipe_controller_, this); } else if (rv == 0) { Shut(0); @@ -728,7 +728,7 @@ class SSLChan : public MessageLoopForIO::Watcher { base::Bind(&SSLChan::OnSocketRead, base::Unretained(this))); is_socket_read_pending_ = true; if (rv != net::ERR_IO_PENDING) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&SSLChan::OnSocketRead, weak_factory_.GetWeakPtr(), rv)); } @@ -743,7 +743,7 @@ class SSLChan : public MessageLoopForIO::Watcher { base::Bind(&SSLChan::OnSocketWrite, base::Unretained(this))); is_socket_write_pending_ = true; if (rv != net::ERR_IO_PENDING) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&SSLChan::OnSocketWrite, weak_factory_.GetWeakPtr(), rv)); } @@ -761,8 +761,8 @@ class SSLChan : public MessageLoopForIO::Watcher { proceed = true; } else if (rv == -1 && errno == EAGAIN) { is_write_pipe_blocked_ = true; - MessageLoopForIO::current()->WatchFileDescriptor( - write_pipe_, false, MessageLoopForIO::WATCH_WRITE, + base::MessageLoopForIO::current()->WatchFileDescriptor( + write_pipe_, false, base::MessageLoopForIO::WATCH_WRITE, &write_pipe_controller_, this); } else { DCHECK_LE(rv, 0); @@ -791,8 +791,8 @@ class SSLChan : public MessageLoopForIO::Watcher { bool is_read_pipe_blocked_; bool is_write_pipe_blocked_; base::WeakPtrFactory<SSLChan> weak_factory_; - MessageLoopForIO::FileDescriptorWatcher read_pipe_controller_; - MessageLoopForIO::FileDescriptorWatcher write_pipe_controller_; + base::MessageLoopForIO::FileDescriptorWatcher read_pipe_controller_; + base::MessageLoopForIO::FileDescriptorWatcher write_pipe_controller_; friend class base::DeleteHelper<SSLChan>; DISALLOW_COPY_AND_ASSIGN(SSLChan); diff --git a/chrome/browser/chromeos/web_socket_proxy_controller.cc b/chrome/browser/chromeos/web_socket_proxy_controller.cc index 4bcf211..4cc3c28 100644 --- a/chrome/browser/chromeos/web_socket_proxy_controller.cc +++ b/chrome/browser/chromeos/web_socket_proxy_controller.cc @@ -41,7 +41,7 @@ class ProxyLifetime shutdown_requested_(false), web_socket_proxy_thread_("Chrome_WebSocketproxyThread") { DLOG(INFO) << "WebSocketProxyController initiation"; - base::Thread::Options options(MessageLoop::TYPE_IO, 0); + base::Thread::Options options(base::MessageLoop::TYPE_IO, 0); web_socket_proxy_thread_.StartWithOptions(options); web_socket_proxy_thread_.message_loop()->PostTask( FROM_HERE, @@ -98,7 +98,7 @@ class ProxyLifetime if (delay_ms_ < 100 * 1000) (delay_ms_ *= 3) /= 2; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ProxyLifetime::ProxyCallback, base::Unretained(this)), base::TimeDelta::FromMilliseconds(delay_ms_)); diff --git a/chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h b/chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h index 64b76db..99e9af4 100644 --- a/chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h +++ b/chrome/browser/chromeos/xinput_hierarchy_changed_event_listener.h @@ -18,7 +18,8 @@ namespace chromeos { // which is sent to Chrome when X detects a system or USB keyboard (or mouse), // then tells X to change the current XKB keyboard layout. Start by just calling // instance() to get it going. -class XInputHierarchyChangedEventListener : public MessageLoopForUI::Observer { +class XInputHierarchyChangedEventListener + : public base::MessageLoopForUI::Observer { public: static XInputHierarchyChangedEventListener* GetInstance(); diff --git a/chrome/browser/chromeos/xinput_hierarchy_changed_event_listener_aura.cc b/chrome/browser/chromeos/xinput_hierarchy_changed_event_listener_aura.cc index 1641348..3d2c2da 100644 --- a/chrome/browser/chromeos/xinput_hierarchy_changed_event_listener_aura.cc +++ b/chrome/browser/chromeos/xinput_hierarchy_changed_event_listener_aura.cc @@ -7,11 +7,11 @@ namespace chromeos { void XInputHierarchyChangedEventListener::Init() { - MessageLoopForUI::current()->AddObserver(this); + base::MessageLoopForUI::current()->AddObserver(this); } void XInputHierarchyChangedEventListener::StopImpl() { - MessageLoopForUI::current()->RemoveObserver(this); + base::MessageLoopForUI::current()->RemoveObserver(this); } base::EventStatus XInputHierarchyChangedEventListener::WillProcessEvent( diff --git a/chrome/browser/common/cancelable_request.cc b/chrome/browser/common/cancelable_request.cc index 39fb29a..dbcb314 100644 --- a/chrome/browser/common/cancelable_request.cc +++ b/chrome/browser/common/cancelable_request.cc @@ -93,7 +93,7 @@ CancelableRequestBase::CancelableRequestBase() : provider_(NULL), consumer_(NULL), handle_(0) { - callback_thread_ = MessageLoop::current(); + callback_thread_ = base::MessageLoop::current(); } CancelableRequestBase::~CancelableRequestBase() { @@ -110,7 +110,7 @@ void CancelableRequestBase::Init(CancelableRequestProvider* provider, void CancelableRequestBase::DoForward(const base::Closure& forwarded_call, bool force_async) { - if (force_async || callback_thread_ != MessageLoop::current()) { + if (force_async || callback_thread_ != base::MessageLoop::current()) { callback_thread_->PostTask( FROM_HERE, base::Bind(&CancelableRequestBase::ExecuteCallback, this, @@ -123,7 +123,7 @@ void CancelableRequestBase::DoForward(const base::Closure& forwarded_call, void CancelableRequestBase::ExecuteCallback( const base::Closure& forwarded_call) { - DCHECK_EQ(callback_thread_, MessageLoop::current()); + DCHECK_EQ(callback_thread_, base::MessageLoop::current()); if (!canceled_.IsSet()) { WillExecute(); diff --git a/chrome/browser/common/cancelable_request.h b/chrome/browser/common/cancelable_request.h index a43e60b..f1c4c208 100644 --- a/chrome/browser/common/cancelable_request.h +++ b/chrome/browser/common/cancelable_request.h @@ -587,7 +587,7 @@ class CancelableRequestBase // The message loop that this request was created on. The callback will // happen on the same thread. - MessageLoop* callback_thread_; + base::MessageLoop* callback_thread_; // The provider for this request. When we execute, we will notify this that // request is complete to it can remove us from the requests it tracks. @@ -670,7 +670,7 @@ class CancelableRequest : public CancelableRequestBase { void ForwardResult(const TupleType& param) { DCHECK(callback_.get()); if (!canceled()) { - if (callback_thread_ == MessageLoop::current()) { + if (callback_thread_ == base::MessageLoop::current()) { // We can do synchronous callbacks when we're on the same thread. ExecuteCallback(param); } else { diff --git a/chrome/browser/component_updater/test/component_installers_unittest.cc b/chrome/browser/component_updater/test/component_installers_unittest.cc index c3abab10..91b59bb 100644 --- a/chrome/browser/component_updater/test/component_installers_unittest.cc +++ b/chrome/browser/component_updater/test/component_installers_unittest.cc @@ -52,7 +52,7 @@ const base::FilePath::CharType kDataPath[] = // TODO(viettrungluu): Separate out into two separate tests; use a test fixture. TEST(ComponentInstallerTest, MAYBE_PepperFlashCheck) { - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); ppapi::PpapiGlobals::PerThreadForTest per_thread_for_test; diff --git a/chrome/browser/component_updater/test/component_updater_service_unittest.cc b/chrome/browser/component_updater/test/component_updater_service_unittest.cc index 2677c9c..a7359fb 100644 --- a/chrome/browser/component_updater/test/component_updater_service_unittest.cc +++ b/chrome/browser/component_updater/test/component_updater_service_unittest.cc @@ -49,7 +49,7 @@ class TestConfigurator : public ComponentUpdateService::Configurator { // time to break from the test messageloop Run() method so the test can // finish. if (--times_ <= 0) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); return 0; } @@ -271,7 +271,7 @@ TEST_F(ComponentUpdaterTest, VerifyFixture) { // start-shutdown situation. Failure of this test will be a crash. Also // if there is no work to do, there are no notifications generated. TEST_F(ComponentUpdaterTest, StartStop) { - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); component_updater()->Start(); @@ -285,7 +285,7 @@ TEST_F(ComponentUpdaterTest, StartStop) { // the COMPONENT_UPDATER_STARTED and COMPONENT_UPDATER_SLEEPING notifications // are generated. TEST_F(ComponentUpdaterTest, CheckCrxSleep) { - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); content::TestBrowserThread file_thread(BrowserThread::FILE); content::TestBrowserThread io_thread(BrowserThread::IO); @@ -364,7 +364,7 @@ TEST_F(ComponentUpdaterTest, CheckCrxSleep) { // 2- download crx // 3- second manifest check. TEST_F(ComponentUpdaterTest, InstallCrx) { - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); content::TestBrowserThread file_thread(BrowserThread::FILE); content::TestBrowserThread io_thread(BrowserThread::IO); @@ -429,7 +429,7 @@ TEST_F(ComponentUpdaterTest, InstallCrx) { // has a different source. In this case there would be two manifest // checks to different urls, each only containing one component. TEST_F(ComponentUpdaterTest, InstallCrxTwoSources) { - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); content::TestBrowserThread file_thread(BrowserThread::FILE); content::TestBrowserThread io_thread(BrowserThread::IO); @@ -501,7 +501,7 @@ TEST_F(ComponentUpdaterTest, InstallCrxTwoSources) { // particular there should not be an install because the minimum product // version is much higher than of chrome. TEST_F(ComponentUpdaterTest, ProdVersionCheck) { - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); content::TestBrowserThread file_thread(BrowserThread::FILE); content::TestBrowserThread io_thread(BrowserThread::IO); @@ -541,7 +541,7 @@ TEST_F(ComponentUpdaterTest, ProdVersionCheck) { // - We ping. // - This triggers a second loop, which has a reply that triggers an install. TEST_F(ComponentUpdaterTest, CheckForUpdateSoon) { - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); content::TestBrowserThread file_thread(BrowserThread::FILE); content::TestBrowserThread io_thread(BrowserThread::IO); @@ -657,7 +657,7 @@ TEST_F(ComponentUpdaterTest, CheckForUpdateSoon) { // Verify that a previously registered component can get re-registered // with a different version. TEST_F(ComponentUpdaterTest, CheckReRegistration) { - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); content::TestBrowserThread file_thread(BrowserThread::FILE); content::TestBrowserThread io_thread(BrowserThread::IO); diff --git a/chrome/browser/content_settings/content_settings_default_provider_unittest.cc b/chrome/browser/content_settings/content_settings_default_provider_unittest.cc index f5404be..cfd7448 100644 --- a/chrome/browser/content_settings/content_settings_default_provider_unittest.cc +++ b/chrome/browser/content_settings/content_settings_default_provider_unittest.cc @@ -29,7 +29,7 @@ class DefaultProviderTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; TestingProfile profile_; content_settings::DefaultProvider provider_; diff --git a/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc b/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc index 37b718c..ca4ab11 100644 --- a/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc +++ b/chrome/browser/content_settings/content_settings_policy_provider_unittest.cc @@ -41,7 +41,7 @@ class PolicyProviderTest : public testing::Test { // from NonThreadSafe and to use native thread identifiers instead of // BrowserThread IDs. Then we could get rid of the message_loop and ui_thread // fields. - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; }; diff --git a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc index 656d517..6572f11 100644 --- a/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc +++ b/chrome/browser/content_settings/content_settings_pref_provider_unittest.cc @@ -98,7 +98,7 @@ class PrefProviderTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; }; diff --git a/chrome/browser/content_settings/cookie_settings_unittest.cc b/chrome/browser/content_settings/cookie_settings_unittest.cc index a3a91ef..59d2d55 100644 --- a/chrome/browser/content_settings/cookie_settings_unittest.cc +++ b/chrome/browser/content_settings/cookie_settings_unittest.cc @@ -35,7 +35,7 @@ class CookieSettingsTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; TestingProfile profile_; CookieSettings* cookie_settings_; diff --git a/chrome/browser/content_settings/host_content_settings_map_unittest.cc b/chrome/browser/content_settings/host_content_settings_map_unittest.cc index bba4336..ed4f55d 100644 --- a/chrome/browser/content_settings/host_content_settings_map_unittest.cc +++ b/chrome/browser/content_settings/host_content_settings_map_unittest.cc @@ -33,7 +33,7 @@ class HostContentSettingsMapTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; }; diff --git a/chrome/browser/crash_handler_host_linux.cc b/chrome/browser/crash_handler_host_linux.cc index 9298ebb..a2393bd 100644 --- a/chrome/browser/crash_handler_host_linux.cc +++ b/chrome/browser/crash_handler_host_linux.cc @@ -99,10 +99,10 @@ CrashHandlerHostLinux::~CrashHandlerHostLinux() { } void CrashHandlerHostLinux::Init() { - MessageLoopForIO* ml = MessageLoopForIO::current(); + base::MessageLoopForIO* ml = base::MessageLoopForIO::current(); CHECK(ml->WatchFileDescriptor( browser_socket_, true /* persistent */, - MessageLoopForIO::WATCH_READ, + base::MessageLoopForIO::WATCH_READ, &file_descriptor_watcher_, this)); ml->AddDestructionObserver(this); } diff --git a/chrome/browser/crash_handler_host_linux.h b/chrome/browser/crash_handler_host_linux.h index f0db83e..bcd9dd7 100644 --- a/chrome/browser/crash_handler_host_linux.h +++ b/chrome/browser/crash_handler_host_linux.h @@ -34,8 +34,8 @@ template <typename T> struct DefaultSingletonTraits; // Processes signal that they need to be dumped by sending a datagram over a // UNIX domain socket. All processes of the same type share the client end of // this socket which is installed in their descriptor table before exec. -class CrashHandlerHostLinux : public MessageLoopForIO::Watcher, - public MessageLoop::DestructionObserver { +class CrashHandlerHostLinux : public base::MessageLoopForIO::Watcher, + public base::MessageLoop::DestructionObserver { public: // Get the file descriptor which processes should be given in order to signal // crashes to the browser. @@ -87,7 +87,7 @@ class CrashHandlerHostLinux : public MessageLoopForIO::Watcher, int browser_socket_; #if defined(USE_LINUX_BREAKPAD) - MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; + base::MessageLoopForIO::FileDescriptorWatcher file_descriptor_watcher_; scoped_ptr<base::Thread> uploader_thread_; bool shutting_down_; #endif diff --git a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc index db486c2..d29c0c0 100644 --- a/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc +++ b/chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc @@ -51,7 +51,7 @@ void AssertIntercepted( base::Bind(AssertInterceptedIO, url, base::Unretained(interceptor))); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } // FakeURLRequestJobFactory returns NULL for all job creation requests and false @@ -100,7 +100,7 @@ void AssertWillHandle( scheme, expected, base::Unretained(interceptor))); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } class FakeDelegate : public ProtocolHandlerRegistry::Delegate { @@ -178,7 +178,7 @@ class FakeClientObserver delegate_->FakeRegisterWithOS(worker_->protocol()); } if (state != ShellIntegration::STATE_PROCESSING) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } @@ -280,19 +280,19 @@ class QueryProtocolHandlerOnChange // guarantee all messages are processed.) By overriding the IsType method // we basically ignore the supplied message loop type, and instead infer // our type based on the current thread. GO DEPENDENCY INJECTION! -class TestMessageLoop : public MessageLoop { +class TestMessageLoop : public base::MessageLoop { public: - TestMessageLoop() : MessageLoop(MessageLoop::TYPE_DEFAULT) {} + TestMessageLoop() : base::MessageLoop(base::MessageLoop::TYPE_DEFAULT) {} virtual ~TestMessageLoop() {} - virtual bool IsType(MessageLoop::Type type) const OVERRIDE { + virtual bool IsType(base::MessageLoop::Type type) const OVERRIDE { switch (type) { - case MessageLoop::TYPE_UI: - return BrowserThread::CurrentlyOn(BrowserThread::UI); - case MessageLoop::TYPE_IO: - return BrowserThread::CurrentlyOn(BrowserThread::IO); - case MessageLoop::TYPE_DEFAULT: - return !BrowserThread::CurrentlyOn(BrowserThread::UI) && - !BrowserThread::CurrentlyOn(BrowserThread::IO); + case base::MessageLoop::TYPE_UI: + return BrowserThread::CurrentlyOn(BrowserThread::UI); + case base::MessageLoop::TYPE_IO: + return BrowserThread::CurrentlyOn(BrowserThread::IO); + case base::MessageLoop::TYPE_DEFAULT: + return !BrowserThread::CurrentlyOn(BrowserThread::UI) && + !BrowserThread::CurrentlyOn(BrowserThread::IO); } return false; } @@ -734,7 +734,7 @@ TEST_F(ProtocolHandlerRegistryTest, TestOSRegistration) { registry()->OnAcceptRegisterProtocolHandler(ph_do1); registry()->OnDenyRegisterProtocolHandler(ph_dont); - MessageLoop::current()->Run(); // FILE thread needs to run. + base::MessageLoop::current()->Run(); // FILE thread needs to run. ASSERT_TRUE(delegate()->IsFakeRegisteredWithOS("do")); ASSERT_FALSE(delegate()->IsFakeRegisteredWithOS("dont")); @@ -764,10 +764,10 @@ TEST_F(ProtocolHandlerRegistryTest, MAYBE_TestOSRegistrationFailure) { ASSERT_FALSE(registry()->IsHandledProtocol("dont")); registry()->OnAcceptRegisterProtocolHandler(ph_do); - MessageLoop::current()->Run(); // FILE thread needs to run. + base::MessageLoop::current()->Run(); // FILE thread needs to run. delegate()->set_force_os_failure(true); registry()->OnAcceptRegisterProtocolHandler(ph_dont); - MessageLoop::current()->Run(); // FILE thread needs to run. + base::MessageLoop::current()->Run(); // FILE thread needs to run. ASSERT_TRUE(registry()->IsHandledProtocol("do")); ASSERT_EQ(static_cast<size_t>(1), registry()->GetHandlersFor("do").size()); ASSERT_FALSE(registry()->IsHandledProtocol("dont")); diff --git a/chrome/browser/devtools/devtools_adb_bridge.cc b/chrome/browser/devtools/devtools_adb_bridge.cc index 4be00b3..fa5b881 100644 --- a/chrome/browser/devtools/devtools_adb_bridge.cc +++ b/chrome/browser/devtools/devtools_adb_bridge.cc @@ -578,7 +578,7 @@ DevToolsAdbBridge::RefCountedAdbThread::RefCountedAdbThread() { instance_ = this; thread_ = new base::Thread(kDevToolsAdbBridgeThreadName); base::Thread::Options options; - options.message_loop_type = MessageLoop::TYPE_IO; + options.message_loop_type = base::MessageLoop::TYPE_IO; if (!thread_->StartWithOptions(options)) { delete thread_; thread_ = NULL; diff --git a/chrome/browser/devtools/devtools_sanity_browsertest.cc b/chrome/browser/devtools/devtools_sanity_browsertest.cc index e143d81..d5b6889 100644 --- a/chrome/browser/devtools/devtools_sanity_browsertest.cc +++ b/chrome/browser/devtools/devtools_sanity_browsertest.cc @@ -70,7 +70,7 @@ class BrowserClosedObserver : public content::NotificationObserver { virtual void Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE { - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } private: @@ -171,7 +171,7 @@ class DevToolsSanityTest : public InProcessBrowserTest { void TimeoutCallback(const std::string& timeout_message) { FAIL() << timeout_message; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // Base class for DevTools tests that test devtools functionality for @@ -203,7 +203,7 @@ class DevToolsExtensionTest : public DevToolsSanityTest, content::NotificationService::AllSources()); base::CancelableClosure timeout( base::Bind(&TimeoutCallback, "Extension load timed out.")); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, timeout.callback(), base::TimeDelta::FromSeconds(4)); extensions::UnpackedInstaller::Create(service)->Load(path); content::RunMessageLoop(); @@ -226,7 +226,7 @@ class DevToolsExtensionTest : public DevToolsSanityTest, content::NotificationService::AllSources()); base::CancelableClosure timeout( base::Bind(&TimeoutCallback, "Extension host load timed out.")); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, timeout.callback(), base::TimeDelta::FromSeconds(4)); ExtensionProcessManager* manager = @@ -252,7 +252,7 @@ class DevToolsExtensionTest : public DevToolsSanityTest, switch (type) { case chrome::NOTIFICATION_EXTENSION_LOADED: case chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING: - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); break; default: NOTREACHED(); @@ -304,7 +304,7 @@ class WorkerDevToolsSanityTest : public InProcessBrowserTest { worker_data_->worker_route_id = route_id; WorkerService::GetInstance()->RemoveObserver(this); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); delete this; } scoped_refptr<WorkerData> worker_data_; @@ -324,7 +324,7 @@ class WorkerDevToolsSanityTest : public InProcessBrowserTest { ASSERT_EQ(worker_data_->worker_route_id, route_id); WorkerService::GetInstance()->RemoveObserver(this); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); delete this; } scoped_refptr<WorkerData> worker_data_; @@ -366,7 +366,7 @@ class WorkerDevToolsSanityTest : public InProcessBrowserTest { worker_data->worker_process_id = worker_info[0].process_id; worker_data->worker_route_id = worker_info[0].route_id; BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); return; } diff --git a/chrome/browser/download/chrome_download_manager_delegate_unittest.cc b/chrome/browser/download/chrome_download_manager_delegate_unittest.cc index abb3b98..0c58cd7 100644 --- a/chrome/browser/download/chrome_download_manager_delegate_unittest.cc +++ b/chrome/browser/download/chrome_download_manager_delegate_unittest.cc @@ -55,12 +55,12 @@ class MockWebContentsDelegate : public content::WebContentsDelegate { // EXPECT_CALL(mock_fooclass_instance, Foo(callback)) // .WillOnce(ScheduleCallback(false)); ACTION_P(ScheduleCallback, result) { - MessageLoop::current()->PostTask(FROM_HERE, base::Bind(arg0, result)); + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(arg0, result)); } // Similar to ScheduleCallback, but binds 2 arguments. ACTION_P2(ScheduleCallback2, result0, result1) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(arg0, result0, result1)); } @@ -101,8 +101,8 @@ class TestChromeDownloadManagerDelegate : public ChromeDownloadManagerDelegate { OVERRIDE { // Pretend the path reservation succeeded without any change to // |target_path|. - MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(callback, virtual_path, true)); + base::MessageLoop::current()->PostTask( + FROM_HERE, base::Bind(callback, virtual_path, true)); } virtual void PromptUserForDownloadPath( diff --git a/chrome/browser/download/download_browsertest.cc b/chrome/browser/download/download_browsertest.cc index 42e36970..ba0f098 100644 --- a/chrome/browser/download/download_browsertest.cc +++ b/chrome/browser/download/download_browsertest.cc @@ -123,7 +123,7 @@ class CreatedObserver : public content::DownloadManager::Observer { content::DownloadItem* item) OVERRIDE { DCHECK_EQ(manager_, manager); if (waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } content::DownloadManager* manager_; @@ -165,10 +165,10 @@ class PercentWaiter : public content::DownloadItem::Observer { (item_->PercentComplete() != 100)))) { error_ = true; if (waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } if (item_->GetState() == DownloadItem::COMPLETE && waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } virtual void OnDownloadDestroyed(content::DownloadItem* item) OVERRIDE { @@ -220,7 +220,7 @@ class DownloadsHistoryDataCollector { scoped_ptr<std::vector<history::DownloadRow> > entries) { result_valid_ = true; results_ = entries.Pass(); - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } Profile* profile_; @@ -246,7 +246,7 @@ class MockAbortExtensionInstallPrompt : public ExtensionInstallPrompt { const Extension* extension, const ShowDialogCallback& show_dialog_callback) OVERRIDE { delegate->InstallUIAbort(true); - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } virtual void OnInstallSuccess(const Extension* extension, @@ -349,7 +349,7 @@ class HistoryObserver : public DownloadHistory::Observer { seen_stored_ = true; if (waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } virtual void OnDownloadHistoryDestroyed() OVERRIDE { @@ -1007,7 +1007,7 @@ class DownloadTest : public InProcessBrowserTest { if (URLRequestSlowDownloadJob::NumberOutstandingRequests()) *result = false; BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, MessageLoop::QuitClosure()); + BrowserThread::UI, FROM_HERE, base::MessageLoop::QuitClosure()); } // Location of the test data. @@ -1186,8 +1186,8 @@ IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadResourceThrottleCancels) { ASSERT_TRUE(download_assempted); observer.WaitForObservation( base::Bind(&content::RunMessageLoop), - base::Bind(&MessageLoop::Quit, - base::Unretained(MessageLoopForUI::current()))); + base::Bind(&base::MessageLoop::Quit, + base::Unretained(base::MessageLoopForUI::current()))); // Check that we did not download the file. base::FilePath file(FILE_PATH_LITERAL("download-test1.lib")); diff --git a/chrome/browser/download/download_history_unittest.cc b/chrome/browser/download/download_history_unittest.cc index 63528cd..2c70a77 100644 --- a/chrome/browser/download/download_history_unittest.cc +++ b/chrome/browser/download/download_history_unittest.cc @@ -410,7 +410,7 @@ class DownloadHistoryTest : public testing::Test { } private: - MessageLoopForUI loop_; + base::MessageLoopForUI loop_; content::TestBrowserThread ui_thread_; std::vector<NiceMockDownloadItem*> items_; scoped_refptr<content::MockDownloadManager> manager_; diff --git a/chrome/browser/download/download_path_reservation_tracker_unittest.cc b/chrome/browser/download/download_path_reservation_tracker_unittest.cc index 0341cb0..5b11c8d 100644 --- a/chrome/browser/download/download_path_reservation_tracker_unittest.cc +++ b/chrome/browser/download/download_path_reservation_tracker_unittest.cc @@ -94,7 +94,7 @@ class DownloadPathReservationTrackerTest : public testing::Test { protected: base::ScopedTempDir test_download_dir_; base::FilePath default_download_path_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/download/download_shelf.cc b/chrome/browser/download/download_shelf.cc index c1c3b7f9..e9a9b32 100644 --- a/chrome/browser/download/download_shelf.cc +++ b/chrome/browser/download/download_shelf.cc @@ -44,7 +44,7 @@ void DownloadShelf::AddDownload(DownloadItem* download) { // If we are going to remove the download from the shelf upon completion, // wait a few seconds to see if it completes quickly. If it's a small // download, then the user won't have time to interact with it. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&DownloadShelf::ShowDownloadById, weak_ptr_factory_.GetWeakPtr(), diff --git a/chrome/browser/download/download_shelf_unittest.cc b/chrome/browser/download/download_shelf_unittest.cc index 21ca398..ad78008 100644 --- a/chrome/browser/download/download_shelf_unittest.cc +++ b/chrome/browser/download/download_shelf_unittest.cc @@ -40,7 +40,7 @@ class DownloadShelfTest : public testing::Test { private: scoped_ptr<content::MockDownloadItem> GetInProgressMockDownload(); - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_ptr<content::MockDownloadItem> download_item_; scoped_refptr<content::MockDownloadManager> download_manager_; diff --git a/chrome/browser/download/download_status_updater_unittest.cc b/chrome/browser/download/download_status_updater_unittest.cc index 367399b..dbe7c6d 100644 --- a/chrome/browser/download/download_status_updater_unittest.cc +++ b/chrome/browser/download/download_status_updater_unittest.cc @@ -188,7 +188,7 @@ class DownloadStatusUpdaterTest : public testing::Test { // object) can be deleted. // TODO(rdsmith): This can be removed when the DownloadManager // is no longer required to be deleted on the UI thread. - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; }; diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc index 98dfa31..6572846 100644 --- a/chrome/browser/download/download_target_determiner.cc +++ b/chrome/browser/download/download_target_determiner.cc @@ -460,7 +460,7 @@ void DownloadTargetDeterminer::ScheduleCallbackAndDeleteSelf() { << " Intermediate:" << intermediate_path_.AsUTF8Unsafe() << " Should prompt:" << should_prompt_ << " Danger type:" << danger_type_; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(completion_callback_, local_path_, diff --git a/chrome/browser/download/download_test_file_activity_observer.cc b/chrome/browser/download/download_test_file_activity_observer.cc index 0dca0d9..0a0835a 100644 --- a/chrome/browser/download/download_test_file_activity_observer.cc +++ b/chrome/browser/download/download_test_file_activity_observer.cc @@ -43,7 +43,7 @@ class DownloadTestFileActivityObserver::MockDownloadManagerDelegate const FileSelectedCallback& callback) OVERRIDE { file_chooser_displayed_ = true; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, (file_chooser_enabled_ ? suggested_path : base::FilePath()))); } diff --git a/chrome/browser/download/save_page_browsertest.cc b/chrome/browser/download/save_page_browsertest.cc index 47f6cc5..eff3068 100644 --- a/chrome/browser/download/save_page_browsertest.cc +++ b/chrome/browser/download/save_page_browsertest.cc @@ -89,7 +89,7 @@ class DownloadPersistedObserver : public DownloadHistory::Observer { const history::DownloadRow& info) OVERRIDE { persisted_ = filter_.Run(item, info); if (persisted_ && waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } private: @@ -129,7 +129,7 @@ class DownloadRemovedObserver : public DownloadPersistedObserver { virtual void OnDownloadsRemoved(const DownloadHistory::IdSet& ids) OVERRIDE { removed_ = ids.find(download_id_) != ids.end(); if (removed_ && waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } private: @@ -230,14 +230,14 @@ class DownloadItemCreatedObserver : public DownloadManager::Observer { items_seen_.push_back(item); if (waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } virtual void ManagerGoingDown(DownloadManager* manager) OVERRIDE { manager_->RemoveObserver(this); manager_ = NULL; if (waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } bool waiting_; diff --git a/chrome/browser/errorpage_browsertest.cc b/chrome/browser/errorpage_browsertest.cc index d87b5ac..5195a7e 100644 --- a/chrome/browser/errorpage_browsertest.cc +++ b/chrome/browser/errorpage_browsertest.cc @@ -109,8 +109,8 @@ class ErrorPageTest : public InProcessBrowserTest { } test_navigation_observer.WaitForObservation( base::Bind(&content::RunMessageLoop), - base::Bind(&MessageLoop::Quit, - base::Unretained(MessageLoopForUI::current()))); + base::Bind(&base::MessageLoop::Quit, + base::Unretained(base::MessageLoopForUI::current()))); EXPECT_EQ(title_watcher.WaitAndGetTitle(), ASCIIToUTF16(expected_title)); } diff --git a/chrome/browser/extensions/active_tab_unittest.cc b/chrome/browser/extensions/active_tab_unittest.cc index 4a244b4..9ca1052 100644 --- a/chrome/browser/extensions/active_tab_unittest.cc +++ b/chrome/browser/extensions/active_tab_unittest.cc @@ -59,7 +59,7 @@ class ActiveTabTest : public ChromeRenderViewHostTestHarness { : extension(CreateTestExtension("deadbeef", true)), another_extension(CreateTestExtension("feedbeef", true)), extension_without_active_tab(CreateTestExtension("badbeef", false)), - ui_thread_(BrowserThread::UI, MessageLoop::current()) {} + ui_thread_(BrowserThread::UI, base::MessageLoop::current()) {} protected: virtual void SetUp() OVERRIDE { diff --git a/chrome/browser/extensions/activity_log/activity_database_unittest.cc b/chrome/browser/extensions/activity_log/activity_database_unittest.cc index 4006d6e..4e62c13 100644 --- a/chrome/browser/extensions/activity_log/activity_database_unittest.cc +++ b/chrome/browser/extensions/activity_log/activity_database_unittest.cc @@ -39,9 +39,9 @@ namespace extensions { class ActivityDatabaseTest : public ChromeRenderViewHostTestHarness { public: ActivityDatabaseTest() - : ui_thread_(BrowserThread::UI, MessageLoop::current()), - db_thread_(BrowserThread::DB, MessageLoop::current()), - file_thread_(BrowserThread::FILE, MessageLoop::current()) {} + : ui_thread_(BrowserThread::UI, base::MessageLoop::current()), + db_thread_(BrowserThread::DB, base::MessageLoop::current()), + file_thread_(BrowserThread::FILE, base::MessageLoop::current()) {} virtual void SetUp() OVERRIDE { ChromeRenderViewHostTestHarness::SetUp(); @@ -56,8 +56,9 @@ class ActivityDatabaseTest : public ChromeRenderViewHostTestHarness { } virtual ~ActivityDatabaseTest() { - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); } protected: @@ -371,7 +372,7 @@ TEST_F(ActivityDatabaseTest, BatchModeOn) { // Artificially trigger and then stop the timer. activity_db->SetTimerForTesting(0); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); scoped_ptr<std::vector<scoped_refptr<Action> > > actions_after = activity_db->GetActions("punky", 0); diff --git a/chrome/browser/extensions/activity_log/activity_log_unittest.cc b/chrome/browser/extensions/activity_log/activity_log_unittest.cc index 62ab52a..f8898f5 100644 --- a/chrome/browser/extensions/activity_log/activity_log_unittest.cc +++ b/chrome/browser/extensions/activity_log/activity_log_unittest.cc @@ -29,9 +29,9 @@ namespace extensions { class ActivityLogTest : public ChromeRenderViewHostTestHarness { public: ActivityLogTest() - : ui_thread_(BrowserThread::UI, MessageLoop::current()), - db_thread_(BrowserThread::DB, MessageLoop::current()), - file_thread_(BrowserThread::FILE, MessageLoop::current()) {} + : ui_thread_(BrowserThread::UI, base::MessageLoop::current()), + db_thread_(BrowserThread::DB, base::MessageLoop::current()), + file_thread_(BrowserThread::FILE, base::MessageLoop::current()) {} virtual void SetUp() OVERRIDE { ChromeRenderViewHostTestHarness::SetUp(); @@ -49,8 +49,9 @@ class ActivityLogTest : public ChromeRenderViewHostTestHarness { } virtual ~ActivityLogTest() { - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); } static void RetrieveActions_LogAndFetchActions( diff --git a/chrome/browser/extensions/api/alarms/alarms_api_unittest.cc b/chrome/browser/extensions/api/alarms/alarms_api_unittest.cc index e90e3d3..fd8b7c6 100644 --- a/chrome/browser/extensions/api/alarms/alarms_api_unittest.cc +++ b/chrome/browser/extensions/api/alarms/alarms_api_unittest.cc @@ -36,7 +36,7 @@ class AlarmDelegate : public AlarmManager::Delegate { virtual void OnAlarm(const std::string& extension_id, const Alarm& alarm) OVERRIDE { alarms_seen.push_back(alarm.js_alarm->name); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } std::vector<std::string> alarms_seen; @@ -157,7 +157,7 @@ TEST_F(ExtensionAlarmsTest, Create) { // Now wait for the alarm to fire. Our test delegate will quit the // MessageLoop when that happens. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ASSERT_EQ(1u, alarm_delegate_->alarms_seen.size()); EXPECT_EQ("", alarm_delegate_->alarms_seen[0]); @@ -187,12 +187,12 @@ TEST_F(ExtensionAlarmsTest, CreateRepeating) { test_clock_->Advance(base::TimeDelta::FromSeconds(1)); // Now wait for the alarm to fire. Our test delegate will quit the // MessageLoop when that happens. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); test_clock_->Advance(base::TimeDelta::FromSeconds(1)); // Wait again, and ensure the alarm fires again. alarm_manager_->ScheduleNextPoll(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ASSERT_EQ(2u, alarm_delegate_->alarms_seen.size()); EXPECT_EQ("", alarm_delegate_->alarms_seen[0]); @@ -213,7 +213,7 @@ TEST_F(ExtensionAlarmsTest, CreateAbsolute) { test_clock_->SetNow(base::Time::FromDoubleT(10.1)); // Now wait for the alarm to fire. Our test delegate will quit the // MessageLoop when that happens. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ASSERT_FALSE(alarm_manager_->GetAlarm(extension_->id(), std::string())); @@ -236,13 +236,13 @@ TEST_F(ExtensionAlarmsTest, CreateRepeatingWithQuickFirstCall) { test_clock_->SetNow(base::Time::FromDoubleT(10.1)); // Now wait for the alarm to fire. Our test delegate will quit the // MessageLoop when that happens. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ASSERT_TRUE(alarm_manager_->GetAlarm(extension_->id(), std::string())); EXPECT_THAT(alarm_delegate_->alarms_seen, testing::ElementsAre("")); test_clock_->SetNow(base::Time::FromDoubleT(10.7)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ASSERT_TRUE(alarm_manager_->GetAlarm(extension_->id(), std::string())); EXPECT_THAT(alarm_delegate_->alarms_seen, testing::ElementsAre("", "")); @@ -372,7 +372,7 @@ TEST_F(ExtensionAlarmsTest, Clear) { // Now wait for the alarms to fire, and ensure the cancelled alarms don't // fire. alarm_manager_->ScheduleNextPoll(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ASSERT_EQ(1u, alarm_delegate_->alarms_seen.size()); EXPECT_EQ("", alarm_delegate_->alarms_seen[0]); @@ -457,7 +457,7 @@ TEST_F(ExtensionAlarmsSchedulingTest, PollScheduling) { alarm.js_alarm->scheduled_time = 3 * 60000; alarm.js_alarm->period_in_minutes.reset(new double(3)); alarm_manager_->AddAlarmImpl(extension_->id(), alarm); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(alarm_manager_->last_poll_time_ + base::TimeDelta::FromMinutes(3), alarm_manager_->next_poll_time_); alarm_manager_->RemoveAllAlarms(extension_->id()); @@ -476,7 +476,7 @@ TEST_F(ExtensionAlarmsSchedulingTest, PollScheduling) { alarm3.js_alarm->scheduled_time = 25 * 60000; alarm3.js_alarm->period_in_minutes.reset(new double(25)); alarm_manager_->AddAlarmImpl(extension_->id(), alarm3); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(alarm_manager_->last_poll_time_ + base::TimeDelta::FromMinutes(4), alarm_manager_->next_poll_time_); alarm_manager_->RemoveAllAlarms(extension_->id()); @@ -508,7 +508,7 @@ TEST_F(ExtensionAlarmsSchedulingTest, TimerRunning) { EXPECT_FALSE(alarm_manager_->timer_.IsRunning()); CreateAlarm("[\"a\", {\"delayInMinutes\": 0.001}]"); EXPECT_TRUE(alarm_manager_->timer_.IsRunning()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_FALSE(alarm_manager_->timer_.IsRunning()); CreateAlarm("[\"bb\", {\"delayInMinutes\": 10}]"); EXPECT_TRUE(alarm_manager_->timer_.IsRunning()); diff --git a/chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc b/chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc index b5a3446..82e6ab2 100644 --- a/chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc +++ b/chrome/browser/extensions/api/bluetooth/bluetooth_event_router_unittest.cc @@ -104,7 +104,7 @@ class ExtensionBluetoothEventRouterTest : public testing::Test { testing::NiceMock<device::MockBluetoothProfile> mock_health_profile_; scoped_ptr<TestingProfile> test_profile_; ExtensionBluetoothEventRouter router_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; }; diff --git a/chrome/browser/extensions/api/declarative/initializing_rules_registry_unittest.cc b/chrome/browser/extensions/api/declarative/initializing_rules_registry_unittest.cc index 5d7e868..539cad9 100644 --- a/chrome/browser/extensions/api/declarative/initializing_rules_registry_unittest.cc +++ b/chrome/browser/extensions/api/declarative/initializing_rules_registry_unittest.cc @@ -19,7 +19,7 @@ const char kRuleId[] = "foo"; namespace extensions { TEST(InitializingRulesRegistryTest, FillOptionalIdentifiers) { - MessageLoopForUI message_loop; + base::MessageLoopForUI message_loop; content::TestBrowserThread thread(content::BrowserThread::UI, &message_loop); std::string error; @@ -136,7 +136,7 @@ TEST(InitializingRulesRegistryTest, FillOptionalIdentifiers) { } TEST(InitializingRulesRegistryTest, FillOptionalPriority) { - MessageLoopForUI message_loop; + base::MessageLoopForUI message_loop; content::TestBrowserThread thread(content::BrowserThread::UI, &message_loop); std::string error; diff --git a/chrome/browser/extensions/api/declarative/rules_registry_service_unittest.cc b/chrome/browser/extensions/api/declarative/rules_registry_service_unittest.cc index 8a998fd..2c7c646 100644 --- a/chrome/browser/extensions/api/declarative/rules_registry_service_unittest.cc +++ b/chrome/browser/extensions/api/declarative/rules_registry_service_unittest.cc @@ -47,7 +47,7 @@ class RulesRegistryServiceTest : public testing::Test { } protected: - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread ui; content::TestBrowserThread io; }; diff --git a/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc b/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc index 31b1354..cf02cef 100644 --- a/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc +++ b/chrome/browser/extensions/api/declarative/rules_registry_with_cache_unittest.cc @@ -73,7 +73,7 @@ class RulesRegistryWithCacheTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; scoped_refptr<TestRulesRegistry> registry_; diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc index 79a46bf..b3e23fd 100644 --- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc +++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_action_unittest.cc @@ -99,7 +99,7 @@ class WebRequestActionWithThreadsTest : public testing::Test { scoped_refptr<ExtensionInfoMap> extension_info_map_; private: - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; content::TestBrowserThread io_thread_; }; diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc index 99a62f1..fb11630 100644 --- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc +++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_attribute_unittest.cc @@ -31,7 +31,7 @@ namespace keys = declarative_webrequest_constants; TEST(WebRequestConditionAttributeTest, CreateConditionAttribute) { // Necessary for TestURLRequest. - MessageLoop message_loop(MessageLoop::TYPE_IO); + base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); std::string error; scoped_refptr<const WebRequestConditionAttribute> result; @@ -72,7 +72,7 @@ TEST(WebRequestConditionAttributeTest, CreateConditionAttribute) { TEST(WebRequestConditionAttributeTest, ResourceType) { // Necessary for TestURLRequest. - MessageLoop message_loop(MessageLoop::TYPE_IO); + base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); std::string error; ListValue resource_types; @@ -105,7 +105,7 @@ TEST(WebRequestConditionAttributeTest, ResourceType) { TEST(WebRequestConditionAttributeTest, ContentType) { // Necessary for TestURLRequest. - MessageLoop message_loop(MessageLoop::TYPE_IO); + base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); std::string error; scoped_refptr<const WebRequestConditionAttribute> result; @@ -122,7 +122,7 @@ TEST(WebRequestConditionAttributeTest, ContentType) { net::TestURLRequest url_request( test_server.GetURL("files/headers.html"), &delegate, &context, NULL); url_request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ListValue content_types; content_types.Append(Value::CreateStringValue("text/plain")); @@ -174,7 +174,7 @@ TEST(WebRequestConditionAttributeTest, ContentType) { // Testing WebRequestConditionAttributeThirdParty. TEST(WebRequestConditionAttributeTest, ThirdParty) { // Necessary for TestURLRequest. - MessageLoop message_loop(MessageLoop::TYPE_IO); + base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); std::string error; const FundamentalValue value_true(true); @@ -235,7 +235,7 @@ TEST(WebRequestConditionAttributeTest, ThirdParty) { // applicable in all stages. TEST(WebRequestConditionAttributeTest, Stages) { // Necessary for TestURLRequest. - MessageLoop message_loop(MessageLoop::TYPE_IO); + base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); typedef std::pair<RequestStage, const char*> StageNamePair; static const StageNamePair active_stages[] = { @@ -411,7 +411,7 @@ void MatchAndCheck(const std::vector< std::vector<const std::string*> >& tests, // by both types of condition attributes, so it is enough to test it once. TEST(WebRequestConditionAttributeTest, RequestHeaders) { // Necessary for TestURLRequest. - MessageLoop message_loop(MessageLoop::TYPE_IO); + base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); net::TestURLRequestContext context; net::TestDelegate delegate; @@ -420,7 +420,7 @@ TEST(WebRequestConditionAttributeTest, RequestHeaders) { url_request.SetExtraRequestHeaderByName( "Custom-header", "custom/value", true /* overwrite */); url_request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); std::vector<std::vector<const std::string*> > tests; bool result = false; @@ -489,7 +489,7 @@ TEST(WebRequestConditionAttributeTest, RequestHeaders) { // 3. Negating the match in case of 'doesNotContainHeaders'. TEST(WebRequestConditionAttributeTest, ResponseHeaders) { // Necessary for TestURLRequest. - MessageLoop message_loop(MessageLoop::TYPE_IO); + base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); net::SpawnedTestServer test_server( net::SpawnedTestServer::TYPE_HTTP, @@ -503,7 +503,7 @@ TEST(WebRequestConditionAttributeTest, ResponseHeaders) { net::TestURLRequest url_request(test_server.GetURL("files/headers.html"), &delegate, &context, NULL); url_request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // In all the tests below we assume that the server includes the headers // Custom-Header: custom/value diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_unittest.cc index 69c53f0..6cfbd15 100644 --- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_unittest.cc +++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_condition_unittest.cc @@ -22,7 +22,7 @@ namespace keys2 = url_matcher_constants; TEST(WebRequestConditionTest, CreateCondition) { // Necessary for TestURLRequest. - MessageLoop message_loop(MessageLoop::TYPE_IO); + base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); URLMatcher matcher; std::string error; @@ -95,7 +95,7 @@ TEST(WebRequestConditionTest, CreateCondition) { TEST(WebRequestConditionTest, CreateConditionFirstPartyForCookies) { // Necessary for TestURLRequest. - MessageLoop message_loop(MessageLoop::TYPE_IO); + base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); URLMatcher matcher; std::string error; @@ -139,7 +139,7 @@ TEST(WebRequestConditionTest, CreateConditionFirstPartyForCookies) { // always fulfilled. TEST(WebRequestConditionTest, NoUrlAttributes) { // Necessary for TestURLRequest. - MessageLoop message_loop(MessageLoop::TYPE_IO); + base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); URLMatcher matcher; std::string error; @@ -207,7 +207,7 @@ TEST(WebRequestConditionTest, NoUrlAttributes) { TEST(WebRequestConditionTest, CreateConditionSet) { // Necessary for TestURLRequest. - MessageLoop message_loop(MessageLoop::TYPE_IO); + base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); URLMatcher matcher; WebRequestConditionSet::AnyVector conditions; @@ -274,7 +274,7 @@ TEST(WebRequestConditionTest, CreateConditionSet) { TEST(WebRequestConditionTest, TestPortFilter) { // Necessary for TestURLRequest. - MessageLoop message_loop(MessageLoop::TYPE_IO); + base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); URLMatcher matcher; WebRequestConditionSet::AnyVector conditions; @@ -331,7 +331,7 @@ TEST(WebRequestConditionTest, TestPortFilter) { // impossible that both conditions are fulfilled at the same time. TEST(WebRequestConditionTest, ConditionsWithConflictingStages) { // Necessary for TestURLRequest. - MessageLoop message_loop(MessageLoop::TYPE_IO); + base::MessageLoop message_loop(base::MessageLoop::TYPE_IO); URLMatcher matcher; std::string error; diff --git a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc index cb404ba..c811841 100644 --- a/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc +++ b/chrome/browser/extensions/api/declarative_webrequest/webrequest_rules_registry_unittest.cc @@ -77,7 +77,7 @@ class TestWebRequestRulesRegistry : public WebRequestRulesRegistry { class WebRequestRulesRegistryTest : public testing::Test { public: WebRequestRulesRegistryTest() - : message_loop(MessageLoop::TYPE_IO), + : message_loop(base::MessageLoop::TYPE_IO), ui(content::BrowserThread::UI, &message_loop), io(content::BrowserThread::IO, &message_loop) {} @@ -219,7 +219,7 @@ class WebRequestRulesRegistryTest : public testing::Test { } protected: - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread ui; content::TestBrowserThread io; // Two extensions with host permissions for all URLs and the DWR permission. diff --git a/chrome/browser/extensions/api/dial/dial_registry_unittest.cc b/chrome/browser/extensions/api/dial/dial_registry_unittest.cc index ba39270..0e3acfd 100644 --- a/chrome/browser/extensions/api/dial/dial_registry_unittest.cc +++ b/chrome/browser/extensions/api/dial/dial_registry_unittest.cc @@ -108,7 +108,7 @@ class DialRegistryTest : public testing::Test { // Must instantiate a MessageLoop for the thread, as the registry starts a // RepeatingTimer when there are listeners. - MessageLoop message_loop_; + base::MessageLoop message_loop_; void SetListenerExpectations() { EXPECT_CALL(registry_->mock_service(), diff --git a/chrome/browser/extensions/api/dial/dial_service_unittest.cc b/chrome/browser/extensions/api/dial/dial_service_unittest.cc index b378589..f8365b6 100644 --- a/chrome/browser/extensions/api/dial/dial_service_unittest.cc +++ b/chrome/browser/extensions/api/dial/dial_service_unittest.cc @@ -53,7 +53,7 @@ class DialServiceTest : public testing::Test { }; TEST_F(DialServiceTest, TestSendMultipleRequests) { - MessageLoop loop(MessageLoop::TYPE_IO); + base::MessageLoop loop(base::MessageLoop::TYPE_IO); // Setting the finish delay to zero disables the timer that invokes // FinishDiscovery(). dial_service_.finish_delay_ = TimeDelta::FromSeconds(0); diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc index bcf7eba..ddb8303 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api.cc +++ b/chrome/browser/extensions/api/downloads/downloads_api.cc @@ -681,7 +681,7 @@ class ExtensionDownloadsEventRouterData : public base::SupportsUserData::Data { // determiners_ doesn't keep hogging memory. weak_ptr_factory_.reset( new base::WeakPtrFactory<ExtensionDownloadsEventRouterData>(this)); - MessageLoopForUI::current()->PostDelayedTask( + base::MessageLoopForUI::current()->PostDelayedTask( FROM_HERE, base::Bind(&ExtensionDownloadsEventRouterData::ClearPendingDeterminers, weak_ptr_factory_->GetWeakPtr()), @@ -1138,7 +1138,8 @@ bool DownloadsDragFunction::RunImpl() { gfx::NativeView view = web_contents->GetView()->GetNativeView(); { // Enable nested tasks during DnD, while |DragDownload()| blocks. - MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); + base::MessageLoop::ScopedNestableTaskAllower allow( + base::MessageLoop::current()); download_util::DragDownload(download_item, icon, view); } return true; diff --git a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc index bc93564..e84ceba 100644 --- a/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc +++ b/chrome/browser/extensions/api/downloads/downloads_api_unittest.cc @@ -187,7 +187,7 @@ class DownloadsEventsListener : public content::NotificationObserver { waiting_for_.get() && new_event->Satisfies(*waiting_for_)) { waiting_ = false; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } break; } diff --git a/chrome/browser/extensions/api/history/history_api.cc b/chrome/browser/extensions/api/history/history_api.cc index d6c61f1..d5d8f92 100644 --- a/chrome/browser/extensions/api/history/history_api.cc +++ b/chrome/browser/extensions/api/history/history_api.cc @@ -280,7 +280,7 @@ bool HistoryFunctionWithCallback::RunImpl() { } void HistoryFunctionWithCallback::SendAsyncResponse() { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&HistoryFunctionWithCallback::SendResponseToCallback, this)); } diff --git a/chrome/browser/extensions/api/identity/experimental_identity_apitest.cc b/chrome/browser/extensions/api/identity/experimental_identity_apitest.cc index eb9553a..ee3ab02 100644 --- a/chrome/browser/extensions/api/identity/experimental_identity_apitest.cc +++ b/chrome/browser/extensions/api/identity/experimental_identity_apitest.cc @@ -68,7 +68,7 @@ class SendResponseDelegate : response_.reset(new bool); *response_ = success; if (should_post_quit_) { - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } diff --git a/chrome/browser/extensions/api/identity/experimental_web_auth_flow.cc b/chrome/browser/extensions/api/identity/experimental_web_auth_flow.cc index 983f26d..e06a3b9 100644 --- a/chrome/browser/extensions/api/identity/experimental_web_auth_flow.cc +++ b/chrome/browser/extensions/api/identity/experimental_web_auth_flow.cc @@ -85,7 +85,7 @@ void ExperimentalWebAuthFlow::Start() { void ExperimentalWebAuthFlow::DetachDelegateAndDelete() { delegate_ = NULL; - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } WebContents* ExperimentalWebAuthFlow::CreateWebContents() { diff --git a/chrome/browser/extensions/api/identity/gaia_web_auth_flow_unittest.cc b/chrome/browser/extensions/api/identity/gaia_web_auth_flow_unittest.cc index c9bf6de..787351fd 100644 --- a/chrome/browser/extensions/api/identity/gaia_web_auth_flow_unittest.cc +++ b/chrome/browser/extensions/api/identity/gaia_web_auth_flow_unittest.cc @@ -102,7 +102,7 @@ class IdentityGaiaWebAuthFlowTest : public testing::Test { protected: testing::StrictMock<MockGaiaWebAuthFlowDelegate> delegate_; GoogleServiceAuthError::State ubertoken_error_state_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread fake_ui_thread_; }; diff --git a/chrome/browser/extensions/api/identity/identity_apitest.cc b/chrome/browser/extensions/api/identity/identity_apitest.cc index b18c138..6514e1e 100644 --- a/chrome/browser/extensions/api/identity/identity_apitest.cc +++ b/chrome/browser/extensions/api/identity/identity_apitest.cc @@ -72,7 +72,7 @@ class SendResponseDelegate response_.reset(new bool); *response_ = success; if (should_post_quit_) { - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } diff --git a/chrome/browser/extensions/api/identity/web_auth_flow.cc b/chrome/browser/extensions/api/identity/web_auth_flow.cc index 7a27f16..d4347d4 100644 --- a/chrome/browser/extensions/api/identity/web_auth_flow.cc +++ b/chrome/browser/extensions/api/identity/web_auth_flow.cc @@ -91,7 +91,7 @@ void WebAuthFlow::Start() { void WebAuthFlow::DetachDelegateAndDelete() { delegate_ = NULL; - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } WebContents* WebAuthFlow::CreateWebContents() { diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host.cc b/chrome/browser/extensions/api/messaging/native_message_process_host.cc index 6e32df8..a856d2b 100644 --- a/chrome/browser/extensions/api/messaging/native_message_process_host.cc +++ b/chrome/browser/extensions/api/messaging/native_message_process_host.cc @@ -197,8 +197,8 @@ void NativeMessageProcessHost::WaitRead() { // would always be consuming one thread in the thread pool. On Windows // FileStream uses overlapped IO, so that optimization isn't necessary there. #if defined(OS_POSIX) - MessageLoopForIO::current()->WatchFileDescriptor( - read_file_, false /* persistent */, MessageLoopForIO::WATCH_READ, + base::MessageLoopForIO::current()->WatchFileDescriptor( + read_file_, false /* persistent */, base::MessageLoopForIO::WATCH_READ, &read_watcher_, this); #else // defined(OS_POSIX) DoRead(); diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host.h b/chrome/browser/extensions/api/messaging/native_message_process_host.h index 1d2475b..987055f 100644 --- a/chrome/browser/extensions/api/messaging/native_message_process_host.h +++ b/chrome/browser/extensions/api/messaging/native_message_process_host.h @@ -34,7 +34,7 @@ namespace extensions { // thread. class NativeMessageProcessHost #if defined(OS_POSIX) - : public MessageLoopForIO::Watcher + : public base::MessageLoopForIO::Watcher #endif // !defined(OS_POSIX) { public: @@ -134,7 +134,7 @@ class NativeMessageProcessHost scoped_ptr<net::FileStream> read_stream_; #if defined(OS_POSIX) - MessageLoopForIO::FileDescriptorWatcher read_watcher_; + base::MessageLoopForIO::FileDescriptorWatcher read_watcher_; #endif // !defined(OS_POSIX) // Write stream. diff --git a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc index 36298f7..080be62 100644 --- a/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc +++ b/chrome/browser/extensions/api/messaging/native_message_process_host_unittest.cc @@ -153,7 +153,7 @@ class NativeMessagingTest : public ::testing::Test, Feature::ScopedCurrentChannel current_channel_; scoped_ptr<NativeMessageProcessHost> native_message_process_host_; base::FilePath user_data_dir_; - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; scoped_ptr<base::RunLoop> read_message_run_loop_; scoped_ptr<content::TestBrowserThread> ui_thread_; scoped_ptr<content::TestBrowserThread> io_thread_; diff --git a/chrome/browser/extensions/api/processes/processes_api.cc b/chrome/browser/extensions/api/processes/processes_api.cc index 1d0d76c..404b968 100644 --- a/chrome/browser/extensions/api/processes/processes_api.cc +++ b/chrome/browser/extensions/api/processes/processes_api.cc @@ -552,7 +552,7 @@ bool GetProcessIdForTabFunction::RunImpl() { // the data gathering. if (ProcessesAPI::Get(profile_)->processes_event_router()-> is_task_manager_listening()) { - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( &GetProcessIdForTabFunction::GetProcessIdForTab, this)); } else { registrar_.Add(this, @@ -615,7 +615,7 @@ bool TerminateFunction::RunImpl() { // the data gathering. if (ProcessesAPI::Get(profile_)->processes_event_router()-> is_task_manager_listening()) { - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( &TerminateFunction::TerminateProcess, this)); } else { registrar_.Add(this, @@ -703,7 +703,7 @@ bool GetProcessInfoFunction::RunImpl() { // the data gathering. if (ProcessesAPI::Get(profile_)->processes_event_router()-> is_task_manager_listening()) { - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( &GetProcessInfoFunction::GatherProcessInfo, this)); } else { registrar_.Add(this, diff --git a/chrome/browser/extensions/api/runtime/runtime_api.cc b/chrome/browser/extensions/api/runtime/runtime_api.cc index 1bf7b7e..db940db 100644 --- a/chrome/browser/extensions/api/runtime/runtime_api.cc +++ b/chrome/browser/extensions/api/runtime/runtime_api.cc @@ -235,7 +235,7 @@ bool RuntimeReloadFunction::RunImpl() { // We can't call ReloadExtension directly, since when this method finishes // it tries to decrease the reference count for the extension, which fails // if the extension has already been reloaded; so instead we post a task. - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&ExtensionService::ReloadExtension, profile()->GetExtensionService()->AsWeakPtr(), extension_id())); diff --git a/chrome/browser/extensions/api/socket/udp_socket_unittest.cc b/chrome/browser/extensions/api/socket/udp_socket_unittest.cc index 0730d64..6acddf3 100644 --- a/chrome/browser/extensions/api/socket/udp_socket_unittest.cc +++ b/chrome/browser/extensions/api/socket/udp_socket_unittest.cc @@ -39,7 +39,7 @@ static void OnSendCompleted(int result) { } TEST(UDPSocketUnitTest, TestUDPSocketRecvFrom) { - MessageLoopForIO io_loop; // For RecvFrom to do its threaded work. + base::MessageLoopForIO io_loop; // For RecvFrom to do its threaded work. UDPSocket socket("abcdefghijklmnopqrst"); // Confirm that we can call two RecvFroms in quick succession without @@ -81,7 +81,7 @@ TEST(UDPSocketUnitTest, TestUDPMulticastLoopbackMode) { } static void QuitMessageLoop() { - MessageLoopForIO::current()->QuitNow(); + base::MessageLoopForIO::current()->QuitNow(); } // Send a test multicast packet every second. @@ -90,7 +90,7 @@ static void SendMulticastPacket(UDPSocket* src, int result) { if (result == 0) { scoped_refptr<net::IOBuffer> data = new net::WrappedIOBuffer(test_message); src->Write(data, test_message_length, base::Bind(&OnSendCompleted)); - MessageLoopForIO::current()->PostDelayedTask(FROM_HERE, + base::MessageLoopForIO::current()->PostDelayedTask(FROM_HERE, base::Bind(&SendMulticastPacket, src, result), base::TimeDelta::FromSeconds(1)); } else { @@ -112,7 +112,7 @@ TEST(UDPSocketUnitTest, TestUDPMulticastRecv) { const int kPort = 9999; const char* const kGroup = "237.132.100.17"; bool packet_received = false; - MessageLoopForIO io_loop; // For Read to do its threaded work. + base::MessageLoopForIO io_loop; // For Read to do its threaded work. UDPSocket dest("abcdefghijklmnopqrst"); UDPSocket src("abcdefghijklmnopqrst"); diff --git a/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc b/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc index 29783a9..dc3a183 100644 --- a/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc +++ b/chrome/browser/extensions/api/storage/policy_value_store_unittest.cc @@ -108,7 +108,7 @@ class PolicyValueStoreTest : public testing::Test { protected: base::ScopedTempDir scoped_temp_dir_; - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread file_thread_; scoped_ptr<PolicyValueStore> store_; MockSettingsObserver observer_; diff --git a/chrome/browser/extensions/api/storage/settings_apitest.cc b/chrome/browser/extensions/api/storage/settings_apitest.cc index fd81c9d..30742f0 100644 --- a/chrome/browser/extensions/api/storage/settings_apitest.cc +++ b/chrome/browser/extensions/api/storage/settings_apitest.cc @@ -128,7 +128,7 @@ class ExtensionSettingsApiTest : public ExtensionApiTest { } void InitSync(syncer::SyncChangeProcessor* sync_processor) { - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); InitSyncWithSyncableService( sync_processor, browser()->profile()->GetExtensionService()->settings_frontend()-> @@ -136,7 +136,7 @@ class ExtensionSettingsApiTest : public ExtensionApiTest { } void SendChanges(const syncer::SyncChangeList& change_list) { - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); SendChangesToSyncableService( change_list, browser()->profile()->GetExtensionService()->settings_frontend()-> diff --git a/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc b/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc index d53b2ea..06555b9 100644 --- a/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc +++ b/chrome/browser/extensions/api/storage/settings_frontend_unittest.cc @@ -53,8 +53,8 @@ class ExtensionSettingsFrontendTest : public testing::Test { public: ExtensionSettingsFrontendTest() : storage_factory_(new util::ScopedSettingsStorageFactory()), - ui_thread_(BrowserThread::UI, MessageLoop::current()), - file_thread_(BrowserThread::FILE, MessageLoop::current()) {} + ui_thread_(BrowserThread::UI, base::MessageLoop::current()), + file_thread_(BrowserThread::FILE, base::MessageLoop::current()) {} virtual void SetUp() OVERRIDE { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); @@ -82,7 +82,7 @@ class ExtensionSettingsFrontendTest : public testing::Test { scoped_refptr<util::ScopedSettingsStorageFactory> storage_factory_; private: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; }; @@ -141,7 +141,7 @@ TEST_F(ExtensionSettingsFrontendTest, SettingsClearedOnUninstall) { // This would be triggered by extension uninstall via a DataDeleter. frontend_->DeleteStorageSoon(id); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // The storage area may no longer be valid post-uninstall, so re-request. storage = util::GetStorage(id, frontend_.get()); @@ -177,7 +177,7 @@ TEST_F(ExtensionSettingsFrontendTest, LeveldbDatabaseDeletedFromDiskOnClear) { } frontend_.reset(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // TODO(kalman): Figure out why this fails, despite appearing to work. // Leaving this commented out rather than disabling the whole test so that the // deletion code paths are at least exercised. @@ -282,7 +282,7 @@ TEST_F(ExtensionSettingsFrontendTest, frontend_->RunWithStorage( id, settings::LOCAL, base::Bind(&UnlimitedLocalStorageTestCallback)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } } // namespace extensions diff --git a/chrome/browser/extensions/api/storage/settings_sync_unittest.cc b/chrome/browser/extensions/api/storage/settings_sync_unittest.cc index fcfcdc8..ae4a353 100644 --- a/chrome/browser/extensions/api/storage/settings_sync_unittest.cc +++ b/chrome/browser/extensions/api/storage/settings_sync_unittest.cc @@ -201,8 +201,8 @@ class TestingValueStoreFactory : public SettingsStorageFactory { class ExtensionSettingsSyncTest : public testing::Test { public: ExtensionSettingsSyncTest() - : ui_thread_(BrowserThread::UI, MessageLoop::current()), - file_thread_(BrowserThread::FILE, MessageLoop::current()), + : ui_thread_(BrowserThread::UI, base::MessageLoop::current()), + file_thread_(BrowserThread::FILE, base::MessageLoop::current()), storage_factory_(new util::ScopedSettingsStorageFactory()), sync_processor_(new MockSyncChangeProcessor), sync_processor_delegate_(new SyncChangeProcessorDelegate( @@ -237,7 +237,7 @@ class ExtensionSettingsSyncTest : public testing::Test { // Gets the syncer::SyncableService for the given sync type. syncer::SyncableService* GetSyncableService(syncer::ModelType model_type) { - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); return frontend_->GetBackendForSync(model_type); } @@ -257,7 +257,7 @@ class ExtensionSettingsSyncTest : public testing::Test { } // Need these so that the DCHECKs for running on FILE or UI threads pass. - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/extensions/api/storage/settings_test_util.cc b/chrome/browser/extensions/api/storage/settings_test_util.cc index f6e714a..30bf92b 100644 --- a/chrome/browser/extensions/api/storage/settings_test_util.cc +++ b/chrome/browser/extensions/api/storage/settings_test_util.cc @@ -27,7 +27,7 @@ ValueStore* GetStorage( extension_id, settings_namespace, base::Bind(&AssignStorage, &storage)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); return storage; } diff --git a/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc b/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc index 36e06cc..9e4a683 100644 --- a/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc +++ b/chrome/browser/extensions/api/streams_private/streams_private_apitest.cc @@ -210,7 +210,7 @@ IN_PROC_BROWSER_TEST_F(StreamsPrivateApiTest, Navigate) { test_server_->GetURL("/doc_path.doc")); // Wait for the response from the test server. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // There should be no downloads started by the navigation. DownloadManager* download_manager = GetDownloadManager(); diff --git a/chrome/browser/extensions/api/system_info_cpu/cpu_info_provider_unittest.cc b/chrome/browser/extensions/api/system_info_cpu/cpu_info_provider_unittest.cc index 8db85c1..18aa3da 100644 --- a/chrome/browser/extensions/api/system_info_cpu/cpu_info_provider_unittest.cc +++ b/chrome/browser/extensions/api/system_info_cpu/cpu_info_provider_unittest.cc @@ -145,7 +145,7 @@ class CpuInfoProviderTest : public testing::Test { void VerifyResult(); protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; scoped_refptr<TestCpuInfoProvider> cpu_info_provider_; @@ -158,7 +158,7 @@ class CpuInfoProviderTest : public testing::Test { }; CpuInfoProviderTest::CpuInfoProviderTest() - : message_loop_(MessageLoop::TYPE_UI), + : message_loop_(base::MessageLoop::TYPE_UI), ui_thread_(BrowserThread::UI, &message_loop_), file_thread_(BrowserThread::FILE, &message_loop_) { } @@ -173,7 +173,7 @@ void CpuInfoProviderTest::OnCheckCpuSamplingFinishedForTesting( // UI thread a chance to verify results. if (cpu_info_provider_->is_complete_sampling()) { BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); } TestCpuUpdateInfo result; diff --git a/chrome/browser/extensions/api/system_info_cpu/system_info_cpu_apitest.cc b/chrome/browser/extensions/api/system_info_cpu/system_info_cpu_apitest.cc index 84911d4..6d8c35e 100644 --- a/chrome/browser/extensions/api/system_info_cpu/system_info_cpu_apitest.cc +++ b/chrome/browser/extensions/api/system_info_cpu/system_info_cpu_apitest.cc @@ -68,11 +68,11 @@ class SystemInfoCpuApiTest: public ExtensionApiTest { virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { ExtensionApiTest::SetUpInProcessBrowserTestFixture(); - message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); + message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); } private: - scoped_ptr<MessageLoop> message_loop_; + scoped_ptr<base::MessageLoop> message_loop_; }; IN_PROC_BROWSER_TEST_F(SystemInfoCpuApiTest, Cpu) { diff --git a/chrome/browser/extensions/api/system_info_display/system_info_display_apitest.cc b/chrome/browser/extensions/api/system_info_display/system_info_display_apitest.cc index b719fe6..35107f7 100644 --- a/chrome/browser/extensions/api/system_info_display/system_info_display_apitest.cc +++ b/chrome/browser/extensions/api/system_info_display/system_info_display_apitest.cc @@ -55,11 +55,11 @@ class SystemInfoDisplayApiTest: public ExtensionApiTest { virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { ExtensionApiTest::SetUpInProcessBrowserTestFixture(); - message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); + message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); } private: - scoped_ptr<MessageLoop> message_loop_; + scoped_ptr<base::MessageLoop> message_loop_; }; IN_PROC_BROWSER_TEST_F(SystemInfoDisplayApiTest, Display) { diff --git a/chrome/browser/extensions/api/system_info_memory/system_info_memory_apitest.cc b/chrome/browser/extensions/api/system_info_memory/system_info_memory_apitest.cc index bfaf312..8035b70 100644 --- a/chrome/browser/extensions/api/system_info_memory/system_info_memory_apitest.cc +++ b/chrome/browser/extensions/api/system_info_memory/system_info_memory_apitest.cc @@ -39,11 +39,11 @@ class SystemInfoMemoryApiTest: public ExtensionApiTest { virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { ExtensionApiTest::SetUpInProcessBrowserTestFixture(); - message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); + message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); } private: - scoped_ptr<MessageLoop> message_loop_; + scoped_ptr<base::MessageLoop> message_loop_; }; IN_PROC_BROWSER_TEST_F(SystemInfoMemoryApiTest, Memory) { diff --git a/chrome/browser/extensions/api/system_info_storage/storage_info_provider_unittest.cc b/chrome/browser/extensions/api/system_info_storage/storage_info_provider_unittest.cc index d80b14f..a225735 100644 --- a/chrome/browser/extensions/api/system_info_storage/storage_info_provider_unittest.cc +++ b/chrome/browser/extensions/api/system_info_storage/storage_info_provider_unittest.cc @@ -173,7 +173,7 @@ void TestStorageInfoProvider::OnCheckWatchedStoragesFinishedForTesting() { // Note the QuitClosure is actually bound to QuitCurrentWhenIdle, it means // that the UI thread wil continue to process pending messages util idle. BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); } class StorageInfoProviderTest : public testing::Test { @@ -190,14 +190,14 @@ class StorageInfoProviderTest : public testing::Test { static void RunLoopAndFlushBlockingPool(); static void RunAllPendingAndFlushBlockingPool(); - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; scoped_refptr<TestStorageInfoProvider> storage_info_provider_; scoped_ptr<TestStorageMonitor> storage_test_notifications_; }; StorageInfoProviderTest::StorageInfoProviderTest() - : message_loop_(MessageLoop::TYPE_UI), + : message_loop_(base::MessageLoop::TYPE_UI), ui_thread_(BrowserThread::UI, &message_loop_) { } diff --git a/chrome/browser/extensions/api/system_info_storage/system_info_storage_apitest.cc b/chrome/browser/extensions/api/system_info_storage/system_info_storage_apitest.cc index 3fb84a2..b316a755 100644 --- a/chrome/browser/extensions/api/system_info_storage/system_info_storage_apitest.cc +++ b/chrome/browser/extensions/api/system_info_storage/system_info_storage_apitest.cc @@ -102,7 +102,7 @@ class SystemInfoStorageApiTest: public ExtensionApiTest { virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { ExtensionApiTest::SetUpInProcessBrowserTestFixture(); - message_loop_.reset(new MessageLoop(MessageLoop::TYPE_UI)); + message_loop_.reset(new base::MessageLoop(base::MessageLoop::TYPE_UI)); } void ProcessAttach(const std::string& device_id, @@ -118,7 +118,7 @@ class SystemInfoStorageApiTest: public ExtensionApiTest { } private: - scoped_ptr<MessageLoop> message_loop_; + scoped_ptr<base::MessageLoop> message_loop_; }; IN_PROC_BROWSER_TEST_F(SystemInfoStorageApiTest, Storage) { diff --git a/chrome/browser/extensions/api/tabs/tabs_api.cc b/chrome/browser/extensions/api/tabs/tabs_api.cc index 3f9f851..fcb587b 100644 --- a/chrome/browser/extensions/api/tabs/tabs_api.cc +++ b/chrome/browser/extensions/api/tabs/tabs_api.cc @@ -1917,7 +1917,7 @@ bool TabsDetectLanguageFunction::RunImpl() { if (!translate_tab_helper->language_state().original_language().empty()) { // Delay the callback invocation until after the current JS call has // returned. - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( &TabsDetectLanguageFunction::GotLanguage, this, translate_tab_helper->language_state().original_language())); return true; diff --git a/chrome/browser/extensions/api/top_sites/top_sites_apitest.cc b/chrome/browser/extensions/api/top_sites/top_sites_apitest.cc index 32c791b..7d8086c 100644 --- a/chrome/browser/extensions/api/top_sites/top_sites_apitest.cc +++ b/chrome/browser/extensions/api/top_sites/top_sites_apitest.cc @@ -33,7 +33,7 @@ class TopSitesExtensionTest : public InProcessBrowserTest { if (!top_sites_inited_) { waiting_ = true; - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } // By this point, we know topsites has loaded. We can run the tests now. @@ -42,7 +42,7 @@ class TopSitesExtensionTest : public InProcessBrowserTest { private: void OnTopSitesAvailable(const history::MostVisitedURLList& data) { if (waiting_) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); waiting_ = false; } top_sites_inited_ = true; diff --git a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc index 52ad26e..4746018 100644 --- a/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc +++ b/chrome/browser/extensions/api/web_request/web_request_api_unittest.cc @@ -159,7 +159,7 @@ class TestIPCSender : public IPC::Sender { EXPECT_EQ(ExtensionMsg_MessageInvoke::ID, message->type()); EXPECT_FALSE(task_queue_.empty()); - MessageLoop::current()->PostTask(FROM_HERE, task_queue_.front()); + base::MessageLoop::current()->PostTask(FROM_HERE, task_queue_.front()); task_queue_.pop(); sent_messages_.push_back(linked_ptr<IPC::Message>(message)); @@ -200,7 +200,7 @@ class ExtensionWebRequestTest : public testing::Test { const std::vector<char>& bytes_1, const std::vector<char>& bytes_2); - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; TestingProfile profile_; @@ -284,7 +284,7 @@ TEST_F(ExtensionWebRequestTest, BlockingEventPrecedenceRedirect) { request.identifier(), response)); request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(!request.is_pending()); EXPECT_EQ(net::URLRequestStatus::SUCCESS, request.status().status()); @@ -334,7 +334,7 @@ TEST_F(ExtensionWebRequestTest, BlockingEventPrecedenceRedirect) { request2.identifier(), response)); request2.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(!request2.is_pending()); EXPECT_EQ(net::URLRequestStatus::SUCCESS, request2.status().status()); @@ -398,7 +398,7 @@ TEST_F(ExtensionWebRequestTest, BlockingEventPrecedenceCancel) { request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(!request.is_pending()); EXPECT_EQ(net::URLRequestStatus::FAILED, request.status().status()); @@ -452,14 +452,14 @@ TEST_F(ExtensionWebRequestTest, SimulateChancelWhileBlocked) { // Extension response for OnErrorOccurred: Terminate the message loop. ipc_sender_.PushTask( - base::Bind(&MessageLoop::PostTask, - base::Unretained(MessageLoop::current()), - FROM_HERE, MessageLoop::QuitClosure())); + base::Bind(&base::MessageLoop::PostTask, + base::Unretained(base::MessageLoop::current()), + FROM_HERE, base::MessageLoop::QuitClosure())); request.Start(); // request.Start() will have submitted OnBeforeRequest by the time we cancel. request.Cancel(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(!request.is_pending()); EXPECT_EQ(net::URLRequestStatus::CANCELED, request.status().status()); @@ -623,7 +623,7 @@ TEST_F(ExtensionWebRequestTest, AccessRequestBodyData) { FireURLRequestWithData(kMethodPost, kMultipart, form_1, form_2); // We inspect the result in the message list of |ipc_sender_| later. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ExtensionWebRequestEventRouter::GetInstance()->RemoveEventListener( &profile_, extension_id, kEventName + "/1"); @@ -656,7 +656,7 @@ TEST_F(ExtensionWebRequestTest, AccessRequestBodyData) { // Now send a PUT request with the same body as above. FireURLRequestWithData(kMethodPut, NULL /*no header*/, plain_1, plain_2); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Clean-up. ExtensionWebRequestEventRouter::GetInstance()->RemoveEventListener( @@ -717,7 +717,7 @@ TEST_F(ExtensionWebRequestTest, NoAccessRequestBodyData) { } // We inspect the result in the message list of |ipc_sender_| later. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ExtensionWebRequestEventRouter::GetInstance()->RemoveEventListener( &profile_, extension_id, kEventName + "/1"); @@ -790,7 +790,7 @@ class ExtensionWebRequestHeaderModificationTest context_->Init(); } - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; TestingProfile profile_; @@ -888,7 +888,7 @@ TEST_P(ExtensionWebRequestHeaderModificationTest, TestModifications) { // exists and are therefore not listed in the responses. This makes // them seem deleted. request.Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(!request.is_pending()); // This cannot succeed as we send the request to a server that does not exist. diff --git a/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc b/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc index 35bec82..01777f9 100644 --- a/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc +++ b/chrome/browser/extensions/api/web_request/web_request_permissions_unittest.cc @@ -38,7 +38,7 @@ class ExtensionWebRequestHelpersTestWithThreadsTest : public testing::Test { scoped_refptr<ExtensionInfoMap> extension_info_map_; private: - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; content::TestBrowserThread io_thread_; }; @@ -70,7 +70,7 @@ void ExtensionWebRequestHelpersTestWithThreadsTest::SetUp() { } TEST(ExtensionWebRequestHelpersTest, TestHideRequestForURL) { - MessageLoopForIO message_loop; + base::MessageLoopForIO message_loop; net::TestURLRequestContext context; scoped_refptr<ExtensionInfoMap> extension_info_map(new ExtensionInfoMap); const char* sensitive_urls[] = { diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc index feb7ba9..67ce366 100644 --- a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc +++ b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc @@ -50,7 +50,7 @@ class WebstoreInstallListener : public WebstoreInstaller::Delegate { if (waiting_) { waiting_ = false; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } @@ -64,7 +64,7 @@ class WebstoreInstallListener : public WebstoreInstaller::Delegate { if (waiting_) { waiting_ = false; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } diff --git a/chrome/browser/extensions/app_process_apitest.cc b/chrome/browser/extensions/app_process_apitest.cc index 811d94d..9bffa84 100644 --- a/chrome/browser/extensions/app_process_apitest.cc +++ b/chrome/browser/extensions/app_process_apitest.cc @@ -689,8 +689,8 @@ IN_PROC_BROWSER_TEST_F(AppApiTest, OpenAppFromExtension) { // Wait for app tab to be created and loaded. test_navigation_observer.WaitForObservation( base::Bind(&content::RunMessageLoop), - base::Bind(&MessageLoop::Quit, - base::Unretained(MessageLoopForUI::current()))); + base::Bind(&base::MessageLoop::Quit, + base::Unretained(base::MessageLoopForUI::current()))); // App has loaded, and chrome.app.isInstalled should be true. bool is_installed = false; diff --git a/chrome/browser/extensions/blacklist_unittest.cc b/chrome/browser/extensions/blacklist_unittest.cc index 31d20ba..dc8f58a 100644 --- a/chrome/browser/extensions/blacklist_unittest.cc +++ b/chrome/browser/extensions/blacklist_unittest.cc @@ -33,7 +33,7 @@ class BlacklistTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; TestExtensionPrefs prefs_; diff --git a/chrome/browser/extensions/browser_permissions_policy_delegate_unittest.cc b/chrome/browser/extensions/browser_permissions_policy_delegate_unittest.cc index a31970d..6fef348 100644 --- a/chrome/browser/extensions/browser_permissions_policy_delegate_unittest.cc +++ b/chrome/browser/extensions/browser_permissions_policy_delegate_unittest.cc @@ -20,10 +20,9 @@ namespace { class BrowserPermissionsPolicyDelegateTest : public testing::Test { public: - BrowserPermissionsPolicyDelegateTest() - : loop_(MessageLoop::TYPE_UI), - ui_thread_(content::BrowserThread::UI, &loop_) { - } + BrowserPermissionsPolicyDelegateTest() + : loop_(base::MessageLoop::TYPE_UI), + ui_thread_(content::BrowserThread::UI, &loop_) {} virtual void SetUp() { profile_manager_.reset( new TestingProfileManager(TestingBrowserProcess::GetGlobal())); @@ -35,8 +34,8 @@ public: profile_manager_->DeleteTestingProfile("test"); profile_manager_.reset(); } -protected: - MessageLoop loop_; + protected: + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; scoped_ptr<TestingProfileManager> profile_manager_; TestingProfile* profile_; diff --git a/chrome/browser/extensions/convert_web_app_browsertest.cc b/chrome/browser/extensions/convert_web_app_browsertest.cc index 42cebd2..95e1415 100644 --- a/chrome/browser/extensions/convert_web_app_browsertest.cc +++ b/chrome/browser/extensions/convert_web_app_browsertest.cc @@ -44,7 +44,7 @@ class ExtensionFromWebAppTest content::Details<const InstalledExtensionInfo>(details)->extension; if (extension->id() == expected_extension_id_) { installed_extension_ = extension; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } } diff --git a/chrome/browser/extensions/crx_installer_browsertest.cc b/chrome/browser/extensions/crx_installer_browsertest.cc index f297d20..49a0a2a 100644 --- a/chrome/browser/extensions/crx_installer_browsertest.cc +++ b/chrome/browser/extensions/crx_installer_browsertest.cc @@ -55,11 +55,11 @@ class MockInstallPrompt : public ExtensionInstallPrompt { virtual void OnInstallSuccess(const Extension* extension, SkBitmap* icon) OVERRIDE { extension_ = extension; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } virtual void OnInstallFailure(const CrxInstallerError& error) OVERRIDE { error_ = error.message(); - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } private: diff --git a/chrome/browser/extensions/default_apps_unittest.cc b/chrome/browser/extensions/default_apps_unittest.cc index cfff341..1104e7b 100644 --- a/chrome/browser/extensions/default_apps_unittest.cc +++ b/chrome/browser/extensions/default_apps_unittest.cc @@ -29,11 +29,11 @@ class MockExternalLoader : public ExternalLoader { class DefaultAppsTest : public testing::Test { public: - DefaultAppsTest() : loop_(MessageLoop::TYPE_IO), + DefaultAppsTest() : loop_(base::MessageLoop::TYPE_IO), ui_thread_(content::BrowserThread::UI, &loop_) {} virtual ~DefaultAppsTest() {} private: - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; }; diff --git a/chrome/browser/extensions/event_router.cc b/chrome/browser/extensions/event_router.cc index 9224a51..246f985 100644 --- a/chrome/browser/extensions/event_router.cc +++ b/chrome/browser/extensions/event_router.cc @@ -771,7 +771,7 @@ void EventRouter::Observe(int type, listeners_.LoadFilteredLazyListeners(extension->id(), *filtered_events); if (dispatch_chrome_updated_event_) { - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&DispatchOnInstalledEvent, profile_, extension->id(), Version(), true)); } @@ -797,7 +797,7 @@ void EventRouter::Observe(int type, if (old) old_version = *old->version(); - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&DispatchOnInstalledEvent, profile_, extension->id(), old_version, false)); break; diff --git a/chrome/browser/extensions/event_router_forwarder_unittest.cc b/chrome/browser/extensions/event_router_forwarder_unittest.cc index 975d986..e8172f7 100644 --- a/chrome/browser/extensions/event_router_forwarder_unittest.cc +++ b/chrome/browser/extensions/event_router_forwarder_unittest.cc @@ -114,7 +114,7 @@ class EventRouterForwarderTest : public testing::Test { return incognito; } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; TestingProfileManager profile_manager_; @@ -172,7 +172,7 @@ TEST_F(EventRouterForwarderTest, BroadcastRendererIO) { BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); ASSERT_TRUE(helper->Run()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } TEST_F(EventRouterForwarderTest, UnicastRendererUIRestricted) { diff --git a/chrome/browser/extensions/extension_action.cc b/chrome/browser/extensions/extension_action.cc index d8ec44f..f86760f 100644 --- a/chrome/browser/extensions/extension_action.cc +++ b/chrome/browser/extensions/extension_action.cc @@ -394,7 +394,7 @@ void ExtensionAction::RunIconAnimation(int tab_id) { // timer delays), destroy it. We use a delayed task so that the Animation is // deleted even if it hasn't finished by the time the MessageLoop is // destroyed. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&DestroyIconAnimation, base::Passed(&icon_animation)), base::TimeDelta::FromMilliseconds(kIconFadeInDurationMs * 2)); diff --git a/chrome/browser/extensions/extension_action_icon_factory_unittest.cc b/chrome/browser/extensions/extension_action_icon_factory_unittest.cc index 78e49e1..0e42893 100644 --- a/chrome/browser/extensions/extension_action_icon_factory_unittest.cc +++ b/chrome/browser/extensions/extension_action_icon_factory_unittest.cc @@ -95,7 +95,7 @@ class ExtensionActionIconFactoryTest void WaitForIconUpdate() { quit_in_icon_updated_ = true; - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); quit_in_icon_updated_ = false; } @@ -150,7 +150,7 @@ class ExtensionActionIconFactoryTest // ExtensionActionIconFactory::Observer overrides: virtual void OnIconUpdated() OVERRIDE { if (quit_in_icon_updated_) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } gfx::ImageSkia GetFavicon() { @@ -166,7 +166,7 @@ class ExtensionActionIconFactoryTest private: bool quit_in_icon_updated_; - MessageLoop ui_loop_; + base::MessageLoop ui_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/extensions/extension_action_unittest.cc b/chrome/browser/extensions/extension_action_unittest.cc index 6c2ca63..2aba574 100644 --- a/chrome/browser/extensions/extension_action_unittest.cc +++ b/chrome/browser/extensions/extension_action_unittest.cc @@ -59,7 +59,7 @@ TEST(ExtensionActionTest, Visibility) { TEST(ExtensionActionTest, ScriptBadgeAnimation) { // Supports the icon animation. - MessageLoop message_loop; + base::MessageLoop message_loop; ExtensionAction script_badge( std::string(), ActionInfo::TYPE_SCRIPT_BADGE, ActionInfo()); @@ -83,7 +83,7 @@ TEST(ExtensionActionTest, ScriptBadgeAnimation) { TEST(ExtensionActionTest, GetAttention) { // Supports the icon animation. - scoped_ptr<MessageLoop> message_loop(new MessageLoop); + scoped_ptr<base::MessageLoop> message_loop(new base::MessageLoop); ExtensionAction script_badge( std::string(), ActionInfo::TYPE_SCRIPT_BADGE, ActionInfo()); @@ -95,7 +95,7 @@ TEST(ExtensionActionTest, GetAttention) { // Simulate waiting long enough for the animation to end. message_loop.reset(); // Can't have 2 MessageLoops alive at once. - message_loop.reset(new MessageLoop); + message_loop.reset(new base::MessageLoop); EXPECT_FALSE(script_badge.GetIconAnimation(1)); // Sanity check. script_badge.SetAppearance(1, ExtensionAction::ACTIVE); diff --git a/chrome/browser/extensions/extension_apitest.cc b/chrome/browser/extensions/extension_apitest.cc index 09ed180f6..ae7030a 100644 --- a/chrome/browser/extensions/extension_apitest.cc +++ b/chrome/browser/extensions/extension_apitest.cc @@ -82,7 +82,7 @@ void ExtensionApiTest::ResultCatcher::Observe( results_.push_back(true); messages_.push_back(std::string()); if (waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); break; case chrome::NOTIFICATION_EXTENSION_TEST_FAILED: @@ -90,7 +90,7 @@ void ExtensionApiTest::ResultCatcher::Observe( results_.push_back(false); messages_.push_back(*(content::Details<std::string>(details).ptr())); if (waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); break; default: diff --git a/chrome/browser/extensions/extension_browsertest.cc b/chrome/browser/extensions/extension_browsertest.cc index 49a9dc9..658decd 100644 --- a/chrome/browser/extensions/extension_browsertest.cc +++ b/chrome/browser/extensions/extension_browsertest.cc @@ -306,7 +306,7 @@ class MockAbortExtensionInstallPrompt : public ExtensionInstallPrompt { const Extension* extension, const ShowDialogCallback& show_dialog_callback) OVERRIDE { delegate->InstallUIAbort(true); - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } virtual void OnInstallSuccess(const Extension* extension, @@ -663,7 +663,7 @@ void ExtensionBrowserTest::Observe( last_loaded_extension_id_ = content::Details<const Extension>(details).ptr()->id(); VLOG(1) << "Got EXTENSION_LOADED notification."; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); break; case chrome::NOTIFICATION_CRX_INSTALLER_DONE: @@ -677,29 +677,29 @@ void ExtensionBrowserTest::Observe( last_loaded_extension_id_ = ""; } ++crx_installers_done_observed_; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); break; case chrome::NOTIFICATION_EXTENSION_INSTALLED: VLOG(1) << "Got EXTENSION_INSTALLED notification."; ++extension_installs_observed_; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); break; case chrome::NOTIFICATION_EXTENSION_INSTALL_ERROR: VLOG(1) << "Got EXTENSION_INSTALL_ERROR notification."; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); break; case chrome::NOTIFICATION_EXTENSION_PROCESS_TERMINATED: VLOG(1) << "Got EXTENSION_PROCESS_TERMINATED notification."; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); break; case chrome::NOTIFICATION_EXTENSION_LOAD_ERROR: VLOG(1) << "Got EXTENSION_LOAD_ERROR notification."; ++extension_load_errors_observed_; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); break; case chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED: { @@ -710,7 +710,7 @@ void ExtensionBrowserTest::Observe( if (location_bar->PageActionCount() == target_page_action_count_) { target_page_action_count_ = -1; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } break; } @@ -724,14 +724,14 @@ void ExtensionBrowserTest::Observe( if (location_bar->PageActionVisibleCount() == target_visible_page_action_count_) { target_visible_page_action_count_ = -1; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } break; } case content::NOTIFICATION_LOAD_STOP: VLOG(1) << "Got LOAD_STOP notification."; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); break; default: diff --git a/chrome/browser/extensions/extension_crash_recovery_browsertest.cc b/chrome/browser/extensions/extension_crash_recovery_browsertest.cc index be889eb..3eaf9a6 100644 --- a/chrome/browser/extensions/extension_crash_recovery_browsertest.cc +++ b/chrome/browser/extensions/extension_crash_recovery_browsertest.cc @@ -72,7 +72,7 @@ class ExtensionCrashRecoveryTestBase : public ExtensionBrowserTest { GetBackgroundHostForExtension(extension_id)); // Wait for extension crash balloon to appear. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } void CheckExtensionConsistency(std::string extension_id) { @@ -500,7 +500,7 @@ IN_PROC_BROWSER_TEST_F(MAYBE_ExtensionCrashRecoveryTest, ASSERT_EQ(1U, CountBalloons()); UninstallExtension(first_extension_id_); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); SCOPED_TRACE("after uninstalling"); ASSERT_EQ(size_before + 1, GetExtensionService()->extensions()->size()); diff --git a/chrome/browser/extensions/extension_disabled_ui.cc b/chrome/browser/extensions/extension_disabled_ui.cc index a39a0b5..3f0da2c 100644 --- a/chrome/browser/extensions/extension_disabled_ui.cc +++ b/chrome/browser/extensions/extension_disabled_ui.cc @@ -262,7 +262,7 @@ void ExtensionDisabledGlobalError::OnBubbleViewDidClose(Browser* browser) { void ExtensionDisabledGlobalError::BubbleViewAcceptButtonPressed( Browser* browser) { // Delay extension reenabling so this bubble closes properly. - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&ExtensionService::GrantPermissionsAndEnableExtension, service_->AsWeakPtr(), extension_)); } @@ -274,7 +274,7 @@ void ExtensionDisabledGlobalError::BubbleViewCancelButtonPressed( ExtensionUninstallDialog::Create(service_->profile(), browser, this)); // Delay showing the uninstall dialog, so that this function returns // immediately, to close the bubble properly. See crbug.com/121544. - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&ExtensionUninstallDialog::ConfirmUninstall, uninstall_dialog_->AsWeakPtr(), extension_)); #endif // !defined(OS_ANDROID) diff --git a/chrome/browser/extensions/extension_error_reporter.cc b/chrome/browser/extensions/extension_error_reporter.cc index e5abe83..9cbf944 100644 --- a/chrome/browser/extensions/extension_error_reporter.cc +++ b/chrome/browser/extensions/extension_error_reporter.cc @@ -29,7 +29,7 @@ ExtensionErrorReporter* ExtensionErrorReporter::GetInstance() { } ExtensionErrorReporter::ExtensionErrorReporter(bool enable_noisy_errors) - : ui_loop_(MessageLoop::current()), + : ui_loop_(base::MessageLoop::current()), enable_noisy_errors_(enable_noisy_errors) { } @@ -38,7 +38,7 @@ ExtensionErrorReporter::~ExtensionErrorReporter() {} void ExtensionErrorReporter::ReportError(const string16& message, bool be_noisy) { // NOTE: There won't be a ui_loop_ in the unit test environment. - if (ui_loop_ && MessageLoop::current() != ui_loop_) { + if (ui_loop_ && base::MessageLoop::current() != ui_loop_) { // base::Unretained is okay since the ExtensionErrorReporter is a singleton // that lives until the end of the process. ui_loop_->PostTask(FROM_HERE, diff --git a/chrome/browser/extensions/extension_function_test_utils.cc b/chrome/browser/extensions/extension_function_test_utils.cc index d834aa00..3104222 100644 --- a/chrome/browser/extensions/extension_function_test_utils.cc +++ b/chrome/browser/extensions/extension_function_test_utils.cc @@ -229,7 +229,7 @@ class SendResponseDelegate response_.reset(new bool); *response_ = success; if (should_post_quit_) { - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } diff --git a/chrome/browser/extensions/extension_host.cc b/chrome/browser/extensions/extension_host.cc index f980a82..6b97d397 100644 --- a/chrome/browser/extensions/extension_host.cc +++ b/chrome/browser/extensions/extension_host.cc @@ -96,7 +96,7 @@ class ExtensionHost::ProcessCreationQueue { // Queue up a delayed task to process the next ExtensionHost in the queue. void PostTask() { if (!pending_create_) { - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&ProcessCreationQueue::ProcessOneHost, ptr_factory_.GetWeakPtr())); pending_create_ = true; diff --git a/chrome/browser/extensions/extension_icon_image_unittest.cc b/chrome/browser/extensions/extension_icon_image_unittest.cc index fcb5af9..f6bee7f 100644 --- a/chrome/browser/extensions/extension_icon_image_unittest.cc +++ b/chrome/browser/extensions/extension_icon_image_unittest.cc @@ -82,7 +82,7 @@ class TestImageLoader { image_ = image; image_loaded_ = true; if (waiting_) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } SkBitmap LoadBitmap(const std::string& path, @@ -98,7 +98,7 @@ class TestImageLoader { // asynchronously), wait for it. if (!image_loaded_) { waiting_ = true; - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); waiting_ = false; } @@ -132,7 +132,7 @@ class ExtensionIconImageTest : public testing::Test, void WaitForImageLoad() { quit_in_image_loaded_ = true; - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); quit_in_image_loaded_ = false; } @@ -179,7 +179,7 @@ class ExtensionIconImageTest : public testing::Test, virtual void OnExtensionIconImageChanged(IconImage* image) OVERRIDE { image_loaded_count_++; if (quit_in_image_loaded_) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } gfx::ImageSkia GetDefaultIcon() { @@ -199,7 +199,7 @@ class ExtensionIconImageTest : public testing::Test, private: int image_loaded_count_; bool quit_in_image_loaded_; - MessageLoop ui_loop_; + base::MessageLoop ui_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/extensions/extension_icon_manager_unittest.cc b/chrome/browser/extensions/extension_icon_manager_unittest.cc index 98b5b13..d092c2d 100644 --- a/chrome/browser/extensions/extension_icon_manager_unittest.cc +++ b/chrome/browser/extensions/extension_icon_manager_unittest.cc @@ -35,14 +35,14 @@ class ExtensionIconManagerTest : public testing::Test { void ImageLoadObserved() { unwaited_image_loads_++; if (waiting_) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } void WaitForImageLoad() { if (unwaited_image_loads_ == 0) { waiting_ = true; - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); waiting_ = false; } ASSERT_GT(unwaited_image_loads_, 0); @@ -61,7 +61,7 @@ class ExtensionIconManagerTest : public testing::Test { // Whether we are currently waiting for an image load. bool waiting_; - MessageLoop ui_loop_; + base::MessageLoop ui_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/extensions/extension_info_map_unittest.cc b/chrome/browser/extensions/extension_info_map_unittest.cc index 561803a..932bd06 100644 --- a/chrome/browser/extensions/extension_info_map_unittest.cc +++ b/chrome/browser/extensions/extension_info_map_unittest.cc @@ -33,7 +33,7 @@ class ExtensionInfoMapTest : public testing::Test { } private: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; }; diff --git a/chrome/browser/extensions/extension_install_prompt.cc b/chrome/browser/extensions/extension_install_prompt.cc index 73b893c..b78f4d3 100644 --- a/chrome/browser/extensions/extension_install_prompt.cc +++ b/chrome/browser/extensions/extension_install_prompt.cc @@ -151,7 +151,7 @@ bool AutoConfirmPrompt(ExtensionInstallPrompt::Delegate* delegate) { // the real implementations it's highly likely the message loop will be // pumping a few times before the user clicks accept or cancel. if (value == "accept") { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ExtensionInstallPrompt::Delegate::InstallUIProceed, base::Unretained(delegate))); @@ -159,7 +159,7 @@ bool AutoConfirmPrompt(ExtensionInstallPrompt::Delegate* delegate) { } if (value == "cancel") { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ExtensionInstallPrompt::Delegate::InstallUIAbort, base::Unretained(delegate), @@ -414,7 +414,7 @@ scoped_refptr<Extension> ExtensionInstallPrompt::ExtensionInstallPrompt( content::WebContents* contents) : record_oauth2_grant_(false), - ui_loop_(MessageLoop::current()), + ui_loop_(base::MessageLoop::current()), extension_(NULL), install_ui_(ExtensionInstallUI::Create(ProfileForWebContents(contents))), show_params_(contents), @@ -428,7 +428,7 @@ ExtensionInstallPrompt::ExtensionInstallPrompt( gfx::NativeWindow native_window, content::PageNavigator* navigator) : record_oauth2_grant_(false), - ui_loop_(MessageLoop::current()), + ui_loop_(base::MessageLoop::current()), extension_(NULL), install_ui_(ExtensionInstallUI::Create(profile)), show_params_(native_window, navigator), @@ -443,7 +443,7 @@ ExtensionInstallPrompt::~ExtensionInstallPrompt() { void ExtensionInstallPrompt::ConfirmBundleInstall( extensions::BundleInstaller* bundle, const PermissionSet* permissions) { - DCHECK(ui_loop_ == MessageLoop::current()); + DCHECK(ui_loop_ == base::MessageLoop::current()); bundle_ = bundle; permissions_ = permissions; delegate_ = bundle; @@ -457,7 +457,7 @@ void ExtensionInstallPrompt::ConfirmStandaloneInstall( const Extension* extension, SkBitmap* icon, const ExtensionInstallPrompt::Prompt& prompt) { - DCHECK(ui_loop_ == MessageLoop::current()); + DCHECK(ui_loop_ == base::MessageLoop::current()); extension_ = extension; permissions_ = extension->GetActivePermissions(); delegate_ = delegate; @@ -483,7 +483,7 @@ void ExtensionInstallPrompt::ConfirmInstall( Delegate* delegate, const Extension* extension, const ShowDialogCallback& show_dialog_callback) { - DCHECK(ui_loop_ == MessageLoop::current()); + DCHECK(ui_loop_ == base::MessageLoop::current()); extension_ = extension; permissions_ = extension->GetActivePermissions(); delegate_ = delegate; @@ -510,7 +510,7 @@ void ExtensionInstallPrompt::ConfirmInstall( void ExtensionInstallPrompt::ConfirmReEnable(Delegate* delegate, const Extension* extension) { - DCHECK(ui_loop_ == MessageLoop::current()); + DCHECK(ui_loop_ == base::MessageLoop::current()); extension_ = extension; permissions_ = extension->GetActivePermissions(); delegate_ = delegate; @@ -523,7 +523,7 @@ void ExtensionInstallPrompt::ConfirmExternalInstall( Delegate* delegate, const Extension* extension, const ShowDialogCallback& show_dialog_callback) { - DCHECK(ui_loop_ == MessageLoop::current()); + DCHECK(ui_loop_ == base::MessageLoop::current()); extension_ = extension; permissions_ = extension->GetActivePermissions(); delegate_ = delegate; @@ -537,7 +537,7 @@ void ExtensionInstallPrompt::ConfirmPermissions( Delegate* delegate, const Extension* extension, const PermissionSet* permissions) { - DCHECK(ui_loop_ == MessageLoop::current()); + DCHECK(ui_loop_ == base::MessageLoop::current()); extension_ = extension; permissions_ = permissions; delegate_ = delegate; @@ -550,7 +550,7 @@ void ExtensionInstallPrompt::ConfirmIssueAdvice( Delegate* delegate, const Extension* extension, const IssueAdviceInfo& issue_advice) { - DCHECK(ui_loop_ == MessageLoop::current()); + DCHECK(ui_loop_ == base::MessageLoop::current()); extension_ = extension; delegate_ = delegate; prompt_.set_type(PERMISSIONS_PROMPT); @@ -563,7 +563,7 @@ void ExtensionInstallPrompt::ConfirmIssueAdvice( void ExtensionInstallPrompt::ReviewPermissions(Delegate* delegate, const Extension* extension) { - DCHECK(ui_loop_ == MessageLoop::current()); + DCHECK(ui_loop_ == base::MessageLoop::current()); extension_ = extension; permissions_ = extension->GetActivePermissions(); delegate_ = delegate; diff --git a/chrome/browser/extensions/extension_prefs_unittest.h b/chrome/browser/extensions/extension_prefs_unittest.h index c28673d1..eb3cf6c 100644 --- a/chrome/browser/extensions/extension_prefs_unittest.h +++ b/chrome/browser/extensions/extension_prefs_unittest.h @@ -46,7 +46,7 @@ class ExtensionPrefsTest : public testing::Test { protected: ExtensionPrefs* prefs() { return prefs_.prefs(); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; TestExtensionPrefs prefs_; diff --git a/chrome/browser/extensions/extension_process_manager.cc b/chrome/browser/extensions/extension_process_manager.cc index 6a6993c..8d67d77 100644 --- a/chrome/browser/extensions/extension_process_manager.cc +++ b/chrome/browser/extensions/extension_process_manager.cc @@ -431,7 +431,7 @@ int ExtensionProcessManager::DecrementLazyKeepaliveCount( int& count = background_page_data_[extension->id()].lazy_keepalive_count; DCHECK_GT(count, 0); if (--count == 0) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ExtensionProcessManager::OnLazyBackgroundPageIdle, weak_ptr_factory_.GetWeakPtr(), extension->id(), @@ -494,7 +494,7 @@ void ExtensionProcessManager::OnShouldSuspendAck( void ExtensionProcessManager::OnSuspendAck(const std::string& extension_id) { background_page_data_[extension_id].is_closing = true; int sequence_id = background_page_data_[extension_id].close_sequence_id; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ExtensionProcessManager::CloseLazyBackgroundPageNow, weak_ptr_factory_.GetWeakPtr(), extension_id, sequence_id), diff --git a/chrome/browser/extensions/extension_protocols_unittest.cc b/chrome/browser/extensions/extension_protocols_unittest.cc index 6b34e771..c9075a3 100644 --- a/chrome/browser/extensions/extension_protocols_unittest.cc +++ b/chrome/browser/extensions/extension_protocols_unittest.cc @@ -101,11 +101,11 @@ class ExtensionProtocolTest : public testing::Test { -1, -1); request->Start(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } protected: - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc index a1ad7e2..9037e6a 100644 --- a/chrome/browser/extensions/extension_service.cc +++ b/chrome/browser/extensions/extension_service.cc @@ -1970,7 +1970,7 @@ void ExtensionService::GarbageCollectExtensions() { // Don't garbage collect while there are pending installations, which may // be using the temporary installation directory. Try to garbage collect // again later. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ExtensionService::GarbageCollectExtensions, AsWeakPtr()), base::TimeDelta::FromSeconds(kGarbageCollectRetryDelay)); @@ -2647,7 +2647,7 @@ void ExtensionService::Observe(int type, // at all, but never half-crashed. We do it in a PostTask so // that other handlers of this notification will still have // access to the Extension and ExtensionHost. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind( &ExtensionService::TrackTerminatedExtension, @@ -2715,7 +2715,7 @@ void ExtensionService::Observe(int type, if (delayed_updates_for_idle_.Contains(extension_id)) { // We were waiting for this extension to become idle, it now might have, // so maybe finish installation. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ExtensionService::MaybeFinishDelayedInstallation, AsWeakPtr(), extension_id), diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc index 9df92a9..ac29e00 100644 --- a/chrome/browser/extensions/extension_service_unittest.cc +++ b/chrome/browser/extensions/extension_service_unittest.cc @@ -418,7 +418,7 @@ ExtensionServiceInitParams() // Our message loop may be used in tests which require it to be an IO loop. ExtensionServiceTestBase::ExtensionServiceTestBase() - : loop_(MessageLoop::TYPE_IO), + : loop_(base::MessageLoop::TYPE_IO), service_(NULL), management_policy_(NULL), expected_extensions_count_(0), @@ -441,9 +441,9 @@ ExtensionServiceTestBase::~ExtensionServiceTestBase() { // can be destroyed while BrowserThreads and MessageLoop are still around // (they are used in the destruction process). service_ = NULL; - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); profile_.reset(NULL); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } void ExtensionServiceTestBase::InitializeExtensionService( @@ -1126,7 +1126,7 @@ void PackExtensionTestClient::OnPackSuccess( // on with the rest of the test. // This call to |Quit()| matches the call to |Run()| in the // |PackPunctuatedExtension| test. - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); EXPECT_EQ(expected_crx_path_.value(), crx_path.value()); EXPECT_EQ(expected_private_key_path_.value(), private_key_path.value()); ASSERT_TRUE(file_util::PathExists(private_key_path)); @@ -2027,7 +2027,7 @@ TEST_F(ExtensionServiceTest, PackPunctuatedExtension) { // block and catch the notification; otherwise, the process would exit. // This call to |Run()| is matched by a call to |Quit()| in the // |PackExtensionTestClient|'s notification handling code. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); if (HasFatalFailure()) return; @@ -3812,22 +3812,22 @@ class ExtensionCookieCallback { public: ExtensionCookieCallback() : result_(false), - weak_factory_(MessageLoop::current()) {} + weak_factory_(base::MessageLoop::current()) {} void SetCookieCallback(bool result) { - MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&MessageLoop::Quit, weak_factory_.GetWeakPtr())); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::Bind(&base::MessageLoop::Quit, weak_factory_.GetWeakPtr())); result_ = result; } void GetAllCookiesCallback(const net::CookieList& list) { - MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&MessageLoop::Quit, weak_factory_.GetWeakPtr())); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::Bind(&base::MessageLoop::Quit, weak_factory_.GetWeakPtr())); list_ = list; } net::CookieList list_; bool result_; - base::WeakPtrFactory<MessageLoop> weak_factory_; + base::WeakPtrFactory<base::MessageLoop> weak_factory_; }; // Verifies extension state is removed upon uninstall. @@ -4643,7 +4643,7 @@ TEST(ExtensionServiceTestSimple, Enabledness) { ExtensionErrorReporter::Init(false); // no noisy errors ExtensionsReadyRecorder recorder; scoped_ptr<TestingProfile> profile(new TestingProfile()); - MessageLoop loop; + base::MessageLoop loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &loop); content::TestBrowserThread file_thread(BrowserThread::FILE, &loop); #if defined OS_CHROMEOS diff --git a/chrome/browser/extensions/extension_service_unittest.h b/chrome/browser/extensions/extension_service_unittest.h index 80d50c8..1c09479 100644 --- a/chrome/browser/extensions/extension_service_unittest.h +++ b/chrome/browser/extensions/extension_service_unittest.h @@ -69,7 +69,7 @@ class ExtensionServiceTestBase : public testing::Test { void InitializeExtensionServiceHelper(bool autoupdate_enabled, bool is_first_run); - MessageLoop loop_; + base::MessageLoop loop_; base::ShadowingAtExitManager at_exit_manager_; base::ScopedTempDir temp_dir_; scoped_ptr<TestingProfile> profile_; diff --git a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc index 33e1394..257b8ec 100644 --- a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc +++ b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc @@ -300,7 +300,7 @@ TEST_F(ExtensionSpecialStoragePolicyTest, OverlappingApps) { } TEST_F(ExtensionSpecialStoragePolicyTest, HasSessionOnlyOrigins) { - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); TestingProfile profile; @@ -335,7 +335,7 @@ TEST_F(ExtensionSpecialStoragePolicyTest, HasSessionOnlyOrigins) { } TEST_F(ExtensionSpecialStoragePolicyTest, NotificationTest) { - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); content::TestBrowserThread io_thread(BrowserThread::IO, &message_loop); diff --git a/chrome/browser/extensions/extension_test_message_listener.cc b/chrome/browser/extensions/extension_test_message_listener.cc index e892ba1..f548ac1 100644 --- a/chrome/browser/extensions/extension_test_message_listener.cc +++ b/chrome/browser/extensions/extension_test_message_listener.cc @@ -63,7 +63,7 @@ void ExtensionTestMessageListener::Observe( } if (waiting_) { waiting_ = false; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } } diff --git a/chrome/browser/extensions/extension_ui_unittest.cc b/chrome/browser/extensions/extension_ui_unittest.cc index 10b3ecc..b99aa93 100644 --- a/chrome/browser/extensions/extension_ui_unittest.cc +++ b/chrome/browser/extensions/extension_ui_unittest.cc @@ -118,7 +118,7 @@ class ExtensionUITest : public testing::Test { } } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; scoped_ptr<TestingProfile> profile_; diff --git a/chrome/browser/extensions/extension_uninstall_dialog.cc b/chrome/browser/extensions/extension_uninstall_dialog.cc index 1bde628..f7881a5 100644 --- a/chrome/browser/extensions/extension_uninstall_dialog.cc +++ b/chrome/browser/extensions/extension_uninstall_dialog.cc @@ -56,7 +56,7 @@ ExtensionUninstallDialog::ExtensionUninstallDialog( delegate_(delegate), extension_(NULL), state_(kImageIsLoading), - ui_loop_(MessageLoop::current()) { + ui_loop_(base::MessageLoop::current()) { if (browser) { registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED, @@ -69,7 +69,7 @@ ExtensionUninstallDialog::~ExtensionUninstallDialog() { void ExtensionUninstallDialog::ConfirmUninstall( const extensions::Extension* extension) { - DCHECK(ui_loop_ == MessageLoop::current()); + DCHECK(ui_loop_ == base::MessageLoop::current()); extension_ = extension; extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource( extension_, diff --git a/chrome/browser/extensions/extensions_quota_service.cc b/chrome/browser/extensions/extensions_quota_service.cc index 6b267a5..bd34b1f 100644 --- a/chrome/browser/extensions/extensions_quota_service.cc +++ b/chrome/browser/extensions/extensions_quota_service.cc @@ -21,7 +21,7 @@ const char kOverQuotaError[] = "This request exceeds the * quota."; } // namespace ExtensionsQuotaService::ExtensionsQuotaService() { - if (MessageLoop::current() != NULL) { // Null in unit tests. + if (base::MessageLoop::current() != NULL) { // Null in unit tests. purge_timer_.Start(FROM_HERE, base::TimeDelta::FromDays(kPurgeIntervalInDays), this, &ExtensionsQuotaService::Purge); diff --git a/chrome/browser/extensions/extensions_quota_service_unittest.cc b/chrome/browser/extensions/extensions_quota_service_unittest.cc index 2d02bfc..7a113bd 100644 --- a/chrome/browser/extensions/extensions_quota_service_unittest.cc +++ b/chrome/browser/extensions/extensions_quota_service_unittest.cc @@ -140,7 +140,7 @@ class ExtensionsQuotaServiceTest : public testing::Test { std::string extension_b_; std::string extension_c_; scoped_ptr<ExtensionsQuotaService> service_; - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; }; diff --git a/chrome/browser/extensions/external_policy_loader_unittest.cc b/chrome/browser/extensions/external_policy_loader_unittest.cc index 75bd788..28ce8aa 100644 --- a/chrome/browser/extensions/external_policy_loader_unittest.cc +++ b/chrome/browser/extensions/external_policy_loader_unittest.cc @@ -27,7 +27,7 @@ namespace extensions { class ExternalPolicyLoaderTest : public testing::Test { public: ExternalPolicyLoaderTest() - : loop_(MessageLoop::TYPE_IO), + : loop_(base::MessageLoop::TYPE_IO), ui_thread_(BrowserThread::UI, &loop_) { } @@ -36,7 +36,7 @@ class ExternalPolicyLoaderTest : public testing::Test { private: // We need these to satisfy BrowserThread::CurrentlyOn(BrowserThread::UI) // checks in ExternalProviderImpl. - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; }; diff --git a/chrome/browser/extensions/image_loader_unittest.cc b/chrome/browser/extensions/image_loader_unittest.cc index c34f128..04cf2c9 100644 --- a/chrome/browser/extensions/image_loader_unittest.cc +++ b/chrome/browser/extensions/image_loader_unittest.cc @@ -43,13 +43,13 @@ class ImageLoaderTest : public testing::Test { void OnImageLoaded(const gfx::Image& image) { image_loaded_count_++; if (quit_in_image_loaded_) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); image_ = image; } void WaitForImageLoad() { quit_in_image_loaded_ = true; - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); quit_in_image_loaded_ = false; } @@ -105,7 +105,7 @@ class ImageLoaderTest : public testing::Test { int image_loaded_count_; bool quit_in_image_loaded_; - MessageLoop ui_loop_; + base::MessageLoop ui_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/extensions/installed_loader.cc b/chrome/browser/extensions/installed_loader.cc index 20712d9..2a6d97b 100644 --- a/chrome/browser/extensions/installed_loader.cc +++ b/chrome/browser/extensions/installed_loader.cc @@ -173,7 +173,7 @@ void InstalledLoader::LoadAllExtensions() { old_version = Version(version_str); } } - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&DispatchOnInstalledEvent, extension_service_->profile(), info->extension_id, old_version, false)); diff --git a/chrome/browser/extensions/menu_manager_unittest.cc b/chrome/browser/extensions/menu_manager_unittest.cc index 27f0020..66430f2 100644 --- a/chrome/browser/extensions/menu_manager_unittest.cc +++ b/chrome/browser/extensions/menu_manager_unittest.cc @@ -84,7 +84,7 @@ class MenuManagerTest : public testing::Test { protected: TestingProfile profile_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/extensions/pack_extension_unittest.cc b/chrome/browser/extensions/pack_extension_unittest.cc index f83a3f4..5198be2 100644 --- a/chrome/browser/extensions/pack_extension_unittest.cc +++ b/chrome/browser/extensions/pack_extension_unittest.cc @@ -38,7 +38,7 @@ class PackExtensionTest : public testing::Test { return startup_helper_.PackExtension(command_line); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/extensions/page_action_controller_unittest.cc b/chrome/browser/extensions/page_action_controller_unittest.cc index b18d9c8..5268a9a 100644 --- a/chrome/browser/extensions/page_action_controller_unittest.cc +++ b/chrome/browser/extensions/page_action_controller_unittest.cc @@ -36,8 +36,8 @@ namespace { class PageActionControllerTest : public ChromeRenderViewHostTestHarness { public: PageActionControllerTest() - : ui_thread_(BrowserThread::UI, MessageLoop::current()), - file_thread_(BrowserThread::FILE, MessageLoop::current()) {} + : ui_thread_(BrowserThread::UI, base::MessageLoop::current()), + file_thread_(BrowserThread::FILE, base::MessageLoop::current()) {} virtual void SetUp() OVERRIDE { ChromeRenderViewHostTestHarness::SetUp(); diff --git a/chrome/browser/extensions/permissions_updater_unittest.cc b/chrome/browser/extensions/permissions_updater_unittest.cc index 8552b61..14a52e8 100644 --- a/chrome/browser/extensions/permissions_updater_unittest.cc +++ b/chrome/browser/extensions/permissions_updater_unittest.cc @@ -75,7 +75,7 @@ class PermissionsUpdaterListener : public content::NotificationObserver { if (waiting_) { waiting_ = false; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } diff --git a/chrome/browser/extensions/sandboxed_unpacker_unittest.cc b/chrome/browser/extensions/sandboxed_unpacker_unittest.cc index ddb56c01..4a97f57 100644 --- a/chrome/browser/extensions/sandboxed_unpacker_unittest.cc +++ b/chrome/browser/extensions/sandboxed_unpacker_unittest.cc @@ -159,7 +159,7 @@ class SandboxedUnpackerTest : public testing::Test { MockSandboxedUnpackerClient* client_; scoped_ptr<Unpacker> unpacker_; scoped_refptr<SandboxedUnpacker> sandboxed_unpacker_; - MessageLoop loop_; + base::MessageLoop loop_; scoped_ptr<content::TestBrowserThread> file_thread_; }; diff --git a/chrome/browser/extensions/script_badge_controller_unittest.cc b/chrome/browser/extensions/script_badge_controller_unittest.cc index 9600018..ee17b94 100644 --- a/chrome/browser/extensions/script_badge_controller_unittest.cc +++ b/chrome/browser/extensions/script_badge_controller_unittest.cc @@ -46,8 +46,8 @@ class ScriptBadgeControllerTest : public ChromeRenderViewHostTestHarness { public: ScriptBadgeControllerTest() : feature_override_(FeatureSwitch::script_badges(), true), - ui_thread_(BrowserThread::UI, MessageLoop::current()), - file_thread_(BrowserThread::FILE, MessageLoop::current()), + ui_thread_(BrowserThread::UI, base::MessageLoop::current()), + file_thread_(BrowserThread::FILE, base::MessageLoop::current()), current_channel_(chrome::VersionInfo::CHANNEL_DEV) {} virtual void SetUp() OVERRIDE { diff --git a/chrome/browser/extensions/script_bubble_controller_unittest.cc b/chrome/browser/extensions/script_bubble_controller_unittest.cc index b339d0f..36fe5b9 100644 --- a/chrome/browser/extensions/script_bubble_controller_unittest.cc +++ b/chrome/browser/extensions/script_bubble_controller_unittest.cc @@ -39,8 +39,8 @@ namespace { class ScriptBubbleControllerTest : public ChromeRenderViewHostTestHarness { public: ScriptBubbleControllerTest() - : ui_thread_(BrowserThread::UI, MessageLoop::current()), - file_thread_(BrowserThread::FILE, MessageLoop::current()), + : ui_thread_(BrowserThread::UI, base::MessageLoop::current()), + file_thread_(BrowserThread::FILE, base::MessageLoop::current()), enable_script_bubble_(FeatureSwitch::script_bubble(), true) { } diff --git a/chrome/browser/extensions/standard_management_policy_provider_unittest.cc b/chrome/browser/extensions/standard_management_policy_provider_unittest.cc index 52a396f..05a00a0 100644 --- a/chrome/browser/extensions/standard_management_policy_provider_unittest.cc +++ b/chrome/browser/extensions/standard_management_policy_provider_unittest.cc @@ -41,7 +41,7 @@ class StandardManagementPolicyProviderTest : public testing::Test { return extension; } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/extensions/startup_helper.cc b/chrome/browser/extensions/startup_helper.cc index 77dc2d2..80c2837 100644 --- a/chrome/browser/extensions/startup_helper.cc +++ b/chrome/browser/extensions/startup_helper.cc @@ -298,9 +298,9 @@ bool StartupHelper::InstallFromWebstore(const CommandLine& cmd_line, AppInstallHelper helper; helper.BeginInstall(profile, id, !cmd_line.HasSwitch(switches::kForceAppMode), - MessageLoop::QuitWhenIdleClosure()); + base::MessageLoop::QuitWhenIdleClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); if (!helper.success()) LOG(ERROR) << "InstallFromWebstore failed with error: " << helper.error(); return helper.success(); diff --git a/chrome/browser/extensions/state_store.cc b/chrome/browser/extensions/state_store.cc index f46685b..f1d09bc 100644 --- a/chrome/browser/extensions/state_store.cc +++ b/chrome/browser/extensions/state_store.cc @@ -143,7 +143,7 @@ void StateStore::Observe(int type, content::NotificationService::AllSources()); registrar_.Remove(this, chrome::NOTIFICATION_SESSION_RESTORE_DONE, content::NotificationService::AllSources()); - MessageLoop::current()->PostDelayedTask(FROM_HERE, + base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&StateStore::Init, AsWeakPtr()), base::TimeDelta::FromSeconds(kInitDelaySeconds)); break; diff --git a/chrome/browser/extensions/test_extension_environment.h b/chrome/browser/extensions/test_extension_environment.h index 825a571..a193345 100644 --- a/chrome/browser/extensions/test_extension_environment.h +++ b/chrome/browser/extensions/test_extension_environment.h @@ -57,7 +57,7 @@ class TestExtensionEnvironment { scoped_ptr<content::WebContents> MakeTab() const; private: - MessageLoopForUI loop_; + base::MessageLoopForUI loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; content::TestBrowserThread file_blocking_thread_; diff --git a/chrome/browser/extensions/updater/extension_updater_unittest.cc b/chrome/browser/extensions/updater/extension_updater_unittest.cc index 281cfad..edd4281 100644 --- a/chrome/browser/extensions/updater/extension_updater_unittest.cc +++ b/chrome/browser/extensions/updater/extension_updater_unittest.cc @@ -1468,7 +1468,7 @@ class ExtensionUpdaterTest : public testing::Test { scoped_ptr<TestExtensionPrefs> prefs_; private: - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/extensions/user_script_listener_unittest.cc b/chrome/browser/extensions/user_script_listener_unittest.cc index ed379bb..18d899a 100644 --- a/chrome/browser/extensions/user_script_listener_unittest.cc +++ b/chrome/browser/extensions/user_script_listener_unittest.cc @@ -143,14 +143,14 @@ class UserScriptListenerTest : public ExtensionServiceTestBase { InitializeEmptyExtensionService(); service_->Init(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); listener_ = new UserScriptListener(); } virtual void TearDown() OVERRIDE { listener_ = NULL; - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ExtensionServiceTestBase::TearDown(); } @@ -203,7 +203,7 @@ namespace { TEST_F(UserScriptListenerTest, DelayAndUpdate) { LoadTestExtension(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); net::TestDelegate delegate; net::TestURLRequestContext context; @@ -215,13 +215,13 @@ TEST_F(UserScriptListenerTest, DelayAndUpdate) { chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, content::Source<Profile>(profile_.get()), content::NotificationService::NoDetails()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(kTestData, delegate.data_received()); } TEST_F(UserScriptListenerTest, DelayAndUnload) { LoadTestExtension(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); net::TestDelegate delegate; net::TestURLRequestContext context; @@ -230,7 +230,7 @@ TEST_F(UserScriptListenerTest, DelayAndUnload) { ASSERT_FALSE(request->is_pending()); UnloadTestExtension(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // This is still not enough to start delayed requests. We have to notify the // listener that the user scripts have been updated. @@ -240,7 +240,7 @@ TEST_F(UserScriptListenerTest, DelayAndUnload) { chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, content::Source<Profile>(profile_.get()), content::NotificationService::NoDetails()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(kTestData, delegate.data_received()); } @@ -253,13 +253,13 @@ TEST_F(UserScriptListenerTest, NoDelayNoExtension) { // The request should be started immediately. ASSERT_TRUE(request->is_pending()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(kTestData, delegate.data_received()); } TEST_F(UserScriptListenerTest, NoDelayNotMatching) { LoadTestExtension(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); net::TestDelegate delegate; net::TestURLRequestContext context; @@ -270,13 +270,13 @@ TEST_F(UserScriptListenerTest, NoDelayNotMatching) { // The request should be started immediately. ASSERT_TRUE(request->is_pending()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(kTestData, delegate.data_received()); } TEST_F(UserScriptListenerTest, MultiProfile) { LoadTestExtension(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Fire up a second profile and have it load and extension with a content // script. @@ -303,7 +303,7 @@ TEST_F(UserScriptListenerTest, MultiProfile) { chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, content::Source<Profile>(profile_.get()), content::NotificationService::NoDetails()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_FALSE(request->is_pending()); EXPECT_TRUE(delegate.data_received().empty()); @@ -312,7 +312,7 @@ TEST_F(UserScriptListenerTest, MultiProfile) { chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, content::Source<Profile>(&profile2), content::NotificationService::NoDetails()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(kTestData, delegate.data_received()); } @@ -321,7 +321,7 @@ TEST_F(UserScriptListenerTest, MultiProfile) { // throttles. TEST_F(UserScriptListenerTest, ResumeBeforeStart) { LoadTestExtension(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); net::TestDelegate delegate; net::TestURLRequestContext context; GURL url(kMatchingUrl); @@ -339,7 +339,7 @@ TEST_F(UserScriptListenerTest, ResumeBeforeStart) { chrome::NOTIFICATION_USER_SCRIPTS_UPDATED, content::Source<Profile>(profile_.get()), content::NotificationService::NoDetails()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); bool defer = false; throttle->WillStartRequest(&defer); diff --git a/chrome/browser/extensions/user_script_master_unittest.cc b/chrome/browser/extensions/user_script_master_unittest.cc index d71dd2a..a272ea1 100644 --- a/chrome/browser/extensions/user_script_master_unittest.cc +++ b/chrome/browser/extensions/user_script_master_unittest.cc @@ -40,7 +40,7 @@ class UserScriptMasterTest : public testing::Test, public content::NotificationObserver { public: UserScriptMasterTest() - : message_loop_(MessageLoop::TYPE_UI), + : message_loop_(base::MessageLoop::TYPE_UI), shared_memory_(NULL) { } @@ -54,9 +54,9 @@ class UserScriptMasterTest : public testing::Test, // UserScriptMaster posts tasks to the file thread so make the current // thread look like one. file_thread_.reset(new content::TestBrowserThread( - BrowserThread::FILE, MessageLoop::current())); + BrowserThread::FILE, base::MessageLoop::current())); ui_thread_.reset(new content::TestBrowserThread( - BrowserThread::UI, MessageLoop::current())); + BrowserThread::UI, base::MessageLoop::current())); } virtual void TearDown() { @@ -70,8 +70,8 @@ class UserScriptMasterTest : public testing::Test, DCHECK(type == chrome::NOTIFICATION_USER_SCRIPTS_UPDATED); shared_memory_ = content::Details<base::SharedMemory>(details).ptr(); - if (MessageLoop::current() == &message_loop_) - MessageLoop::current()->Quit(); + if (base::MessageLoop::current() == &message_loop_) + base::MessageLoop::current()->Quit(); } // Directory containing user scripts. @@ -80,7 +80,7 @@ class UserScriptMasterTest : public testing::Test, content::NotificationRegistrar registrar_; // MessageLoop used in tests. - MessageLoop message_loop_; + base::MessageLoop message_loop_; scoped_ptr<content::TestBrowserThread> file_thread_; scoped_ptr<content::TestBrowserThread> ui_thread_; @@ -94,7 +94,7 @@ TEST_F(UserScriptMasterTest, NoScripts) { TestingProfile profile; scoped_refptr<UserScriptMaster> master(new UserScriptMaster(&profile)); master->StartLoad(); - message_loop_.PostTask(FROM_HERE, MessageLoop::QuitClosure()); + message_loop_.PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); message_loop_.Run(); ASSERT_TRUE(shared_memory_ != NULL); diff --git a/chrome/browser/extensions/webstore_startup_installer_browsertest.cc b/chrome/browser/extensions/webstore_startup_installer_browsertest.cc index 8a02c4c..d55ac8b 100644 --- a/chrome/browser/extensions/webstore_startup_installer_browsertest.cc +++ b/chrome/browser/extensions/webstore_startup_installer_browsertest.cc @@ -357,8 +357,8 @@ IN_PROC_BROWSER_TEST_F(CommandLineWebstoreInstall, LimitedAccept) { command_line->AppendSwitchASCII( switches::kLimitedInstallFromWebstore, "2"); helper.LimitedInstallFromWebstore(*command_line, browser()->profile(), - MessageLoop::QuitWhenIdleClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::QuitWhenIdleClosure()); + base::MessageLoop::current()->Run(); EXPECT_TRUE(saw_install()); EXPECT_EQ(0, browser_open_count()); diff --git a/chrome/browser/external_protocol/external_protocol_handler.cc b/chrome/browser/external_protocol/external_protocol_handler.cc index faaecc3..a1aac4d 100644 --- a/chrome/browser/external_protocol/external_protocol_handler.cc +++ b/chrome/browser/external_protocol/external_protocol_handler.cc @@ -96,7 +96,7 @@ class ExternalDefaultProtocolObserver virtual void SetDefaultWebClientUIState( ShellIntegration::DefaultWebClientUIState state) OVERRIDE { - DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); + DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); // If we are still working out if we're the default, or we've found // out we definately are the default, we end here. @@ -247,7 +247,7 @@ void ExternalProtocolHandler::LaunchUrlWithDelegate(const GURL& url, int render_process_host_id, int tab_contents_id, Delegate* delegate) { - DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); + DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); // Escape the input scheme to be sure that the command does not // have parameters unexpected by the external program. @@ -303,6 +303,6 @@ void ExternalProtocolHandler::RegisterPrefs(PrefRegistrySimple* registry) { // static void ExternalProtocolHandler::PermitLaunchUrl() { - DCHECK_EQ(MessageLoop::TYPE_UI, MessageLoop::current()->type()); + DCHECK_EQ(base::MessageLoop::TYPE_UI, base::MessageLoop::current()->type()); g_accept_requests = true; } diff --git a/chrome/browser/external_protocol/external_protocol_handler_unittest.cc b/chrome/browser/external_protocol/external_protocol_handler_unittest.cc index faf5704..d8a3679 100644 --- a/chrome/browser/external_protocol/external_protocol_handler_unittest.cc +++ b/chrome/browser/external_protocol/external_protocol_handler_unittest.cc @@ -74,7 +74,7 @@ class FakeExternalProtocolHandlerDelegate } virtual void FinishedProcessingCheck() OVERRIDE { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void set_os_state(ShellIntegration::DefaultWebClientState value) { @@ -100,7 +100,7 @@ class FakeExternalProtocolHandlerDelegate class ExternalProtocolHandlerTest : public testing::Test { protected: ExternalProtocolHandlerTest() - : ui_thread_(BrowserThread::UI, MessageLoop::current()), + : ui_thread_(BrowserThread::UI, base::MessageLoop::current()), file_thread_(BrowserThread::FILE) {} virtual void SetUp() { @@ -124,14 +124,14 @@ class ExternalProtocolHandlerTest : public testing::Test { delegate_.set_os_state(os_state); ExternalProtocolHandler::LaunchUrlWithDelegate(url, 0, 0, &delegate_); if (block_state != ExternalProtocolHandler::BLOCK) - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ASSERT_EQ(should_prompt, delegate_.has_prompted()); ASSERT_EQ(should_launch, delegate_.has_launched()); ASSERT_EQ(should_block, delegate_.has_blocked()); } - MessageLoopForUI ui_message_loop_; + base::MessageLoopForUI ui_message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/feedback/feedback_util.cc b/chrome/browser/feedback/feedback_util.cc index 4a3ee74..456d21f 100644 --- a/chrome/browser/feedback/feedback_util.cc +++ b/chrome/browser/feedback/feedback_util.cc @@ -176,7 +176,7 @@ void FeedbackUtil::DispatchFeedback(Profile* profile, int64 delay) { DCHECK(post_body); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&FeedbackUtil::SendFeedback, profile, post_body, delay), base::TimeDelta::FromMilliseconds(delay)); diff --git a/chrome/browser/first_run/first_run.cc b/chrome/browser/first_run/first_run.cc index 9ff9d5b..f5c40b3 100644 --- a/chrome/browser/first_run/first_run.cc +++ b/chrome/browser/first_run/first_run.cc @@ -88,7 +88,7 @@ class ImportEndedObserver : public importer::ImporterProgressObserver { virtual void ImportEnded() OVERRIDE { ended_ = true; if (should_quit_message_loop_) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void set_should_quit_message_loop() { @@ -244,7 +244,7 @@ void ImportFromSourceProfile(ImporterHost* importer_host, // If the import process has not errored out, block on it. if (!observer.ended()) { observer.set_should_quit_message_loop(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } } diff --git a/chrome/browser/first_run/try_chrome_dialog_view.cc b/chrome/browser/first_run/try_chrome_dialog_view.cc index dee183f..3678ed1 100644 --- a/chrome/browser/first_run/try_chrome_dialog_view.cc +++ b/chrome/browser/first_run/try_chrome_dialog_view.cc @@ -301,7 +301,7 @@ TryChromeDialogView::Result TryChromeDialogView::ShowModal( popup_->Show(); if (!listener.is_null()) listener.Run(popup_->GetNativeView()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); if (!listener.is_null()) listener.Run(NULL); return result_; @@ -374,7 +374,7 @@ void TryChromeDialogView::ButtonPressed(views::Button* sender, } popup_->Close(); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void TryChromeDialogView::LinkClicked(views::Link* source, int event_flags) { diff --git a/chrome/browser/geolocation/access_token_store_browsertest.cc b/chrome/browser/geolocation/access_token_store_browsertest.cc index c964546..58fa159 100644 --- a/chrome/browser/geolocation/access_token_store_browsertest.cc +++ b/chrome/browser/geolocation/access_token_store_browsertest.cc @@ -100,7 +100,7 @@ void GeolocationAccessTokenStoreTest::OnAccessTokenStoresLoaded( store->SaveAccessToken(ref_url_, *token_to_set_); } BrowserThread::PostTask( - BrowserThread::UI, FROM_HERE, MessageLoop::QuitClosure()); + BrowserThread::UI, FROM_HERE, base::MessageLoop::QuitClosure()); } IN_PROC_BROWSER_TEST_F(GeolocationAccessTokenStoreTest, SetAcrossInstances) { diff --git a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc index 2e0de99..88c0f45 100644 --- a/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc +++ b/chrome/browser/geolocation/chrome_geolocation_permission_context_unittest.cc @@ -149,7 +149,7 @@ class GeolocationPermissionContextTests GeolocationPermissionContextTests::GeolocationPermissionContextTests() : ChromeRenderViewHostTestHarness(), - ui_thread_(content::BrowserThread::UI, MessageLoop::current()), + ui_thread_(content::BrowserThread::UI, base::MessageLoop::current()), db_thread_(content::BrowserThread::DB) { } diff --git a/chrome/browser/geolocation/geolocation_browsertest.cc b/chrome/browser/geolocation/geolocation_browsertest.cc index 8b715c7..797b401 100644 --- a/chrome/browser/geolocation/geolocation_browsertest.cc +++ b/chrome/browser/geolocation/geolocation_browsertest.cc @@ -116,7 +116,7 @@ void IFrameLoader::Observe(int type, javascript_completed_ = true; } if (javascript_completed_ && navigation_completed_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } @@ -194,9 +194,9 @@ void GeolocationNotificationObserver::Observe( // We're either waiting for just the inforbar, or for both a javascript // prompt and response. if (wait_for_infobar_ && infobar_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); else if (navigation_completed_ && !javascript_response_.empty()) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } void GeolocationNotificationObserver::AddWatchAndWaitForNotification( diff --git a/chrome/browser/geolocation/geolocation_infobar_queue_controller_unittest.cc b/chrome/browser/geolocation/geolocation_infobar_queue_controller_unittest.cc index 1322684..30586cd 100644 --- a/chrome/browser/geolocation/geolocation_infobar_queue_controller_unittest.cc +++ b/chrome/browser/geolocation/geolocation_infobar_queue_controller_unittest.cc @@ -31,7 +31,7 @@ class GeolocationInfoBarQueueControllerTests }; GeolocationInfoBarQueueControllerTests::GeolocationInfoBarQueueControllerTests() - : ui_thread_(content::BrowserThread::UI, MessageLoop::current()) { + : ui_thread_(content::BrowserThread::UI, base::MessageLoop::current()) { } GeolocationPermissionRequestID diff --git a/chrome/browser/geolocation/geolocation_settings_state_unittest.cc b/chrome/browser/geolocation/geolocation_settings_state_unittest.cc index fadcce6..b6b5f8f 100644 --- a/chrome/browser/geolocation/geolocation_settings_state_unittest.cc +++ b/chrome/browser/geolocation/geolocation_settings_state_unittest.cc @@ -25,7 +25,7 @@ class GeolocationSettingsStateTests : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; }; diff --git a/chrome/browser/google/google_update_win.cc b/chrome/browser/google/google_update_win.cc index cfa08c6..bd73a74 100644 --- a/chrome/browser/google/google_update_win.cc +++ b/chrome/browser/google/google_update_win.cc @@ -176,7 +176,7 @@ class GoogleUpdateJobObserver // No longer need to spin the message loop that started spinning in // InitiateGoogleUpdateCheck. - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); return S_OK; } STDMETHOD(SetEventSink)(IProgressWndEvents* event_sink) { @@ -238,7 +238,7 @@ void GoogleUpdate::CheckForUpdate(bool install_if_newer, HWND window) { BrowserThread::PostTask( BrowserThread::FILE, FROM_HERE, base::Bind(&GoogleUpdate::InitiateGoogleUpdateCheck, this, - install_if_newer, window, MessageLoop::current())); + install_if_newer, window, base::MessageLoop::current())); } //////////////////////////////////////////////////////////////////////////////// @@ -246,7 +246,7 @@ void GoogleUpdate::CheckForUpdate(bool install_if_newer, HWND window) { void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, HWND window, - MessageLoop* main_loop) { + base::MessageLoop* main_loop) { base::FilePath chrome_exe; if (!PathService::Get(base::DIR_EXE, &chrome_exe)) NOTREACHED(); @@ -337,7 +337,7 @@ void GoogleUpdate::InitiateGoogleUpdateCheck(bool install_if_newer, // can report back to us through GoogleUpdateJobObserver. This message loop // will terminate once Google Update sends us the completion status // (success/error). See OnComplete(). - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); GoogleUpdateUpgradeResult results; hr = job_observer->GetResult(&results); @@ -395,7 +395,7 @@ void GoogleUpdate::ReportResults(GoogleUpdateUpgradeResult results, bool GoogleUpdate::ReportFailure(HRESULT hr, GoogleUpdateErrorCode error_code, const string16& error_message, - MessageLoop* main_loop) { + base::MessageLoop* main_loop) { NOTREACHED() << "Communication with Google Update failed: " << hr << " error: " << error_code << ", message: " << error_message.c_str(); diff --git a/chrome/browser/google/google_url_tracker.cc b/chrome/browser/google/google_url_tracker.cc index 67926fa..521d48d 100644 --- a/chrome/browser/google/google_url_tracker.cc +++ b/chrome/browser/google/google_url_tracker.cc @@ -61,7 +61,7 @@ GoogleURLTracker::GoogleURLTracker( // "wakes up", we do nothing at all. if (mode == NORMAL_MODE) { static const int kStartFetchDelayMS = 5000; - MessageLoop::current()->PostDelayedTask(FROM_HERE, + base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&GoogleURLTracker::FinishSleep, weak_ptr_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(kStartFetchDelayMS)); diff --git a/chrome/browser/google/google_url_tracker_unittest.cc b/chrome/browser/google/google_url_tracker_unittest.cc index 91bb0a5..8f999a7 100644 --- a/chrome/browser/google/google_url_tracker_unittest.cc +++ b/chrome/browser/google/google_url_tracker_unittest.cc @@ -249,7 +249,7 @@ class GoogleURLTrackerTest : public testing::Test { // These are required by the TestURLFetchers GoogleURLTracker will create (see // test_url_fetcher_factory.h). - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread io_thread_; // Creating this allows us to call // net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(). @@ -283,7 +283,7 @@ void GoogleURLTrackerTest::OnInfoBarClosed(InfoBarDelegate* infobar, } GoogleURLTrackerTest::GoogleURLTrackerTest() - : message_loop_(MessageLoop::TYPE_IO), + : message_loop_(base::MessageLoop::TYPE_IO), io_thread_(content::BrowserThread::IO, &message_loop_) { GoogleURLTrackerFactory::GetInstance()->RegisterUserPrefsOnBrowserContext( &profile_); @@ -351,7 +351,7 @@ void GoogleURLTrackerTest::NotifyIPAddressChanged() { net::NetworkChangeNotifier::NotifyObserversOfIPAddressChangeForTests(); // For thread safety, the NCN queues tasks to do the actual notifications, so // we need to spin the message loop so the tracker will actually be notified. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } void GoogleURLTrackerTest::SetLastPromptedGoogleURL(const GURL& url) { diff --git a/chrome/browser/google_apis/base_operations_server_unittest.cc b/chrome/browser/google_apis/base_operations_server_unittest.cc index 2cb2488..29b50bb 100644 --- a/chrome/browser/google_apis/base_operations_server_unittest.cc +++ b/chrome/browser/google_apis/base_operations_server_unittest.cc @@ -73,7 +73,7 @@ class BaseOperationsServerTest : public testing::Test { return profile_->GetPath().Append(file_name); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; content::TestBrowserThread io_thread_; @@ -104,7 +104,7 @@ TEST_F(BaseOperationsServerTest, DownloadFileOperation_ValidFile) { GetTestCachedFilePath( base::FilePath::FromUTF8Unsafe("cached_testfile.txt"))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); std::string contents; file_util::ReadFileToString(temp_file, &contents); @@ -139,7 +139,7 @@ TEST_F(BaseOperationsServerTest, GetTestCachedFilePath( base::FilePath::FromUTF8Unsafe("cache_no-such-file.txt"))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); std::string contents; file_util::ReadFileToString(temp_file, &contents); diff --git a/chrome/browser/google_apis/base_operations_unittest.cc b/chrome/browser/google_apis/base_operations_unittest.cc index 05a721b..81f2803 100644 --- a/chrome/browser/google_apis/base_operations_unittest.cc +++ b/chrome/browser/google_apis/base_operations_unittest.cc @@ -73,7 +73,7 @@ class BaseOperationsTest : public testing::Test { LOG(ERROR) << "Initialized."; } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_ptr<TestingProfile> profile_; scoped_ptr<OperationRunner> runner_; diff --git a/chrome/browser/google_apis/drive_api_operations_unittest.cc b/chrome/browser/google_apis/drive_api_operations_unittest.cc index f845d2a..4107645 100644 --- a/chrome/browser/google_apis/drive_api_operations_unittest.cc +++ b/chrome/browser/google_apis/drive_api_operations_unittest.cc @@ -104,7 +104,7 @@ class DriveApiOperationsTest : public testing::Test { ResetExpectedResponse(); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; content::TestBrowserThread io_thread_; @@ -332,7 +332,7 @@ TEST_F(DriveApiOperationsTest, GetAboutOperation_ValidJson) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &about_resource))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); @@ -364,7 +364,7 @@ TEST_F(DriveApiOperationsTest, GetAboutOperation_InvalidJson) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &about_resource))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // "parse error" should be returned, and the about resource should be NULL. EXPECT_EQ(GDATA_PARSE_ERROR, error); @@ -389,7 +389,7 @@ TEST_F(DriveApiOperationsTest, GetApplistOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &result))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); @@ -416,7 +416,7 @@ TEST_F(DriveApiOperationsTest, GetChangelistOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &result))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); @@ -443,7 +443,7 @@ TEST_F(DriveApiOperationsTest, GetFilelistOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &result))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); @@ -469,7 +469,7 @@ TEST_F(DriveApiOperationsTest, ContinueGetFileListOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &result))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); @@ -497,7 +497,7 @@ TEST_F(DriveApiOperationsTest, CreateDirectoryOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &file_resource))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(net::test_server::METHOD_POST, http_request_.method); @@ -539,7 +539,7 @@ TEST_F(DriveApiOperationsTest, RenameResourceOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(net::test_server::METHOD_PATCH, http_request_.method); @@ -574,7 +574,7 @@ TEST_F(DriveApiOperationsTest, TouchResourceOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &file_resource))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(net::test_server::METHOD_PATCH, http_request_.method); @@ -611,7 +611,7 @@ TEST_F(DriveApiOperationsTest, CopyResourceOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &file_resource))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(net::test_server::METHOD_POST, http_request_.method); @@ -647,7 +647,7 @@ TEST_F(DriveApiOperationsTest, CopyResourceOperation_EmptyParentResourceId) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &file_resource))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(net::test_server::METHOD_POST, http_request_.method); @@ -678,7 +678,7 @@ TEST_F(DriveApiOperationsTest, TrashResourceOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(net::test_server::METHOD_POST, http_request_.method); @@ -707,7 +707,7 @@ TEST_F(DriveApiOperationsTest, InsertResourceOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(net::test_server::METHOD_POST, http_request_.method); @@ -735,7 +735,7 @@ TEST_F(DriveApiOperationsTest, DeleteResourceOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_NO_CONTENT, error); EXPECT_EQ(net::test_server::METHOD_DELETE, http_request_.method); @@ -773,7 +773,7 @@ TEST_F(DriveApiOperationsTest, UploadNewFileOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &upload_url))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(kTestUploadNewFilePath, upload_url.path()); @@ -813,7 +813,7 @@ TEST_F(DriveApiOperationsTest, UploadNewFileOperation) { test_util::CreateCopyResultCallback(&response, &new_entry)), ProgressCallback()); operation_runner_->StartOperationWithRetry(resume_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // METHOD_PUT should be used to upload data. EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -863,7 +863,7 @@ TEST_F(DriveApiOperationsTest, UploadNewEmptyFileOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &upload_url))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(kTestUploadNewFilePath, upload_url.path()); @@ -902,7 +902,7 @@ TEST_F(DriveApiOperationsTest, UploadNewEmptyFileOperation) { test_util::CreateCopyResultCallback(&response, &new_entry)), ProgressCallback()); operation_runner_->StartOperationWithRetry(resume_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // METHOD_PUT should be used to upload data. EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -953,7 +953,7 @@ TEST_F(DriveApiOperationsTest, UploadNewLargeFileOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &upload_url))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(kTestUploadNewFilePath, upload_url.path()); @@ -992,7 +992,7 @@ TEST_F(DriveApiOperationsTest, UploadNewLargeFileOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&response, &new_entry))); operation_runner_->StartOperationWithRetry(get_upload_status_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // METHOD_PUT should be used to upload data. EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -1038,7 +1038,7 @@ TEST_F(DriveApiOperationsTest, UploadNewLargeFileOperation) { test_util::CreateCopyResultCallback(&response, &new_entry)), ProgressCallback()); operation_runner_->StartOperationWithRetry(resume_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // METHOD_PUT should be used to upload data. EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -1082,7 +1082,7 @@ TEST_F(DriveApiOperationsTest, UploadNewLargeFileOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&response, &new_entry))); operation_runner_->StartOperationWithRetry(get_upload_status_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // METHOD_PUT should be used to upload data. EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -1131,7 +1131,7 @@ TEST_F(DriveApiOperationsTest, UploadExistingFileOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &upload_url))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(kTestUploadExistingFilePath, upload_url.path()); @@ -1166,7 +1166,7 @@ TEST_F(DriveApiOperationsTest, UploadExistingFileOperation) { test_util::CreateCopyResultCallback(&response, &new_entry)), ProgressCallback()); operation_runner_->StartOperationWithRetry(resume_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // METHOD_PUT should be used to upload data. EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -1216,7 +1216,7 @@ TEST_F(DriveApiOperationsTest, UploadExistingFileOperationWithETag) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &upload_url))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, error); EXPECT_EQ(kTestUploadExistingFilePath, upload_url.path()); @@ -1251,7 +1251,7 @@ TEST_F(DriveApiOperationsTest, UploadExistingFileOperationWithETag) { test_util::CreateCopyResultCallback(&response, &new_entry)), ProgressCallback()); operation_runner_->StartOperationWithRetry(resume_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // METHOD_PUT should be used to upload data. EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -1298,7 +1298,7 @@ TEST_F(DriveApiOperationsTest, UploadExistingFileOperationWithETagConflicting) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&error, &upload_url))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_PRECONDITION, error); EXPECT_EQ(kTestContentType, http_request_.headers["X-Upload-Content-Type"]); diff --git a/chrome/browser/google_apis/drive_uploader.cc b/chrome/browser/google_apis/drive_uploader.cc index 5de1d56..012b32a 100644 --- a/chrome/browser/google_apis/drive_uploader.cc +++ b/chrome/browser/google_apis/drive_uploader.cc @@ -281,7 +281,7 @@ void DriveUploader::OnUploadLocationReceived( // PostTask is necessary because we have to finish // InitiateUpload's callback before calling ResumeUpload, due to the // implementation of OperationRegistry. (http://crbug.com/134814) - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&DriveUploader::UploadNextChunk, weak_ptr_factory_.GetWeakPtr(), @@ -386,7 +386,7 @@ void DriveUploader::OnUploadRangeResponseReceived( // PostTask is necessary because we have to finish previous ResumeUpload's // callback before calling ResumeUpload again, due to the implementation of // OperationRegistry. (http://crbug.com/134814) - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&DriveUploader::UploadNextChunk, weak_ptr_factory_.GetWeakPtr(), diff --git a/chrome/browser/google_apis/drive_uploader_unittest.cc b/chrome/browser/google_apis/drive_uploader_unittest.cc index 34f96e2..3ed550b 100644 --- a/chrome/browser/google_apis/drive_uploader_unittest.cc +++ b/chrome/browser/google_apis/drive_uploader_unittest.cc @@ -74,7 +74,7 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService { // Calls back the upload URL for subsequent ResumeUpload operations. // InitiateUpload is an asynchronous function, so don't callback directly. - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadNewFileURL))); } @@ -90,14 +90,14 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService { EXPECT_EQ(kTestInitiateUploadResourceId, resource_id); if (!etag.empty() && etag != kTestETag) { - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, HTTP_PRECONDITION, GURL())); return; } // Calls back the upload URL for subsequent ResumeUpload operations. // InitiateUpload is an asynchronous function, so don't callback directly. - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadExistingFileURL))); } @@ -138,7 +138,7 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService { // For the testing purpose, it always notifies the progress at the end of // each chunk uploading. int64 chunk_size = end_position - start_position; - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(progress_callback, chunk_size, chunk_size)); } @@ -178,7 +178,7 @@ class MockDriveServiceWithUploadExpectation : public DummyDriveService { HTTP_RESUME_INCOMPLETE, 0, received_bytes_); } // ResumeUpload is an asynchronous function, so don't callback directly. - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, response, base::Passed(&entry))); } @@ -198,7 +198,7 @@ class MockDriveServiceNoConnectionAtInitiate : public DummyDriveService { const std::string& parent_resource_id, const std::string& title, const InitiateUploadCallback& callback) OVERRIDE { - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, GURL())); } @@ -209,7 +209,7 @@ class MockDriveServiceNoConnectionAtInitiate : public DummyDriveService { const std::string& resource_id, const std::string& etag, const InitiateUploadCallback& callback) OVERRIDE { - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, GURL())); } @@ -238,7 +238,7 @@ class MockDriveServiceNoConnectionAtResume : public DummyDriveService { const std::string& parent_resource_id, const std::string& title, const InitiateUploadCallback& callback) OVERRIDE { - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadNewFileURL))); } @@ -249,7 +249,7 @@ class MockDriveServiceNoConnectionAtResume : public DummyDriveService { const std::string& resource_id, const std::string& etag, const InitiateUploadCallback& callback) OVERRIDE { - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, HTTP_SUCCESS, GURL(kTestUploadExistingFileURL))); } @@ -264,7 +264,7 @@ class MockDriveServiceNoConnectionAtResume : public DummyDriveService { const base::FilePath& local_file_path, const UploadRangeCallback& callback, const ProgressCallback& progress_callback) OVERRIDE { - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(callback, UploadRangeResponse(GDATA_NO_CONNECTION, -1, -1), base::Passed(scoped_ptr<ResourceEntry>()))); @@ -286,7 +286,7 @@ class DriveUploaderTest : public testing::Test { } protected: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; base::ScopedTempDir temp_dir_; }; diff --git a/chrome/browser/google_apis/fake_drive_service.cc b/chrome/browser/google_apis/fake_drive_service.cc index 3b224f9..20253a6 100644 --- a/chrome/browser/google_apis/fake_drive_service.cc +++ b/chrome/browser/google_apis/fake_drive_service.cc @@ -370,7 +370,7 @@ void FakeDriveService::GetResourceEntry( if (offline_) { scoped_ptr<ResourceEntry> null; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, @@ -382,14 +382,14 @@ void FakeDriveService::GetResourceEntry( if (entry) { scoped_ptr<ResourceEntry> resource_entry = ResourceEntry::CreateFrom(*entry); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_SUCCESS, base::Passed(&resource_entry))); return; } scoped_ptr<ResourceEntry> null; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND, base::Passed(&null))); } @@ -404,7 +404,7 @@ void FakeDriveService::GetAboutResource( if (offline_) { scoped_ptr<AboutResource> null; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, base::Passed(&null))); @@ -418,7 +418,7 @@ void FakeDriveService::GetAboutResource( GetRootResourceId())); // Overwrite the change id. about_resource->set_largest_change_id(largest_changestamp_); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_SUCCESS, base::Passed(&about_resource))); @@ -431,7 +431,7 @@ void FakeDriveService::GetAppList(const GetAppListCallback& callback) { if (offline_) { scoped_ptr<AppList> null; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, @@ -440,7 +440,7 @@ void FakeDriveService::GetAppList(const GetAppListCallback& callback) { } scoped_ptr<AppList> app_list(AppList::CreateFrom(*app_info_value_)); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_SUCCESS, base::Passed(&app_list))); } @@ -453,7 +453,7 @@ void FakeDriveService::DeleteResource( DCHECK(!callback.is_null()); if (offline_) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION)); return; } @@ -470,7 +470,7 @@ void FakeDriveService::DeleteResource( entry->GetString("gd$resourceId.$t", ¤t_resource_id) && resource_id == current_resource_id) { entries->Remove(i, NULL); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_SUCCESS)); return; } @@ -479,7 +479,7 @@ void FakeDriveService::DeleteResource( // TODO(satorux): Add support for returning "deleted" entries in // changelists from GetResourceList(). - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND)); } @@ -494,7 +494,7 @@ void FakeDriveService::DownloadFile( DCHECK(!download_action_callback.is_null()); if (offline_) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(download_action_callback, GDATA_NO_CONNECTION, @@ -575,7 +575,7 @@ void FakeDriveService::CopyResource( if (offline_) { scoped_ptr<ResourceEntry> null; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, @@ -625,7 +625,7 @@ void FakeDriveService::CopyResource( // Add it to the resource list. entries->Append(copied_entry.release()); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_SUCCESS, @@ -636,7 +636,7 @@ void FakeDriveService::CopyResource( } scoped_ptr<ResourceEntry> null; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND, base::Passed(&null))); } @@ -659,7 +659,7 @@ void FakeDriveService::RenameResource( DCHECK(!callback.is_null()); if (offline_) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION)); return; } @@ -668,12 +668,12 @@ void FakeDriveService::RenameResource( if (entry) { entry->SetString("title.$t", new_name); AddNewChangestamp(entry); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_SUCCESS)); return; } - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND)); } @@ -688,7 +688,7 @@ void FakeDriveService::TouchResource( DCHECK(!callback.is_null()); if (offline_) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, base::Passed(scoped_ptr<ResourceEntry>()))); @@ -697,7 +697,7 @@ void FakeDriveService::TouchResource( base::DictionaryValue* entry = FindEntryByResourceId(resource_id); if (!entry) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND, base::Passed(scoped_ptr<ResourceEntry>()))); @@ -711,7 +711,7 @@ void FakeDriveService::TouchResource( AddNewChangestamp(entry); scoped_ptr<ResourceEntry> parsed_entry(ResourceEntry::CreateFrom(*entry)); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_SUCCESS, base::Passed(&parsed_entry))); } @@ -724,7 +724,7 @@ void FakeDriveService::AddResourceToDirectory( DCHECK(!callback.is_null()); if (offline_) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION)); return; } @@ -748,12 +748,12 @@ void FakeDriveService::AddResourceToDirectory( links->Append(link); AddNewChangestamp(entry); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_SUCCESS)); return; } - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND)); } @@ -765,7 +765,7 @@ void FakeDriveService::RemoveResourceFromDirectory( DCHECK(!callback.is_null()); if (offline_) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION)); return; } @@ -786,7 +786,7 @@ void FakeDriveService::RemoveResourceFromDirectory( GURL(href) == parent_content_url) { links->Remove(i, NULL); AddNewChangestamp(entry); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_SUCCESS)); return; } @@ -794,7 +794,7 @@ void FakeDriveService::RemoveResourceFromDirectory( } } - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND)); } @@ -807,7 +807,7 @@ void FakeDriveService::AddNewDirectory( if (offline_) { scoped_ptr<ResourceEntry> null; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, @@ -824,14 +824,14 @@ void FakeDriveService::AddNewDirectory( "folder"); if (!new_entry) { scoped_ptr<ResourceEntry> null; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND, base::Passed(&null))); return; } scoped_ptr<ResourceEntry> parsed_entry(ResourceEntry::CreateFrom(*new_entry)); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_CREATED, base::Passed(&parsed_entry))); } @@ -847,7 +847,7 @@ void FakeDriveService::InitiateUploadNewFile( DCHECK(!callback.is_null()); if (offline_) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, GURL())); return; @@ -862,7 +862,7 @@ void FakeDriveService::InitiateUploadNewFile( false, // shared_with_me "file"); if (!new_entry) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND, GURL())); return; @@ -870,7 +870,7 @@ void FakeDriveService::InitiateUploadNewFile( const GURL upload_url = GetUploadUrl(*new_entry); DCHECK(upload_url.is_valid()); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_SUCCESS, net::AppendQueryParameter(upload_url, "mode", "newfile"))); @@ -888,7 +888,7 @@ void FakeDriveService::InitiateUploadExistingFile( DCHECK(!callback.is_null()); if (offline_) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, GURL())); return; @@ -896,7 +896,7 @@ void FakeDriveService::InitiateUploadExistingFile( DictionaryValue* entry = FindEntryByResourceId(resource_id); if (!entry) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND, GURL())); return; @@ -905,7 +905,7 @@ void FakeDriveService::InitiateUploadExistingFile( std::string entry_etag; entry->GetString("gd$etag", &entry_etag); if (!etag.empty() && etag != entry_etag) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_PRECONDITION, GURL())); return; @@ -915,7 +915,7 @@ void FakeDriveService::InitiateUploadExistingFile( const GURL upload_url = GetUploadUrl(*entry); DCHECK(upload_url.is_valid()); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_SUCCESS, net::AppendQueryParameter(upload_url, "mode", "existing"))); @@ -946,7 +946,7 @@ void FakeDriveService::ResumeUpload( scoped_ptr<ResourceEntry> result_entry; if (offline_) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, UploadRangeResponse(GDATA_NO_CONNECTION, @@ -959,7 +959,7 @@ void FakeDriveService::ResumeUpload( DictionaryValue* entry = NULL; entry = FindEntryByUploadUrl(RemoveQueryParameter(upload_url)); if (!entry) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, UploadRangeResponse(HTTP_NOT_FOUND, @@ -976,7 +976,7 @@ void FakeDriveService::ResumeUpload( if (!entry->GetString("docs$size.$t", ¤t_size_string) || !base::StringToInt64(current_size_string, ¤t_size) || current_size != start_position) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, UploadRangeResponse(HTTP_BAD_REQUEST, @@ -996,14 +996,14 @@ void FakeDriveService::ResumeUpload( // crucial difference of the progress callback from others. // Note that progress is notified in the relative offset in each chunk. const int64 chunk_size = end_position - start_position; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(progress_callback, chunk_size / 2, chunk_size)); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(progress_callback, chunk_size, chunk_size)); } if (content_length != end_position) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, UploadRangeResponse(HTTP_RESUME_INCOMPLETE, @@ -1025,7 +1025,7 @@ void FakeDriveService::ResumeUpload( GDataErrorCode return_code = upload_mode == "newfile" ? HTTP_CREATED : HTTP_SUCCESS; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, UploadRangeResponse(return_code, @@ -1052,7 +1052,7 @@ void FakeDriveService::AddNewFile(const std::string& content_type, if (offline_) { scoped_ptr<ResourceEntry> null; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, @@ -1075,7 +1075,7 @@ void FakeDriveService::AddNewFile(const std::string& content_type, entry_kind); if (!new_entry) { scoped_ptr<ResourceEntry> null; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND, base::Passed(&null))); return; @@ -1083,7 +1083,7 @@ void FakeDriveService::AddNewFile(const std::string& content_type, scoped_ptr<ResourceEntry> parsed_entry( ResourceEntry::CreateFrom(*new_entry)); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_CREATED, base::Passed(&parsed_entry))); } @@ -1097,7 +1097,7 @@ void FakeDriveService::SetLastModifiedTime( if (offline_) { scoped_ptr<ResourceEntry> null; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, @@ -1108,7 +1108,7 @@ void FakeDriveService::SetLastModifiedTime( base::DictionaryValue* entry = FindEntryByResourceId(resource_id); if (!entry) { scoped_ptr<ResourceEntry> null; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_NOT_FOUND, base::Passed(&null))); return; @@ -1123,7 +1123,7 @@ void FakeDriveService::SetLastModifiedTime( scoped_ptr<ResourceEntry> parsed_entry( ResourceEntry::CreateFrom(*entry)); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_SUCCESS, base::Passed(&parsed_entry))); } @@ -1329,7 +1329,7 @@ void FakeDriveService::GetResourceListInternal( const GetResourceListCallback& callback) { if (offline_) { scoped_ptr<ResourceList> null; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, GDATA_NO_CONNECTION, @@ -1429,7 +1429,7 @@ void FakeDriveService::GetResourceListInternal( if (load_counter) *load_counter += 1; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(callback, HTTP_SUCCESS, diff --git a/chrome/browser/google_apis/fake_drive_service_unittest.cc b/chrome/browser/google_apis/fake_drive_service_unittest.cc index bdd31c9..28406e8 100644 --- a/chrome/browser/google_apis/fake_drive_service_unittest.cc +++ b/chrome/browser/google_apis/fake_drive_service_unittest.cc @@ -86,7 +86,7 @@ class FakeDriveServiceTest : public testing::Test { return about_resource->largest_change_id(); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; FakeDriveService fake_service_; }; diff --git a/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc b/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc index d3ebf54..39a7a62 100644 --- a/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc +++ b/chrome/browser/google_apis/gdata_wapi_operations_unittest.cc @@ -315,7 +315,7 @@ class GDataWapiOperationsTest : public testing::Test { return response.PassAs<net::test_server::HttpResponse>(); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; content::TestBrowserThread io_thread_; @@ -358,7 +358,7 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_DefaultFeed) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&result_code, &result_data))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); @@ -390,7 +390,7 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_ValidFeed) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&result_code, &result_data))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); @@ -423,7 +423,7 @@ TEST_F(GDataWapiOperationsTest, GetResourceListOperation_InvalidFeed) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&result_code, &result_data))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(GDATA_PARSE_ERROR, result_code); EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); @@ -447,7 +447,7 @@ TEST_F(GDataWapiOperationsTest, SearchByTitleOperation) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&result_code, &result_data))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); @@ -471,7 +471,7 @@ TEST_F(GDataWapiOperationsTest, GetResourceEntryOperation_ValidResourceId) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&result_code, &result_data))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); @@ -496,7 +496,7 @@ TEST_F(GDataWapiOperationsTest, GetResourceEntryOperation_InvalidResourceId) { base::Bind(&test_util::RunAndQuit), test_util::CreateCopyResultCallback(&result_code, &result_data))); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_NOT_FOUND, result_code); EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); @@ -519,7 +519,7 @@ TEST_F(GDataWapiOperationsTest, GetAccountMetadataOperation) { test_util::CreateCopyResultCallback(&result_code, &result_data)), true); // Include installed apps. operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); @@ -558,7 +558,7 @@ TEST_F(GDataWapiOperationsTest, test_util::CreateCopyResultCallback(&result_code, &result_data)), false); // Exclude installed apps. operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(net::test_server::METHOD_GET, http_request_.method); @@ -594,7 +594,7 @@ TEST_F(GDataWapiOperationsTest, DeleteResourceOperation) { std::string()); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(net::test_server::METHOD_DELETE, http_request_.method); @@ -619,7 +619,7 @@ TEST_F(GDataWapiOperationsTest, DeleteResourceOperationWithETag) { "etag"); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(net::test_server::METHOD_DELETE, http_request_.method); @@ -646,7 +646,7 @@ TEST_F(GDataWapiOperationsTest, CreateDirectoryOperation) { "new directory"); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(net::test_server::METHOD_POST, http_request_.method); @@ -681,7 +681,7 @@ TEST_F(GDataWapiOperationsTest, CopyHostedDocumentOperation) { "New Document"); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(net::test_server::METHOD_POST, http_request_.method); @@ -713,7 +713,7 @@ TEST_F(GDataWapiOperationsTest, RenameResourceOperation) { "New File"); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -748,7 +748,7 @@ TEST_F(GDataWapiOperationsTest, AuthorizeAppOperation_ValidFeed) { "the_app_id"); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(GURL("https://entry1_open_with_link/"), result_data); @@ -785,7 +785,7 @@ TEST_F(GDataWapiOperationsTest, AuthorizeAppOperation_NotFound) { "unauthorized_app_id"); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(GDATA_OTHER_ERROR, result_code); EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -820,7 +820,7 @@ TEST_F(GDataWapiOperationsTest, AuthorizeAppOperation_InvalidFeed) { "APP_ID"); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(GDATA_PARSE_ERROR, result_code); EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -855,7 +855,7 @@ TEST_F(GDataWapiOperationsTest, AddResourceToDirectoryOperation) { "file:2_file_resource_id"); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(net::test_server::METHOD_POST, http_request_.method); @@ -890,7 +890,7 @@ TEST_F(GDataWapiOperationsTest, RemoveResourceFromDirectoryOperation) { "file:2_file_resource_id"); operation_runner_->StartOperationWithRetry(operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); // DELETE method should be used, without the body content. @@ -929,7 +929,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewFile) { "New file"); operation_runner_->StartOperationWithRetry(initiate_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(test_server_.GetURL("/upload_new_file"), upload_url); @@ -972,7 +972,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewFile) { kTestFilePath); operation_runner_->StartOperationWithRetry(resume_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // METHOD_PUT should be used to upload data. EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -1031,7 +1031,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewLargeFile) { "New file"); operation_runner_->StartOperationWithRetry(initiate_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(test_server_.GetURL("/upload_new_file"), upload_url); @@ -1074,7 +1074,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewLargeFile) { upload_url, kUploadContent.size()); operation_runner_->StartOperationWithRetry(get_upload_status_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // METHOD_PUT should be used to upload data. EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -1126,7 +1126,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewLargeFile) { kTestFilePath); operation_runner_->StartOperationWithRetry(resume_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // METHOD_PUT should be used to upload data. EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -1171,7 +1171,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewLargeFile) { upload_url, kUploadContent.size()); operation_runner_->StartOperationWithRetry(get_upload_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // METHOD_PUT should be used to upload data. EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -1224,7 +1224,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewEmptyFile) { "New file"); operation_runner_->StartOperationWithRetry(initiate_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(test_server_.GetURL("/upload_new_file"), upload_url); @@ -1267,7 +1267,7 @@ TEST_F(GDataWapiOperationsTest, UploadNewEmptyFile) { kTestFilePath); operation_runner_->StartOperationWithRetry(resume_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // METHOD_PUT should be used to upload data. EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -1314,7 +1314,7 @@ TEST_F(GDataWapiOperationsTest, UploadExistingFile) { std::string() /* etag */); operation_runner_->StartOperationWithRetry(initiate_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(test_server_.GetURL("/upload_existing_file"), upload_url); @@ -1356,7 +1356,7 @@ TEST_F(GDataWapiOperationsTest, UploadExistingFile) { kTestFilePath); operation_runner_->StartOperationWithRetry(resume_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // METHOD_PUT should be used to upload data. EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -1405,7 +1405,7 @@ TEST_F(GDataWapiOperationsTest, UploadExistingFileWithETag) { kTestETag); operation_runner_->StartOperationWithRetry(initiate_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_SUCCESS, result_code); EXPECT_EQ(test_server_.GetURL("/upload_existing_file"), upload_url); @@ -1447,7 +1447,7 @@ TEST_F(GDataWapiOperationsTest, UploadExistingFileWithETag) { kTestFilePath); operation_runner_->StartOperationWithRetry(resume_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // METHOD_PUT should be used to upload data. EXPECT_EQ(net::test_server::METHOD_PUT, http_request_.method); @@ -1492,7 +1492,7 @@ TEST_F(GDataWapiOperationsTest, UploadExistingFileWithETagConflict) { kWrongETag); operation_runner_->StartOperationWithRetry(initiate_operation); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(HTTP_PRECONDITION, result_code); // For updating an existing file, METHOD_PUT should be used. diff --git a/chrome/browser/google_apis/operation_registry_unittest.cc b/chrome/browser/google_apis/operation_registry_unittest.cc index 183d7ac..f2b3bfb 100644 --- a/chrome/browser/google_apis/operation_registry_unittest.cc +++ b/chrome/browser/google_apis/operation_registry_unittest.cc @@ -41,7 +41,7 @@ class OperationRegistryTest : public testing::Test { OperationRegistryTest() : ui_thread_(content::BrowserThread::UI, &message_loop_) { } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; }; diff --git a/chrome/browser/google_apis/test_util.cc b/chrome/browser/google_apis/test_util.cc index ef91aec..42a8f86 100644 --- a/chrome/browser/google_apis/test_util.cc +++ b/chrome/browser/google_apis/test_util.cc @@ -28,7 +28,7 @@ namespace google_apis { namespace test_util { // This class is used to monitor if any task is posted to a message loop. -class TaskObserver : public MessageLoop::TaskObserver { +class TaskObserver : public base::MessageLoop::TaskObserver { public: TaskObserver() : posted_(false) {} virtual ~TaskObserver() {} @@ -78,9 +78,9 @@ void RunBlockingPoolTask() { content::BrowserThread::GetBlockingPool()->FlushForTesting(); TaskObserver task_observer; - MessageLoop::current()->AddTaskObserver(&task_observer); - MessageLoop::current()->RunUntilIdle(); - MessageLoop::current()->RemoveTaskObserver(&task_observer); + base::MessageLoop::current()->AddTaskObserver(&task_observer); + base::MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RemoveTaskObserver(&task_observer); if (!task_observer.posted()) break; } @@ -88,7 +88,7 @@ void RunBlockingPoolTask() { void RunAndQuit(const base::Closure& closure) { closure.Run(); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } bool WriteStringToFile(const base::FilePath& file_path, diff --git a/chrome/browser/history/android/android_history_provider_service_unittest.cc b/chrome/browser/history/android/android_history_provider_service_unittest.cc index caa0ff8..faf1f4f 100644 --- a/chrome/browser/history/android/android_history_provider_service_unittest.cc +++ b/chrome/browser/history/android/android_history_provider_service_unittest.cc @@ -65,7 +65,7 @@ class AndroidHistoryProviderServiceTest : public testing::Test { protected: TestingProfileManager profile_manager_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; scoped_ptr<AndroidHistoryProviderService> service_; @@ -105,7 +105,7 @@ class CallbackHelper : public base::RefCountedThreadSafe<CallbackHelper> { bool success, int64 id) { success_ = success; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void OnQueryResult(AndroidHistoryProviderService::Handle handle, @@ -113,7 +113,7 @@ class CallbackHelper : public base::RefCountedThreadSafe<CallbackHelper> { AndroidStatement* statement) { success_ = success; statement_ = statement; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void OnUpdated(AndroidHistoryProviderService::Handle handle, @@ -121,7 +121,7 @@ class CallbackHelper : public base::RefCountedThreadSafe<CallbackHelper> { int count) { success_ = success; count_ = count; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void OnDeleted(AndroidHistoryProviderService::Handle handle, @@ -129,13 +129,13 @@ class CallbackHelper : public base::RefCountedThreadSafe<CallbackHelper> { int count) { success_ = success; count_ = count; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void OnStatementMoved(AndroidHistoryProviderService::Handle handle, int cursor_position) { cursor_position_ = cursor_position; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } private: @@ -162,7 +162,7 @@ TEST_F(AndroidHistoryProviderServiceTest, TestHistoryAndBookmark) { service_->InsertHistoryAndBookmark(row, &cancelable_consumer_, Bind(&CallbackHelper::OnInserted, callback.get())); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(callback->success()); std::vector<HistoryAndBookmarkRow::ColumnID> projections; @@ -172,7 +172,7 @@ TEST_F(AndroidHistoryProviderServiceTest, TestHistoryAndBookmark) { service_->QueryHistoryAndBookmarks(projections, std::string(), std::vector<string16>(), std::string(), &cancelable_consumer_, Bind(&CallbackHelper::OnQueryResult, callback.get())); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ASSERT_TRUE(callback->success()); // Move the cursor to the begining and verify whether we could get @@ -180,7 +180,7 @@ TEST_F(AndroidHistoryProviderServiceTest, TestHistoryAndBookmark) { AndroidStatement* statement = callback->statement(); service_->MoveStatement(statement, 0, -1, &cancelable_consumer_, Bind(&CallbackHelper::OnStatementMoved, callback.get())); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(-1, callback->cursor_position()); EXPECT_TRUE(callback->statement()->statement()->Step()); EXPECT_FALSE(callback->statement()->statement()->Step()); @@ -192,14 +192,14 @@ TEST_F(AndroidHistoryProviderServiceTest, TestHistoryAndBookmark) { service_->UpdateHistoryAndBookmarks(update_row, std::string(), std::vector<string16>(), &cancelable_consumer_, Bind(&CallbackHelper::OnUpdated, callback.get())); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(callback->success()); EXPECT_EQ(1, callback->count()); // Delete the row. service_->DeleteHistoryAndBookmarks(std::string(), std::vector<string16>(), &cancelable_consumer_, Bind(&CallbackHelper::OnDeleted, callback.get())); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(callback->success()); EXPECT_EQ(1, callback->count()); } @@ -217,7 +217,7 @@ TEST_F(AndroidHistoryProviderServiceTest, TestSearchTerm) { service_->InsertSearchTerm(search_row, &cancelable_consumer_, Bind(&CallbackHelper::OnInserted, callback.get())); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(callback->success()); std::vector<SearchRow::ColumnID> projections; @@ -227,7 +227,7 @@ TEST_F(AndroidHistoryProviderServiceTest, TestSearchTerm) { service_->QuerySearchTerms(projections, std::string(), std::vector<string16>(), std::string(), &cancelable_consumer_, Bind(&CallbackHelper::OnQueryResult, callback.get())); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ASSERT_TRUE(callback->success()); // Move the cursor to the begining and verify whether we could get @@ -235,7 +235,7 @@ TEST_F(AndroidHistoryProviderServiceTest, TestSearchTerm) { AndroidStatement* statement = callback->statement(); service_->MoveStatement(statement, 0, -1, &cancelable_consumer_, Bind(&CallbackHelper::OnStatementMoved, callback.get())); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(-1, callback->cursor_position()); EXPECT_TRUE(callback->statement()->statement()->Step()); EXPECT_FALSE(callback->statement()->statement()->Step()); @@ -247,14 +247,14 @@ TEST_F(AndroidHistoryProviderServiceTest, TestSearchTerm) { service_->UpdateSearchTerms(update_row, std::string(), std::vector<string16>(), &cancelable_consumer_, Bind(&CallbackHelper::OnUpdated, callback.get())); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(callback->success()); EXPECT_EQ(1, callback->count()); // Delete the row. service_->DeleteSearchTerms(std::string(), std::vector<string16>(), &cancelable_consumer_, Bind(&CallbackHelper::OnDeleted, callback.get())); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(callback->success()); EXPECT_EQ(1, callback->count()); } diff --git a/chrome/browser/history/android/android_provider_backend_unittest.cc b/chrome/browser/history/android/android_provider_backend_unittest.cc index 04b50d0..5c8f8c7 100644 --- a/chrome/browser/history/android/android_provider_backend_unittest.cc +++ b/chrome/browser/history/android/android_provider_backend_unittest.cc @@ -196,7 +196,7 @@ class AndroidProviderBackendTest : public testing::Test { TestingProfileManager profile_manager_; BookmarkModel* bookmark_model_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc b/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc index 9f83555..1fd0737 100644 --- a/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc +++ b/chrome/browser/history/android/bookmark_model_sql_handler_unittest.cc @@ -68,7 +68,7 @@ class BookmarkModelSQLHandlerTest : public testing::Test { TestingProfileManager profile_manager_; BookmarkModel* bookmark_model_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; base::ScopedTempDir temp_dir_; diff --git a/chrome/browser/history/android/sqlite_cursor_unittest.cc b/chrome/browser/history/android/sqlite_cursor_unittest.cc index 421db9f..47cade3 100644 --- a/chrome/browser/history/android/sqlite_cursor_unittest.cc +++ b/chrome/browser/history/android/sqlite_cursor_unittest.cc @@ -77,24 +77,24 @@ class SQLiteCursorTest : public testing::Test, // Override SQLiteCursor::TestObserver. virtual void OnPostMoveToTask() OVERRIDE { - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } virtual void OnGetMoveToResult() OVERRIDE { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } virtual void OnPostGetFaviconTask() OVERRIDE { - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } virtual void OnGetFaviconResult() OVERRIDE { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } protected: TestingProfileManager profile_manager_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; scoped_ptr<AndroidHistoryProviderService> service_; @@ -126,7 +126,7 @@ class CallbackHelper : public base::RefCountedThreadSafe<CallbackHelper> { bool success, int64 id) { success_ = success; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void OnQueryResult(AndroidHistoryProviderService::Handle handle, @@ -134,7 +134,7 @@ class CallbackHelper : public base::RefCountedThreadSafe<CallbackHelper> { AndroidStatement* statement) { success_ = success; statement_ = statement; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } private: @@ -168,7 +168,7 @@ TEST_F(SQLiteCursorTest, Run) { service_->InsertHistoryAndBookmark(row, &cancelable_consumer_, Bind(&CallbackHelper::OnInserted, callback.get())); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(callback->success()); std::vector<HistoryAndBookmarkRow::ColumnID> projections; @@ -181,7 +181,7 @@ TEST_F(SQLiteCursorTest, Run) { service_->QueryHistoryAndBookmarks(projections, std::string(), std::vector<string16>(), std::string(), &cancelable_consumer_, Bind(&CallbackHelper::OnQueryResult, callback.get())); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ASSERT_TRUE(callback->success()); AndroidStatement* statement = callback->statement(); diff --git a/chrome/browser/history/expire_history_backend.cc b/chrome/browser/history/expire_history_backend.cc index c5798a9..797cb93 100644 --- a/chrome/browser/history/expire_history_backend.cc +++ b/chrome/browser/history/expire_history_backend.cc @@ -635,7 +635,7 @@ void ExpireHistoryBackend::ScheduleArchive() { delay = TimeDelta::FromSeconds(kExpirationDelaySec); } - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ExpireHistoryBackend::DoArchiveIteration, weak_factory_.GetWeakPtr()), @@ -731,7 +731,7 @@ void ExpireHistoryBackend::ScheduleExpireHistoryIndexFiles() { } TimeDelta delay = TimeDelta::FromMinutes(kIndexExpirationDelayMin); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ExpireHistoryBackend::DoExpireHistoryIndexFiles, weak_factory_.GetWeakPtr()), diff --git a/chrome/browser/history/expire_history_backend_unittest.cc b/chrome/browser/history/expire_history_backend_unittest.cc index 98cf02c..5ee0640 100644 --- a/chrome/browser/history/expire_history_backend_unittest.cc +++ b/chrome/browser/history/expire_history_backend_unittest.cc @@ -105,7 +105,7 @@ class ExpireHistoryTest : public testing::Test, BookmarkModel bookmark_model_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; diff --git a/chrome/browser/history/history_backend.cc b/chrome/browser/history/history_backend.cc index ef46ea9..cad3877a 100644 --- a/chrome/browser/history/history_backend.cc +++ b/chrome/browser/history/history_backend.cc @@ -231,7 +231,7 @@ class KillHistoryDatabaseErrorDelegate : public sql::ErrorDelegate { // Don't just do the close/delete here, as we are being called by |db| and // that seems dangerous. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&HistoryBackend::KillHistoryDatabase, backend_)); } @@ -302,7 +302,7 @@ void HistoryBackend::Init(const std::string& languages, bool force_fail) { typed_url_syncable_service_.reset(new TypedUrlSyncableService(this)); } -void HistoryBackend::SetOnBackendDestroyTask(MessageLoop* message_loop, +void HistoryBackend::SetOnBackendDestroyTask(base::MessageLoop* message_loop, const base::Closure& task) { if (!backend_destroy_task_.is_null()) DLOG(WARNING) << "Setting more than one destroy task, overriding"; @@ -1218,7 +1218,7 @@ void HistoryBackend::QuerySegmentUsage( // entries. if (!segment_queried_) { segment_queried_ = true; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&HistoryBackend::DeleteOldSegmentData, this)); } @@ -2651,7 +2651,7 @@ void HistoryBackend::ScheduleCommit() { if (scheduled_commit_) return; scheduled_commit_ = new CommitLaterTask(this); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&CommitLaterTask::RunCommit, scheduled_commit_.get()), base::TimeDelta::FromSeconds(kCommitIntervalSeconds)); @@ -2691,7 +2691,7 @@ void HistoryBackend::ProcessDBTaskImpl() { // Tasks wants to run some more. Schedule it at the end of current tasks. db_task_requests_.push_back(request); // And process it after an invoke later. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&HistoryBackend::ProcessDBTaskImpl, this)); } } diff --git a/chrome/browser/history/history_backend.h b/chrome/browser/history/history_backend.h index ff75904..2aff659 100644 --- a/chrome/browser/history/history_backend.h +++ b/chrome/browser/history/history_backend.h @@ -479,7 +479,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, // Sets the task to run and the message loop to run it on when this object // is destroyed. See HistoryService::SetOnBackendDestroyTask for a more // complete description. - void SetOnBackendDestroyTask(MessageLoop* message_loop, + void SetOnBackendDestroyTask(base::MessageLoop* message_loop, const base::Closure& task); // Adds the given rows to the database if it doesn't exist. A visit will be @@ -876,7 +876,7 @@ class HistoryBackend : public base::RefCountedThreadSafe<HistoryBackend>, base::Time first_recorded_time_; // When set, this is the task that should be invoked on destruction. - MessageLoop* backend_destroy_message_loop_; + base::MessageLoop* backend_destroy_message_loop_; base::Closure backend_destroy_task_; // Tracks page transition types. diff --git a/chrome/browser/history/history_backend_unittest.cc b/chrome/browser/history/history_backend_unittest.cc index 6cf44ef..a27edb4 100644 --- a/chrome/browser/history/history_backend_unittest.cc +++ b/chrome/browser/history/history_backend_unittest.cc @@ -413,7 +413,7 @@ class HistoryBackendTest : public testing::Test { // The number of notifications which were broadcasted. int num_broadcasted_notifications_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; base::FilePath test_dir_; history::MostVisitedURLList most_visited_list_; history::FilteredURLList filtered_list_; diff --git a/chrome/browser/history/history_browsertest.cc b/chrome/browser/history/history_browsertest.cc index 4a40313..d84de7f 100644 --- a/chrome/browser/history/history_browsertest.cc +++ b/chrome/browser/history/history_browsertest.cc @@ -49,7 +49,7 @@ class WaitForHistoryTask : public history::HistoryDBTask { } virtual void DoneRunOnMainThread() OVERRIDE { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } private: diff --git a/chrome/browser/history/history_querying_unittest.cc b/chrome/browser/history/history_querying_unittest.cc index 6e1d12b0..0b6781a 100644 --- a/chrome/browser/history/history_querying_unittest.cc +++ b/chrome/browser/history/history_querying_unittest.cc @@ -85,7 +85,8 @@ class HistoryQueryTest : public testing::Test { UTF8ToUTF16(text_query), options, &consumer_, base::Bind(&HistoryQueryTest::QueryHistoryComplete, base::Unretained(this))); - MessageLoop::current()->Run(); // Will go until ...Complete calls Quit. + // Will go until ...Complete calls Quit. + base::MessageLoop::current()->Run(); results->Swap(&last_query_results_); } @@ -182,21 +183,21 @@ class HistoryQueryTest : public testing::Test { virtual void TearDown() { if (history_) { - history_->SetOnBackendDestroyTask(MessageLoop::QuitClosure()); + history_->SetOnBackendDestroyTask(base::MessageLoop::QuitClosure()); history_->Cleanup(); history_.reset(); - MessageLoop::current()->Run(); // Wait for the other thread. + base::MessageLoop::current()->Run(); // Wait for the other thread. } } void QueryHistoryComplete(HistoryService::Handle, QueryResults* results) { results->Swap(&last_query_results_); - MessageLoop::current()->Quit(); // Will return out to QueryHistory. + base::MessageLoop::current()->Quit(); // Will return out to QueryHistory. } base::ScopedTempDir temp_dir_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; base::FilePath history_dir_; diff --git a/chrome/browser/history/history_service.cc b/chrome/browser/history/history_service.cc index ccb0b99..61b7858 100644 --- a/chrome/browser/history/history_service.cc +++ b/chrome/browser/history/history_service.cc @@ -464,7 +464,7 @@ HistoryService::Handle HistoryService::QuerySegmentDurationSince( void HistoryService::SetOnBackendDestroyTask(const base::Closure& task) { DCHECK(thread_checker_.CalledOnValidThread()); ScheduleAndForget(PRIORITY_NORMAL, &HistoryBackend::SetOnBackendDestroyTask, - MessageLoop::current(), task); + base::MessageLoop::current(), task); } void HistoryService::AddPage(const GURL& url, diff --git a/chrome/browser/history/history_unittest.cc b/chrome/browser/history/history_unittest.cc index 083905a..423b38f 100644 --- a/chrome/browser/history/history_unittest.cc +++ b/chrome/browser/history/history_unittest.cc @@ -156,8 +156,9 @@ class HistoryBackendDBTest : public HistoryUnitTestBase { // Make sure we don't have any event pending that could disrupt the next // test. - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); } int64 AddDownload(DownloadItem::DownloadState state, const Time& time) { @@ -182,7 +183,7 @@ class HistoryBackendDBTest : public HistoryUnitTestBase { base::ScopedTempDir temp_dir_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; // names of the database files base::FilePath history_dir_; @@ -551,7 +552,7 @@ TEST_F(HistoryBackendDBTest, ConfirmDownloadInProgressCleanup) { // Allow the update to propagate, shut down the DB, and confirm that // the query updated the on disk database as well. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); DeleteBackend(); { sql::Connection db; @@ -683,17 +684,17 @@ class HistoryTest : public testing::Test { void OnSegmentUsageAvailable(CancelableRequestProvider::Handle handle, std::vector<PageUsageData*>* data) { page_usage_data_.swap(*data); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void OnDeleteURLsDone(CancelableRequestProvider::Handle handle) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void OnMostVisitedURLsAvailable(CancelableRequestProvider::Handle handle, MostVisitedURLList url_list) { most_visited_urls_.swap(url_list); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } protected: @@ -717,15 +718,16 @@ class HistoryTest : public testing::Test { // Make sure we don't have any event pending that could disrupt the next // test. - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); } void CleanupHistoryService() { DCHECK(history_service_); history_service_->NotifyRenderProcessHostDestruction(0); - history_service_->SetOnBackendDestroyTask(MessageLoop::QuitClosure()); + history_service_->SetOnBackendDestroyTask(base::MessageLoop::QuitClosure()); history_service_->Cleanup(); history_service_.reset(); @@ -733,7 +735,7 @@ class HistoryTest : public testing::Test { // moving to the next test. Note: if this never terminates, somebody is // probably leaking a reference to the history backend, so it never calls // our destroy task. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } // Fills the query_url_row_ and query_url_visits_ structures with the @@ -743,7 +745,7 @@ class HistoryTest : public testing::Test { history_service_->QueryURL(url, true, &consumer_, base::Bind(&HistoryTest::SaveURLAndQuit, base::Unretained(this))); - MessageLoop::current()->Run(); // Will be exited in SaveURLAndQuit. + base::MessageLoop::current()->Run(); // Will be exited in SaveURLAndQuit. return query_url_success_; } @@ -760,7 +762,7 @@ class HistoryTest : public testing::Test { query_url_row_ = URLRow(); query_url_visits_.clear(); } - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // Fills in saved_redirects_ with the redirect information for the given URL, @@ -770,7 +772,7 @@ class HistoryTest : public testing::Test { url, &consumer_, base::Bind(&HistoryTest::OnRedirectQueryComplete, base::Unretained(this))); - MessageLoop::current()->Run(); // Will be exited in *QueryComplete. + base::MessageLoop::current()->Run(); // Will be exited in *QueryComplete. return redirect_query_success_; } @@ -784,12 +786,12 @@ class HistoryTest : public testing::Test { saved_redirects_.swap(*redirects); else saved_redirects_.clear(); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } base::ScopedTempDir temp_dir_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; // PageUsageData vector to test segments. ScopedVector<PageUsageData> page_usage_data_; @@ -1104,7 +1106,7 @@ TEST_F(HistoryTest, DISABLED_Segments) { base::Unretained(this))); // Wait for processing. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ASSERT_EQ(1U, page_usage_data_.size()); EXPECT_TRUE(page_usage_data_[0]->GetURL() == existing_url); @@ -1124,7 +1126,7 @@ TEST_F(HistoryTest, DISABLED_Segments) { base::Unretained(this))); // Wait for processing. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // Make sure we still have one segment. ASSERT_EQ(1U, page_usage_data_.size()); @@ -1144,7 +1146,7 @@ TEST_F(HistoryTest, DISABLED_Segments) { base::Unretained(this))); // Wait for processing. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // Make sure we still have one segment. ASSERT_EQ(1U, page_usage_data_.size()); @@ -1179,7 +1181,7 @@ TEST_F(HistoryTest, MostVisitedURLs) { base::Bind( &HistoryTest::OnMostVisitedURLsAvailable, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(2U, most_visited_urls_.size()); EXPECT_EQ(url0, most_visited_urls_[0].url); @@ -1195,7 +1197,7 @@ TEST_F(HistoryTest, MostVisitedURLs) { base::Bind( &HistoryTest::OnMostVisitedURLsAvailable, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(3U, most_visited_urls_.size()); EXPECT_EQ(url0, most_visited_urls_[0].url); @@ -1212,7 +1214,7 @@ TEST_F(HistoryTest, MostVisitedURLs) { base::Bind( &HistoryTest::OnMostVisitedURLsAvailable, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(3U, most_visited_urls_.size()); EXPECT_EQ(url2, most_visited_urls_[0].url); @@ -1229,7 +1231,7 @@ TEST_F(HistoryTest, MostVisitedURLs) { base::Bind( &HistoryTest::OnMostVisitedURLsAvailable, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(3U, most_visited_urls_.size()); EXPECT_EQ(url1, most_visited_urls_[0].url); @@ -1251,7 +1253,7 @@ TEST_F(HistoryTest, MostVisitedURLs) { base::Bind( &HistoryTest::OnMostVisitedURLsAvailable, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(4U, most_visited_urls_.size()); EXPECT_EQ(url1, most_visited_urls_[0].url); @@ -1281,7 +1283,7 @@ class HistoryDBTaskImpl : public HistoryDBTask { virtual void DoneRunOnMainThread() OVERRIDE { done_invoked = true; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } int invoke_count; @@ -1306,7 +1308,7 @@ TEST_F(HistoryTest, HistoryDBTask) { // Run the message loop. When HistoryDBTaskImpl::DoneRunOnMainThread runs, // it will stop the message loop. If the test hangs here, it means // DoneRunOnMainThread isn't being invoked correctly. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); CleanupHistoryService(); // WARNING: history has now been deleted. history_service_.reset(); @@ -1438,7 +1440,7 @@ void CheckDirectiveProcessingResult( } base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100)); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&CheckDirectiveProcessingResult, timeout, change_processor, num_changes)); @@ -1497,12 +1499,12 @@ TEST_F(HistoryTest, ProcessGlobalIdDeleteDirective) { // Inject a task to check status and keep message loop filled before directive // processing finishes. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&CheckDirectiveProcessingResult, base::Time::Now() + base::TimeDelta::FromSeconds(10), &change_processor, 2)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(QueryURL(history_service_.get(), test_url)); ASSERT_EQ(5, query_url_row_.visit_count()); EXPECT_EQ(base::Time::UnixEpoch() + base::TimeDelta::FromMicroseconds(1), @@ -1569,12 +1571,12 @@ TEST_F(HistoryTest, ProcessTimeRangeDeleteDirective) { // Inject a task to check status and keep message loop filled before // directive processing finishes. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&CheckDirectiveProcessingResult, base::Time::Now() + base::TimeDelta::FromSeconds(10), &change_processor, 2)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(QueryURL(history_service_.get(), test_url)); ASSERT_EQ(3, query_url_row_.visit_count()); EXPECT_EQ(base::Time::UnixEpoch() + base::TimeDelta::FromMicroseconds(1), diff --git a/chrome/browser/history/in_memory_url_index_unittest.cc b/chrome/browser/history/in_memory_url_index_unittest.cc index 7de8e8c..2e0b258 100644 --- a/chrome/browser/history/in_memory_url_index_unittest.cc +++ b/chrome/browser/history/in_memory_url_index_unittest.cc @@ -54,15 +54,15 @@ namespace history { // Observer class so the unit tests can wait while the cache is being saved. class CacheFileSaverObserver : public InMemoryURLIndex::SaveCacheObserver { public: - explicit CacheFileSaverObserver(MessageLoop* loop); + explicit CacheFileSaverObserver(base::MessageLoop* loop); virtual void OnCacheSaveFinished(bool succeeded) OVERRIDE; - MessageLoop* loop_; + base::MessageLoop* loop_; bool succeeded_; DISALLOW_COPY_AND_ASSIGN(CacheFileSaverObserver); }; -CacheFileSaverObserver::CacheFileSaverObserver(MessageLoop* loop) +CacheFileSaverObserver::CacheFileSaverObserver(base::MessageLoop* loop) : loop_(loop), succeeded_(false) { DCHECK(loop); @@ -118,7 +118,7 @@ class InMemoryURLIndexTest : public testing::Test { void ExpectPrivateDataEqual(const URLIndexPrivateData& expected, const URLIndexPrivateData& actual); - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; TestingProfile profile_; @@ -1038,7 +1038,7 @@ TEST_F(InMemoryURLIndexTest, CacheSaveRestore) { EXPECT_TRUE(private_data.word_starts_map_.empty()); HistoryIndexRestoreObserver restore_observer( - base::Bind(&MessageLoop::Quit, base::Unretained(&message_loop_))); + base::Bind(&base::MessageLoop::Quit, base::Unretained(&message_loop_))); url_index_->set_restore_cache_observer(&restore_observer); PostRestoreFromCacheFileTask(); message_loop_.Run(); diff --git a/chrome/browser/history/redirect_browsertest.cc b/chrome/browser/history/redirect_browsertest.cc index 000444f..0948696 100644 --- a/chrome/browser/history/redirect_browsertest.cc +++ b/chrome/browser/history/redirect_browsertest.cc @@ -62,7 +62,8 @@ class RedirectTest : public InProcessBrowserTest { history::RedirectList* redirects) { for (size_t i = 0; i < redirects->size(); ++i) rv->push_back(redirects->at(i)); - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); } // Consumer for asynchronous history queries. diff --git a/chrome/browser/history/shortcuts_backend_unittest.cc b/chrome/browser/history/shortcuts_backend_unittest.cc index 2324385..0a7ffda 100644 --- a/chrome/browser/history/shortcuts_backend_unittest.cc +++ b/chrome/browser/history/shortcuts_backend_unittest.cc @@ -42,7 +42,7 @@ class ShortcutsBackendTest : public testing::Test, TestingProfile profile_; scoped_refptr<ShortcutsBackend> backend_; - MessageLoopForUI ui_message_loop_; + base::MessageLoopForUI ui_message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; @@ -66,7 +66,7 @@ void ShortcutsBackendTest::TearDown() { void ShortcutsBackendTest::OnShortcutsLoaded() { load_notified_ = true; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void ShortcutsBackendTest::OnShortcutsChanged() { @@ -78,7 +78,7 @@ void ShortcutsBackendTest::InitBackend() { ASSERT_TRUE(backend); ASSERT_FALSE(load_notified_); ASSERT_FALSE(backend_->initialized()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(load_notified_); EXPECT_TRUE(backend_->initialized()); } diff --git a/chrome/browser/history/text_database_manager.cc b/chrome/browser/history/text_database_manager.cc index 97f6555..f6ca82e 100644 --- a/chrome/browser/history/text_database_manager.cc +++ b/chrome/browser/history/text_database_manager.cc @@ -559,7 +559,7 @@ TextDatabase* TextDatabaseManager::GetDBForTime(Time time, void TextDatabaseManager::ScheduleFlushOldChanges() { weak_factory_.InvalidateWeakPtrs(); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&TextDatabaseManager::FlushOldChanges, weak_factory_.GetWeakPtr()), diff --git a/chrome/browser/history/text_database_manager_unittest.cc b/chrome/browser/history/text_database_manager_unittest.cc index 8185773..0ec6753 100644 --- a/chrome/browser/history/text_database_manager_unittest.cc +++ b/chrome/browser/history/text_database_manager_unittest.cc @@ -164,7 +164,7 @@ class TextDatabaseManagerTest : public testing::Test { file_util::Delete(dir_, true); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; // Directory containing the databases. base::FilePath dir_; diff --git a/chrome/browser/history/top_sites_impl_unittest.cc b/chrome/browser/history/top_sites_impl_unittest.cc index 98c2eef..d9bbb80 100644 --- a/chrome/browser/history/top_sites_impl_unittest.cc +++ b/chrome/browser/history/top_sites_impl_unittest.cc @@ -59,7 +59,7 @@ class WaitForHistoryTask : public HistoryDBTask { } virtual void DoneRunOnMainThread() OVERRIDE { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } private: @@ -87,7 +87,7 @@ class TopSitesQuerier { weak_ptr_factory_.GetWeakPtr())); if (wait && start_number_of_callbacks == number_of_callbacks_) { waiting_ = true; - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } } @@ -106,7 +106,7 @@ class TopSitesQuerier { urls_ = data; number_of_callbacks_++; if (waiting_) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); waiting_ = false; } } @@ -193,7 +193,7 @@ class TopSitesImplTest : public HistoryUnitTestBase { // need to wait until you know history has processed a task. void WaitForHistory() { history_service()->ScheduleDBTask(new WaitForHistoryTask(), &consumer_); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } // Waits for top sites to finish processing a task. This is useful if you need @@ -202,7 +202,7 @@ class TopSitesImplTest : public HistoryUnitTestBase { top_sites()->backend_->DoEmptyRequest( base::Bind(&TopSitesImplTest::QuitCallback, base::Unretained(this)), &cancelable_task_tracker_); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } TopSitesImpl* top_sites() { @@ -239,7 +239,7 @@ class TopSitesImplTest : public HistoryUnitTestBase { // Quit the current message loop when invoked. Useful when running a nested // message loop. void QuitCallback() { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // Adds a page to history. @@ -327,7 +327,7 @@ class TopSitesImplTest : public HistoryUnitTestBase { } private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; scoped_ptr<TestingProfile> profile_; diff --git a/chrome/browser/history/top_sites_likely_impl_unittest.cc b/chrome/browser/history/top_sites_likely_impl_unittest.cc index 684c51b..1901b7e 100644 --- a/chrome/browser/history/top_sites_likely_impl_unittest.cc +++ b/chrome/browser/history/top_sites_likely_impl_unittest.cc @@ -59,7 +59,7 @@ class WaitForHistoryTask : public HistoryDBTask { } virtual void DoneRunOnMainThread() OVERRIDE { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } private: @@ -87,7 +87,7 @@ class TopSitesQuerier { weak_ptr_factory_.GetWeakPtr())); if (wait && start_number_of_callbacks == number_of_callbacks_) { waiting_ = true; - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } } @@ -106,7 +106,7 @@ class TopSitesQuerier { urls_ = data; number_of_callbacks_++; if (waiting_) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); waiting_ = false; } } @@ -193,7 +193,7 @@ class TopSitesLikelyImplTest : public HistoryUnitTestBase { // need to wait until you know history has processed a task. void WaitForHistory() { history_service()->ScheduleDBTask(new WaitForHistoryTask(), &consumer_); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } // Waits for top sites to finish processing a task. This is useful if you need @@ -203,7 +203,7 @@ class TopSitesLikelyImplTest : public HistoryUnitTestBase { base::Bind(&TopSitesLikelyImplTest::QuitCallback, base::Unretained(this)), &cancelable_task_tracker_); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } TopSitesLikelyImpl* top_sites() { @@ -240,7 +240,7 @@ class TopSitesLikelyImplTest : public HistoryUnitTestBase { // Quit the current message loop when invoked. Useful when running a nested // message loop. void QuitCallback() { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // Adds a page to history. @@ -328,7 +328,7 @@ class TopSitesLikelyImplTest : public HistoryUnitTestBase { } private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; scoped_ptr<TestingProfile> profile_; diff --git a/chrome/browser/history/typed_url_syncable_service.cc b/chrome/browser/history/typed_url_syncable_service.cc index c410937..92240d2 100644 --- a/chrome/browser/history/typed_url_syncable_service.cc +++ b/chrome/browser/history/typed_url_syncable_service.cc @@ -64,13 +64,13 @@ TypedUrlSyncableService::TypedUrlSyncableService( HistoryBackend* history_backend) : history_backend_(history_backend), processing_syncer_changes_(false), - expected_loop_(MessageLoop::current()) { + expected_loop_(base::MessageLoop::current()) { DCHECK(history_backend_); - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); } TypedUrlSyncableService::~TypedUrlSyncableService() { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); } syncer::SyncMergeResult TypedUrlSyncableService::MergeDataAndStartSyncing( @@ -78,7 +78,7 @@ syncer::SyncMergeResult TypedUrlSyncableService::MergeDataAndStartSyncing( const syncer::SyncDataList& initial_sync_data, scoped_ptr<syncer::SyncChangeProcessor> sync_processor, scoped_ptr<syncer::SyncErrorFactory> error_handler) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); DCHECK(!sync_processor_.get()); DCHECK(sync_processor.get()); DCHECK(error_handler.get()); @@ -94,7 +94,7 @@ syncer::SyncMergeResult TypedUrlSyncableService::MergeDataAndStartSyncing( } void TypedUrlSyncableService::StopSyncing(syncer::ModelType type) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); DCHECK_EQ(type, syncer::TYPED_URLS); sync_processor_.reset(); @@ -103,7 +103,7 @@ void TypedUrlSyncableService::StopSyncing(syncer::ModelType type) { syncer::SyncDataList TypedUrlSyncableService::GetAllSyncData( syncer::ModelType type) const { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); syncer::SyncDataList list; // TODO(mgist): Add implementation @@ -114,7 +114,7 @@ syncer::SyncDataList TypedUrlSyncableService::GetAllSyncData( syncer::SyncError TypedUrlSyncableService::ProcessSyncChanges( const tracked_objects::Location& from_here, const syncer::SyncChangeList& change_list) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); // TODO(mgist): Add implementation @@ -124,7 +124,7 @@ syncer::SyncError TypedUrlSyncableService::ProcessSyncChanges( } void TypedUrlSyncableService::OnUrlsModified(URLRows* changed_urls) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); DCHECK(changed_urls); if (processing_syncer_changes_) @@ -152,7 +152,7 @@ void TypedUrlSyncableService::OnUrlsModified(URLRows* changed_urls) { void TypedUrlSyncableService::OnUrlVisited(content::PageTransition transition, URLRow* row) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); DCHECK(row); if (processing_syncer_changes_) @@ -175,7 +175,7 @@ void TypedUrlSyncableService::OnUrlVisited(content::PageTransition transition, void TypedUrlSyncableService::OnUrlsDeleted(bool all_history, bool archived, URLRows* rows) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); if (processing_syncer_changes_) return; // These are changes originating from us, ignore. diff --git a/chrome/browser/importer/firefox_importer_browsertest.cc b/chrome/browser/importer/firefox_importer_browsertest.cc index fc87222..d8fe3e3 100644 --- a/chrome/browser/importer/firefox_importer_browsertest.cc +++ b/chrome/browser/importer/firefox_importer_browsertest.cc @@ -117,7 +117,7 @@ class Firefox3Observer : public ProfileWriter, virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE {} virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE {} virtual void ImportEnded() OVERRIDE { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); EXPECT_EQ(arraysize(kFirefox3Bookmarks), bookmark_count_); EXPECT_EQ(1U, history_count_); EXPECT_EQ(arraysize(kFirefox3Passwords), password_count_); @@ -278,7 +278,7 @@ class FirefoxProfileImporterBrowserTest : public InProcessBrowserTest { host->SetObserver(observer); host->StartImportSettings(source_profile, browser()->profile(), items, make_scoped_refptr(writer)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } base::ScopedTempDir temp_dir_; diff --git a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc index 638f860..33c877a 100644 --- a/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc +++ b/chrome/browser/importer/firefox_importer_unittest_utils_mac.cc @@ -85,14 +85,14 @@ class FFDecryptorServerChannelListener : public IPC::Listener { DCHECK(!got_result); result_bool = result; got_result = true; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void OnDecryptedTextResonse(const string16& decrypted_text) { DCHECK(!got_result); result_string = decrypted_text; got_result = true; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void QuitClient() { @@ -113,7 +113,7 @@ class FFDecryptorServerChannelListener : public IPC::Listener { // If an error occured, just kill the message Loop. virtual void OnChannelError() OVERRIDE { got_result = false; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // Results of IPC calls. @@ -132,7 +132,7 @@ FFUnitTestDecryptorProxy::FFUnitTestDecryptorProxy() bool FFUnitTestDecryptorProxy::Setup(const base::FilePath& nss_path) { // Create a new message loop and spawn the child process. - message_loop_.reset(new MessageLoopForIO()); + message_loop_.reset(new base::MessageLoopForIO()); listener_.reset(new FFDecryptorServerChannelListener()); channel_.reset(new IPC::Channel(kTestChannelID, @@ -165,7 +165,7 @@ class CancellableQuitMsgLoop : public base::RefCounted<CancellableQuitMsgLoop> { CancellableQuitMsgLoop() : cancelled_(false) {} void QuitNow() { if (!cancelled_) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } bool cancelled_; @@ -185,7 +185,7 @@ bool FFUnitTestDecryptorProxy::WaitForClientResponse() { // a message comes in. scoped_refptr<CancellableQuitMsgLoop> quit_task( new CancellableQuitMsgLoop()); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&CancellableQuitMsgLoop::QuitNow, quit_task.get()), TestTimeouts::action_max_timeout()); @@ -241,7 +241,7 @@ class FFDecryptorClientChannelListener : public IPC::Listener { } void OnQuitRequest() { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE { @@ -256,7 +256,7 @@ class FFDecryptorClientChannelListener : public IPC::Listener { } virtual void OnChannelError() OVERRIDE { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } private: @@ -266,7 +266,7 @@ class FFDecryptorClientChannelListener : public IPC::Listener { // Entry function in child process. MULTIPROCESS_IPC_TEST_MAIN(NSSDecrypterChildProcess) { - MessageLoopForIO main_message_loop; + base::MessageLoopForIO main_message_loop; FFDecryptorClientChannelListener listener; IPC::Channel channel(kTestChannelID, IPC::Channel::MODE_CLIENT, &listener); @@ -274,7 +274,7 @@ MULTIPROCESS_IPC_TEST_MAIN(NSSDecrypterChildProcess) { listener.SetSender(&channel); // run message loop - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); return 0; } diff --git a/chrome/browser/importer/ie_importer_browsertest_win.cc b/chrome/browser/importer/ie_importer_browsertest_win.cc index ac04365..b97892b 100644 --- a/chrome/browser/importer/ie_importer_browsertest_win.cc +++ b/chrome/browser/importer/ie_importer_browsertest_win.cc @@ -268,7 +268,7 @@ class TestObserver : public ProfileWriter, virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE {} virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE {} virtual void ImportEnded() OVERRIDE { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); EXPECT_EQ(arraysize(kIEBookmarks), bookmark_count_); EXPECT_EQ(1, history_count_); EXPECT_EQ(arraysize(kIEFaviconGroup), favicon_count_); @@ -374,7 +374,7 @@ class MalformedFavoritesRegistryTestObserver virtual void ImportItemStarted(importer::ImportItem item) OVERRIDE {} virtual void ImportItemEnded(importer::ImportItem item) OVERRIDE {} virtual void ImportEnded() OVERRIDE { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); EXPECT_EQ(arraysize(kIESortedBookmarks), bookmark_count_); } @@ -498,7 +498,7 @@ IN_PROC_BROWSER_TEST_F(IEImporterBrowserTest, IEImporter) { browser()->profile(), importer::HISTORY | importer::PASSWORDS | importer::FAVORITES, observer); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // Cleans up. url_history_stg2->DeleteUrl(kIEIdentifyUrl, 0); @@ -575,6 +575,6 @@ IN_PROC_BROWSER_TEST_F(IEImporterBrowserTest, browser()->profile(), importer::FAVORITES, observer); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } } diff --git a/chrome/browser/importer/importer_host.cc b/chrome/browser/importer/importer_host.cc index 13da1ae..0f89d0c 100644 --- a/chrome/browser/importer/importer_host.cc +++ b/chrome/browser/importer/importer_host.cc @@ -179,7 +179,7 @@ void ImporterHost::OnGoogleGAIACookieChecked(bool result) { chrome::AddSelectedTabWithURL(browser_, url, content::PAGE_TRANSITION_TYPED); - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( &ImporterHost::OnImportLockDialogEnd, weak_ptr_factory_.GetWeakPtr(), false)); } else { diff --git a/chrome/browser/importer/toolbar_importer_utils_browsertest.cc b/chrome/browser/importer/toolbar_importer_utils_browsertest.cc index 999dbf1c..1d71fca 100644 --- a/chrome/browser/importer/toolbar_importer_utils_browsertest.cc +++ b/chrome/browser/importer/toolbar_importer_utils_browsertest.cc @@ -19,7 +19,7 @@ class ToolbarImporterUtilsTest : public InProcessBrowserTest { void Callback(bool result) { DCHECK(!result); did_run_ = true; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } protected: diff --git a/chrome/browser/internal_auth_unittest.cc b/chrome/browser/internal_auth_unittest.cc index da8954e..143b151 100644 --- a/chrome/browser/internal_auth_unittest.cc +++ b/chrome/browser/internal_auth_unittest.cc @@ -28,7 +28,7 @@ class InternalAuthTest : public ::testing::Test { virtual void TearDown() { } - MessageLoop message_loop_; + base::MessageLoop message_loop_; std::string long_string_; }; diff --git a/chrome/browser/intranet_redirect_detector.cc b/chrome/browser/intranet_redirect_detector.cc index d0290ad..fcc6c6e 100644 --- a/chrome/browser/intranet_redirect_detector.cc +++ b/chrome/browser/intranet_redirect_detector.cc @@ -35,7 +35,7 @@ IntranetRedirectDetector::IntranetRedirectDetector() // browser is starting up, and if so, come back later", but there is currently // no function to do this. static const int kStartFetchDelaySeconds = 7; - MessageLoop::current()->PostDelayedTask(FROM_HERE, + base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&IntranetRedirectDetector::FinishSleep, weak_factory_.GetWeakPtr()), base::TimeDelta::FromSeconds(kStartFetchDelaySeconds)); @@ -159,7 +159,7 @@ void IntranetRedirectDetector::OnIPAddressChanged() { // delay this a little bit. in_sleep_ = true; static const int kNetworkSwitchDelayMS = 1000; - MessageLoop::current()->PostDelayedTask(FROM_HERE, + base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&IntranetRedirectDetector::FinishSleep, weak_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(kNetworkSwitchDelayMS)); diff --git a/chrome/browser/invalidation/invalidator_storage_unittest.cc b/chrome/browser/invalidation/invalidator_storage_unittest.cc index 5e59b43..76dea3a 100644 --- a/chrome/browser/invalidation/invalidator_storage_unittest.cc +++ b/chrome/browser/invalidation/invalidator_storage_unittest.cc @@ -58,7 +58,7 @@ class InvalidatorStorageTest : public testing::Test { const invalidation::ObjectId kAppNotificationsId_; const invalidation::ObjectId kAutofillId_; - MessageLoop loop_; + base::MessageLoop loop_; }; // Set invalidation states for various keys and verify that they are written and diff --git a/chrome/browser/jankometer.cc b/chrome/browser/jankometer.cc index b094ec6..0cc1388 100644 --- a/chrome/browser/jankometer.cc +++ b/chrome/browser/jankometer.cc @@ -210,8 +210,8 @@ int JankObserverHelper::discard_count_ = 99; // Measure only 1 in 100. //------------------------------------------------------------------------------ class IOJankObserver : public base::RefCountedThreadSafe<IOJankObserver>, - public MessageLoopForIO::IOObserver, - public MessageLoop::TaskObserver { + public base::MessageLoopForIO::IOObserver, + public base::MessageLoop::TaskObserver { public: IOJankObserver(const char* thread_name, TimeDelta excessive_duration, @@ -222,14 +222,14 @@ class IOJankObserver : public base::RefCountedThreadSafe<IOJankObserver>, // attach to the current thread, so this function can be invoked on another // thread to attach it. void AttachToCurrentThread() { - MessageLoop::current()->AddTaskObserver(this); - MessageLoopForIO::current()->AddIOObserver(this); + base::MessageLoop::current()->AddTaskObserver(this); + base::MessageLoopForIO::current()->AddIOObserver(this); } // Detaches the observer to the current thread's message loop. void DetachFromCurrentThread() { - MessageLoopForIO::current()->RemoveIOObserver(this); - MessageLoop::current()->RemoveTaskObserver(this); + base::MessageLoopForIO::current()->RemoveIOObserver(this); + base::MessageLoop::current()->RemoveTaskObserver(this); } virtual void WillProcessIOEvent() OVERRIDE { @@ -266,8 +266,8 @@ class IOJankObserver : public base::RefCountedThreadSafe<IOJankObserver>, //------------------------------------------------------------------------------ class UIJankObserver : public base::RefCountedThreadSafe<UIJankObserver>, - public MessageLoop::TaskObserver, - public MessageLoopForUI::Observer { + public base::MessageLoop::TaskObserver, + public base::MessageLoopForUI::Observer { public: UIJankObserver(const char* thread_name, TimeDelta excessive_duration, @@ -278,16 +278,16 @@ class UIJankObserver : public base::RefCountedThreadSafe<UIJankObserver>, // attach to the current thread, so this function can be invoked on another // thread to attach it. void AttachToCurrentThread() { - DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI); - MessageLoopForUI::current()->AddObserver(this); - MessageLoop::current()->AddTaskObserver(this); + DCHECK_EQ(base::MessageLoop::current()->type(), base::MessageLoop::TYPE_UI); + base::MessageLoopForUI::current()->AddObserver(this); + base::MessageLoop::current()->AddTaskObserver(this); } // Detaches the observer to the current thread's message loop. void DetachFromCurrentThread() { - DCHECK_EQ(MessageLoop::current()->type(), MessageLoop::TYPE_UI); - MessageLoop::current()->RemoveTaskObserver(this); - MessageLoopForUI::current()->RemoveObserver(this); + DCHECK_EQ(base::MessageLoop::current()->type(), base::MessageLoop::TYPE_UI); + base::MessageLoop::current()->RemoveTaskObserver(this); + base::MessageLoopForUI::current()->RemoveObserver(this); } virtual void WillProcessTask(const base::PendingTask& pending_task) OVERRIDE { diff --git a/chrome/browser/lifetime/application_lifetime.cc b/chrome/browser/lifetime/application_lifetime.cc index 87109c5..f0cd3d1 100644 --- a/chrome/browser/lifetime/application_lifetime.cc +++ b/chrome/browser/lifetime/application_lifetime.cc @@ -302,7 +302,7 @@ void EndKeepAlive() { // (MessageLoop::current() == null). if (chrome::GetTotalBrowserCount() == 0 && !browser_shutdown::IsTryingToQuit() && - MessageLoop::current()) { + base::MessageLoop::current()) { CloseAllBrowsers(); } } diff --git a/chrome/browser/logging_chrome_browsertest.cc b/chrome/browser/logging_chrome_browsertest.cc index df32456..d45b3f2 100644 --- a/chrome/browser/logging_chrome_browsertest.cc +++ b/chrome/browser/logging_chrome_browsertest.cc @@ -81,7 +81,7 @@ class RendererCrashTest : public InProcessBrowserTest, if (status == base::TERMINATION_STATUS_PROCESS_CRASHED || status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION) { saw_crash_ = true; - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } diff --git a/chrome/browser/managed_mode/managed_mode_unittest.cc b/chrome/browser/managed_mode/managed_mode_unittest.cc index 2556a5a..4e26107 100644 --- a/chrome/browser/managed_mode/managed_mode_unittest.cc +++ b/chrome/browser/managed_mode/managed_mode_unittest.cc @@ -118,7 +118,7 @@ class MockCallback : public base::RefCountedThreadSafe<MockCallback> { class ManagedModeTest : public ::testing::Test { public: - ManagedModeTest() : message_loop_(MessageLoop::TYPE_UI), + ManagedModeTest() : message_loop_(base::MessageLoop::TYPE_UI), ui_thread_(content::BrowserThread::UI, &message_loop_), io_thread_(content::BrowserThread::IO, &message_loop_) { } @@ -134,7 +134,7 @@ class ManagedModeTest : public ::testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; TestingProfile managed_mode_profile_; diff --git a/chrome/browser/managed_mode/managed_mode_url_filter_unittest.cc b/chrome/browser/managed_mode/managed_mode_url_filter_unittest.cc index e95f977..fb97e57 100644 --- a/chrome/browser/managed_mode/managed_mode_url_filter_unittest.cc +++ b/chrome/browser/managed_mode/managed_mode_url_filter_unittest.cc @@ -33,7 +33,7 @@ class ManagedModeURLFilterTest : public ::testing::Test, ManagedModeURLFilter::ALLOW; } - MessageLoop message_loop_; + base::MessageLoop message_loop_; base::RunLoop run_loop_; scoped_refptr<ManagedModeURLFilter> filter_; }; diff --git a/chrome/browser/managed_mode/managed_user_service_unittest.cc b/chrome/browser/managed_mode/managed_user_service_unittest.cc index 3cdf171..ce7b38e 100644 --- a/chrome/browser/managed_mode/managed_user_service_unittest.cc +++ b/chrome/browser/managed_mode/managed_user_service_unittest.cc @@ -63,7 +63,7 @@ class ManagedUserServiceTest : public ::testing::Test { virtual ~ManagedUserServiceTest() {} protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; TestingProfile profile_; ManagedUserService managed_user_service_; diff --git a/chrome/browser/media_galleries/fileapi/itunes_finder_win_unittest.cc b/chrome/browser/media_galleries/fileapi/itunes_finder_win_unittest.cc index ed3fb39..c8977fc 100644 --- a/chrome/browser/media_galleries/fileapi/itunes_finder_win_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/itunes_finder_win_unittest.cc @@ -94,7 +94,7 @@ class ITunesFinderWinTest : public testing::Test { base::ScopedTempDir app_data_dir_; base::ScopedTempDir music_dir_; - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc index fbff05d..73dbd76 100644 --- a/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/native_media_file_util_unittest.cc @@ -196,7 +196,7 @@ class NativeMediaFileUtilTest : public testing::Test { } private: - MessageLoop message_loop_; + base::MessageLoop message_loop_; base::ScopedTempDir data_dir_; scoped_refptr<fileapi::FileSystemContext> file_system_context_; @@ -230,7 +230,7 @@ TEST_F(NativeMediaFileUtilTest, DirectoryExistsAndFileExistsFiltering) { operation->FileExists( url, base::Bind(&ExpectEqHelper, test_name, expectation)); } - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } } @@ -244,7 +244,7 @@ TEST_F(NativeMediaFileUtilTest, ReadDirectoryFiltering) { bool completed = false; NewOperation(url)->ReadDirectory( url, base::Bind(&DidReadDirectory, &content, &completed)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(completed); EXPECT_EQ(6u, content.size()); @@ -282,7 +282,7 @@ TEST_F(NativeMediaFileUtilTest, CreateFileAndCreateDirectoryFiltering) { operation->CreateFile( url, false, base::Bind(&ExpectEqHelper, test_name, expectation)); } - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } } } @@ -321,7 +321,7 @@ TEST_F(NativeMediaFileUtilTest, CopySourceFiltering) { } operation->Copy( url, dest_url, base::Bind(&ExpectEqHelper, test_name, expectation)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } } } @@ -387,7 +387,7 @@ TEST_F(NativeMediaFileUtilTest, CopyDestFiltering) { } operation->Copy( src_url, url, base::Bind(&ExpectEqHelper, test_name, expectation)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } } } @@ -426,7 +426,7 @@ TEST_F(NativeMediaFileUtilTest, MoveSourceFiltering) { } operation->Move( url, dest_url, base::Bind(&ExpectEqHelper, test_name, expectation)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } } } @@ -494,7 +494,7 @@ TEST_F(NativeMediaFileUtilTest, MoveDestFiltering) { } operation->Move( src_url, url, base::Bind(&ExpectEqHelper, test_name, expectation)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } } } @@ -525,7 +525,7 @@ TEST_F(NativeMediaFileUtilTest, GetMetadataFiltering) { test_name, expectation, kFilteringTestCases[i].is_directory)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } } } @@ -553,7 +553,7 @@ TEST_F(NativeMediaFileUtilTest, RemoveFiltering) { } operation->Remove( url, false, base::Bind(&ExpectEqHelper, test_name, expectation)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } } } @@ -584,7 +584,7 @@ TEST_F(NativeMediaFileUtilTest, TruncateFiltering) { } operation->Truncate( url, 0, base::Bind(&ExpectEqHelper, test_name, expectation)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } } } @@ -614,7 +614,7 @@ TEST_F(NativeMediaFileUtilTest, TouchFileFiltering) { } operation->TouchFile( url, time, time, base::Bind(&ExpectEqHelper, test_name, expectation)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } } } @@ -646,7 +646,7 @@ TEST_F(NativeMediaFileUtilTest, CreateSnapshot) { error = base::PLATFORM_FILE_ERROR_FAILED; operation->CreateSnapshotFile(url, base::Bind(CreateSnapshotCallback, &error)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_EQ(expected_error, error); } } diff --git a/chrome/browser/media_galleries/fileapi/picasa/picasa_file_util_unittest.cc b/chrome/browser/media_galleries/fileapi/picasa/picasa_file_util_unittest.cc index d2601e4..0ca6a9f 100644 --- a/chrome/browser/media_galleries/fileapi/picasa/picasa_file_util_unittest.cc +++ b/chrome/browser/media_galleries/fileapi/picasa/picasa_file_util_unittest.cc @@ -252,7 +252,7 @@ class PicasaFileUtilTest : public testing::Test { bool completed = false; NewOperation(url)->ReadDirectory( url, base::Bind(&DidReadDirectory, &contents, &completed)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_TRUE(completed); ASSERT_EQ(test_folders.size(), contents.size()); @@ -275,7 +275,7 @@ class PicasaFileUtilTest : public testing::Test { folder_url, base::Bind(&DidReadDirectory, &folder_contents, &folder_read_completed)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(folder_read_completed); @@ -304,7 +304,7 @@ class PicasaFileUtilTest : public testing::Test { bool completed = false; NewOperation(url)->ReadDirectory( url, base::Bind(&DidReadDirectory, &contents, &completed)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_FALSE(completed); } @@ -324,7 +324,7 @@ class PicasaFileUtilTest : public testing::Test { } private: - MessageLoop message_loop_; + base::MessageLoop message_loop_; base::ScopedTempDir profile_dir_; @@ -409,7 +409,7 @@ TEST_F(PicasaFileUtilTest, RootFolders) { bool completed = false; NewOperation(url)->ReadDirectory( url, base::Bind(&DidReadDirectory, &contents, &completed)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_TRUE(completed); ASSERT_EQ(2u, contents.size()); diff --git a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm index 67971b9..c88493b 100644 --- a/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm +++ b/chrome/browser/media_galleries/mac/mtp_device_delegate_impl_mac_unittest.mm @@ -298,7 +298,7 @@ class MTPDeviceDelegateImplMacTest : public testing::Test { } protected: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; // Note: threads must be made in this order: UI > FILE > IO scoped_ptr<content::TestBrowserThread> ui_thread_; scoped_ptr<content::TestBrowserThread> file_thread_; diff --git a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc index 10db660..414f94d 100644 --- a/chrome/browser/media_galleries/media_file_system_registry_unittest.cc +++ b/chrome/browser/media_galleries/media_file_system_registry_unittest.cc @@ -478,7 +478,7 @@ ProfileState::~ProfileState() { shared_web_contents2_.reset(); profile_.reset(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } MediaGalleriesPreferences* ProfileState::GetMediaGalleriesPrefs() { @@ -500,7 +500,7 @@ void ProfileState::CheckGalleries( base::Bind(&ProfileState::CompareResults, base::Unretained(this), base::StringPrintf("%s (no permission)", test.c_str()), base::ConstRef(empty_expectation))); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1, GetAndClearComparisonCount()); // Read permission only. @@ -509,7 +509,7 @@ void ProfileState::CheckGalleries( base::Bind(&ProfileState::CompareResults, base::Unretained(this), base::StringPrintf("%s (regular permission)", test.c_str()), base::ConstRef(regular_extension_galleries))); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1, GetAndClearComparisonCount()); // All galleries permission. @@ -518,7 +518,7 @@ void ProfileState::CheckGalleries( base::Bind(&ProfileState::CompareResults, base::Unretained(this), base::StringPrintf("%s (all permission)", test.c_str()), base::ConstRef(all_extension_galleries))); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(1, GetAndClearComparisonCount()); } @@ -530,7 +530,7 @@ FSInfoMap ProfileState::GetGalleriesInfo(extensions::Extension* extension) { registry->GetMediaFileSystemsForExtension( rvh, extension, base::Bind(&GetGalleryInfoCallback, base::Unretained(&results))); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); return results; } @@ -578,8 +578,8 @@ int ProfileState::GetAndClearComparisonCount() { ///////////////////////////////// MediaFileSystemRegistryTest::MediaFileSystemRegistryTest() - : ui_thread_(content::BrowserThread::UI, MessageLoop::current()), - file_thread_(content::BrowserThread::FILE, MessageLoop::current()) { + : ui_thread_(content::BrowserThread::UI, base::MessageLoop::current()), + file_thread_(content::BrowserThread::FILE, base::MessageLoop::current()) { } void MediaFileSystemRegistryTest::CreateProfileState(size_t profile_count) { @@ -616,14 +616,14 @@ std::string MediaFileSystemRegistryTest::AttachDevice( DCHECK(StorageInfo::IsRemovableDevice(device_id)); string16 name = location.LossyDisplayName(); ProcessAttach(device_id, name, location.value()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); return device_id; } void MediaFileSystemRegistryTest::DetachDevice(const std::string& device_id) { DCHECK(StorageInfo::IsRemovableDevice(device_id)); ProcessDetach(device_id); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } void MediaFileSystemRegistryTest::SetGalleryPermission( @@ -760,7 +760,7 @@ void MediaFileSystemRegistryTest::TearDown() { g_browser_process->media_file_system_registry(); EXPECT_EQ(0U, registry->GetExtensionGalleriesHostCountForTests()); BrowserThread::GetBlockingPool()->FlushForTesting(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } /////////// @@ -861,7 +861,7 @@ TEST_F(MediaFileSystemRegistryTest, break; } } - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(forget_gallery); EXPECT_EQ(gallery_count, GetAutoAddedGalleries(profile_state).size()); diff --git a/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc b/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc index 0ef7654..bd034d4 100644 --- a/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc +++ b/chrome/browser/media_galleries/media_galleries_preferences_unittest.cc @@ -78,7 +78,7 @@ class MediaGalleriesPreferencesTest : public testing::Test { // TestExtensionSystem uses DeleteSoon, so we need to delete the profile // and then run the message queue to clean up. profile_.reset(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } virtual void SetUp() OVERRIDE { @@ -212,7 +212,7 @@ class MediaGalleriesPreferencesTest : public testing::Test { private: // Needed for extension service & friends to work. - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/metrics/metrics_log_unittest.cc b/chrome/browser/metrics/metrics_log_unittest.cc index f3a931a..8dd1a3f 100644 --- a/chrome/browser/metrics/metrics_log_unittest.cc +++ b/chrome/browser/metrics/metrics_log_unittest.cc @@ -120,7 +120,8 @@ class TestMetricsLog : public MetricsLog { class MetricsLogTest : public testing::Test { public: - MetricsLogTest() : message_loop_(MessageLoop::TYPE_IO) {} + MetricsLogTest() : message_loop_(base::MessageLoop::TYPE_IO) {} + protected: void TestRecordEnvironment(bool proto_only) { TestMetricsLog log(kClientId, kSessionId); @@ -178,7 +179,7 @@ class MetricsLogTest : public testing::Test { private: // This is necessary because eventually some tests call base::RepeatingTimer // functions and a message loop is required for that. - MessageLoop message_loop_; + base::MessageLoop message_loop_; #if defined(OS_CHROMEOS) chromeos::MockDBusThreadManagerWithoutGMock* mock_dbus_thread_manager_; diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc index 213a288..db2f67f 100644 --- a/chrome/browser/metrics/metrics_service.cc +++ b/chrome/browser/metrics/metrics_service.cc @@ -380,7 +380,7 @@ class MetricsMemoryDetails : public MemoryDetails { : callback_(callback) {} virtual void OnDetailsAvailable() OVERRIDE { - MessageLoop::current()->PostTask(FROM_HERE, callback_); + base::MessageLoop::current()->PostTask(FROM_HERE, callback_); } private: @@ -960,7 +960,7 @@ void MetricsService::OnInitTaskGotPluginInfo( FROM_HERE, base::Bind(&MetricsService::InitTaskGetGoogleUpdateData, self_ptr_factory_.GetWeakPtr(), - MessageLoop::current()->message_loop_proxy())); + base::MessageLoop::current()->message_loop_proxy())); } // static @@ -1071,7 +1071,7 @@ std::string MetricsService::GenerateClientID() { void MetricsService::ScheduleNextStateSave() { state_saver_factory_.InvalidateWeakPtrs(); - MessageLoop::current()->PostDelayedTask(FROM_HERE, + base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&MetricsService::SaveLocalState, state_saver_factory_.GetWeakPtr()), base::TimeDelta::FromMinutes(kSaveStateIntervalMinutes)); @@ -1112,7 +1112,7 @@ void MetricsService::OpenNewLog() { FROM_HERE, base::Bind(&MetricsService::InitTaskGetHardwareClass, self_ptr_factory_.GetWeakPtr(), - MessageLoop::current()->message_loop_proxy()), + base::MessageLoop::current()->message_loop_proxy()), base::TimeDelta::FromSeconds(kInitializationDelaySeconds)); } } @@ -1263,7 +1263,7 @@ void MetricsService::OnMemoryDetailCollectionDone() { // child processes. Wait time specifies how long to wait before absolutely // calling us back on the task. content::FetchHistogramsAsynchronously( - MessageLoop::current(), callback, + base::MessageLoop::current(), callback, base::TimeDelta::FromMilliseconds(kMaxHistogramGatheringWaitDuration)); } diff --git a/chrome/browser/metrics/metrics_service_unittest.cc b/chrome/browser/metrics/metrics_service_unittest.cc index 6ae029c..e65444e4 100644 --- a/chrome/browser/metrics/metrics_service_unittest.cc +++ b/chrome/browser/metrics/metrics_service_unittest.cc @@ -30,7 +30,7 @@ class MetricsServiceTest : public testing::Test { } private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; ScopedTestingLocalState testing_local_state_; diff --git a/chrome/browser/metrics/thread_watcher.cc b/chrome/browser/metrics/thread_watcher.cc index bd5d498..4109105 100644 --- a/chrome/browser/metrics/thread_watcher.cc +++ b/chrome/browser/metrics/thread_watcher.cc @@ -184,7 +184,7 @@ void ThreadWatcher::ActivateThreadWatching() { active_ = true; ping_count_ = unresponsive_threshold_; ResetHangCounters(); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ThreadWatcher::PostPingMessage, weak_ptr_factory_.GetWeakPtr())); @@ -240,7 +240,7 @@ void ThreadWatcher::PostPingMessage() { base::Bind(&ThreadWatcher::OnPingMessage, thread_id_, callback))) { // Post a task to check the responsiveness of watched thread. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ThreadWatcher::OnCheckResponsiveness, weak_ptr_factory_.GetWeakPtr(), ping_sequence_number_), @@ -276,7 +276,7 @@ void ThreadWatcher::OnPongMessage(uint64 ping_sequence_number) { if (!active_ || --ping_count_ <= 0) return; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ThreadWatcher::PostPingMessage, weak_ptr_factory_.GetWeakPtr()), @@ -305,7 +305,7 @@ void ThreadWatcher::OnCheckResponsiveness(uint64 ping_sequence_number) { GotNoResponse(); // Post a task to check the responsiveness of watched thread. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ThreadWatcher::OnCheckResponsiveness, weak_ptr_factory_.GetWeakPtr(), ping_sequence_number_), @@ -787,7 +787,7 @@ WatchDogThread::~WatchDogThread() { bool WatchDogThread::CurrentlyOnWatchDogThread() { base::AutoLock lock(g_watchdog_lock.Get()); return g_watchdog_thread && - g_watchdog_thread->message_loop() == MessageLoop::current(); + g_watchdog_thread->message_loop() == base::MessageLoop::current(); } // static @@ -811,7 +811,7 @@ bool WatchDogThread::PostTaskHelper( { base::AutoLock lock(g_watchdog_lock.Get()); - MessageLoop* message_loop = g_watchdog_thread ? + base::MessageLoop* message_loop = g_watchdog_thread ? g_watchdog_thread->message_loop() : NULL; if (message_loop) { message_loop->PostDelayedTask(from_here, task, delay); @@ -933,7 +933,7 @@ void StartupTimeBomb::DeleteStartupWatchdog() { startup_watchdog_ = NULL; return; } - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&StartupTimeBomb::DeleteStartupWatchdog, base::Unretained(this)), diff --git a/chrome/browser/metrics/variations/resource_request_allowed_notifier_unittest.cc b/chrome/browser/metrics/variations/resource_request_allowed_notifier_unittest.cc index e0275e4..04f8e6e 100644 --- a/chrome/browser/metrics/variations/resource_request_allowed_notifier_unittest.cc +++ b/chrome/browser/metrics/variations/resource_request_allowed_notifier_unittest.cc @@ -26,7 +26,7 @@ class TestNetworkChangeNotifier : public net::NetworkChangeNotifier { net::NetworkChangeNotifier::ConnectionType type) { connection_type_to_return_ = type; net::NetworkChangeNotifier::NotifyObserversOfConnectionTypeChange(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } private: @@ -139,7 +139,7 @@ class ResourceRequestAllowedNotifierTest } private: - MessageLoopForUI message_loop; + base::MessageLoopForUI message_loop; content::TestBrowserThread ui_thread; TestNetworkChangeNotifier network_notifier; TestRequestAllowedNotifier resource_request_allowed_notifier_; diff --git a/chrome/browser/metrics/variations/variations_http_header_provider.cc b/chrome/browser/metrics/variations/variations_http_header_provider.cc index bcc7a4a..6a0e565 100644 --- a/chrome/browser/metrics/variations/variations_http_header_provider.cc +++ b/chrome/browser/metrics/variations/variations_http_header_provider.cc @@ -90,7 +90,7 @@ void VariationsHttpHeaderProvider::InitVariationIDsCacheIfNeeded() { // Register for additional cache updates. This is done first to avoid a race // that could cause registered FieldTrials to be missed. - DCHECK(MessageLoop::current()); + DCHECK(base::MessageLoop::current()); base::FieldTrialList::AddObserver(this); base::TimeTicks before_time = base::TimeTicks::Now(); diff --git a/chrome/browser/metrics/variations/variations_service_unittest.cc b/chrome/browser/metrics/variations/variations_service_unittest.cc index e3700e4..cdf9e49 100644 --- a/chrome/browser/metrics/variations/variations_service_unittest.cc +++ b/chrome/browser/metrics/variations/variations_service_unittest.cc @@ -654,7 +654,7 @@ TEST_F(VariationsServiceTest, ValidateStudy) { } TEST_F(VariationsServiceTest, RequestsInitiallyNotAllowed) { - MessageLoopForUI message_loop; + base::MessageLoopForUI message_loop; content::TestBrowserThread ui_thread(content::BrowserThread::UI, &message_loop); TestingPrefServiceSimple prefs; @@ -675,7 +675,7 @@ TEST_F(VariationsServiceTest, RequestsInitiallyNotAllowed) { } TEST_F(VariationsServiceTest, RequestsInitiallyAllowed) { - MessageLoopForUI message_loop; + base::MessageLoopForUI message_loop; content::TestBrowserThread ui_thread(content::BrowserThread::UI, &message_loop); TestingPrefServiceSimple prefs; @@ -692,7 +692,7 @@ TEST_F(VariationsServiceTest, RequestsInitiallyAllowed) { } TEST_F(VariationsServiceTest, SeedStoredWhenOKStatus) { - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread io_thread(content::BrowserThread::IO, &message_loop); TestingPrefServiceSimple prefs; @@ -723,7 +723,7 @@ TEST_F(VariationsServiceTest, SeedNotStoredWhenNonOKStatus) { net::HTTP_SERVICE_UNAVAILABLE, }; - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread io_thread(content::BrowserThread::IO, &message_loop); TestingPrefServiceSimple prefs; diff --git a/chrome/browser/nacl_host/nacl_browser.cc b/chrome/browser/nacl_host/nacl_browser.cc index d05d42e..fd042ae 100644 --- a/chrome/browser/nacl_host/nacl_browser.cc +++ b/chrome/browser/nacl_host/nacl_browser.cc @@ -351,7 +351,7 @@ void NaClBrowser::CheckWaiting() { // process host. for (std::vector<base::Closure>::iterator iter = waiting_.begin(); iter != waiting_.end(); ++iter) { - MessageLoop::current()->PostTask(FROM_HERE, *iter); + base::MessageLoop::current()->PostTask(FROM_HERE, *iter); } waiting_.clear(); } @@ -442,7 +442,7 @@ void NaClBrowser::MarkValidationCacheAsModified() { if (!validation_cache_is_modified_) { // Wait before persisting to disk. This can coalesce multiple cache // modifications info a single disk write. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&NaClBrowser::PersistValidationCache, weak_factory_.GetWeakPtr()), diff --git a/chrome/browser/nacl_host/nacl_process_host.cc b/chrome/browser/nacl_host/nacl_process_host.cc index a2f383e..e67b0df 100644 --- a/chrome/browser/nacl_host/nacl_process_host.cc +++ b/chrome/browser/nacl_host/nacl_process_host.cc @@ -404,7 +404,7 @@ scoped_ptr<CommandLine> NaClProcessHost::GetCommandForLaunchWithGdb( } #elif defined(OS_LINUX) class NaClProcessHost::NaClGdbWatchDelegate - : public MessageLoopForIO::Watcher { + : public base::MessageLoopForIO::Watcher { public: // fd_write_ is used by nacl-gdb via /proc/browser_PID/fd/fd_write_ NaClGdbWatchDelegate(int fd_read, int fd_write, @@ -482,10 +482,10 @@ bool NaClProcessHost::LaunchNaClGdb(base::ProcessId pid) { fds[0], fds[1], base::Bind(&NaClProcessHost::OnNaClGdbAttached, weak_factory_.GetWeakPtr()))); - MessageLoopForIO::current()->WatchFileDescriptor( + base::MessageLoopForIO::current()->WatchFileDescriptor( fds[0], true, - MessageLoopForIO::WATCH_READ, + base::MessageLoopForIO::WATCH_READ, &nacl_gdb_watcher_, nacl_gdb_watcher_delegate_.get()); return base::LaunchProcess(cmd_line, base::LaunchOptions(), NULL); diff --git a/chrome/browser/nacl_host/nacl_process_host.h b/chrome/browser/nacl_host/nacl_process_host.h index 584dc9a..eb70b97 100644 --- a/chrome/browser/nacl_host/nacl_process_host.h +++ b/chrome/browser/nacl_host/nacl_process_host.h @@ -169,7 +169,7 @@ class NaClProcessHost : public content::BrowserChildProcessHostDelegate { bool process_launched_by_broker_; #elif defined(OS_LINUX) bool wait_for_nacl_gdb_; - MessageLoopForIO::FileDescriptorWatcher nacl_gdb_watcher_; + base::MessageLoopForIO::FileDescriptorWatcher nacl_gdb_watcher_; class NaClGdbWatchDelegate; scoped_ptr<NaClGdbWatchDelegate> nacl_gdb_watcher_delegate_; diff --git a/chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc b/chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc index f1d1714..eb5677e 100644 --- a/chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc +++ b/chrome/browser/net/chrome_fraudulent_certificate_reporter_unittest.cc @@ -184,21 +184,21 @@ TEST(ChromeFraudulentCertificateReporterTest, GoodBadInfo) { } TEST(ChromeFraudulentCertificateReporterTest, ReportIsSent) { - MessageLoop loop(MessageLoop::TYPE_IO); + base::MessageLoop loop(base::MessageLoop::TYPE_IO); content::TestBrowserThread io_thread(BrowserThread::IO, &loop); loop.PostTask(FROM_HERE, base::Bind(&DoReportIsSent)); loop.RunUntilIdle(); } TEST(ChromeFraudulentCertificateReporterTest, MockReportIsSent) { - MessageLoop loop(MessageLoop::TYPE_IO); + base::MessageLoop loop(base::MessageLoop::TYPE_IO); content::TestBrowserThread io_thread(BrowserThread::IO, &loop); loop.PostTask(FROM_HERE, base::Bind(&DoMockReportIsSent)); loop.RunUntilIdle(); } TEST(ChromeFraudulentCertificateReporterTest, ReportIsNotSent) { - MessageLoop loop(MessageLoop::TYPE_IO); + base::MessageLoop loop(base::MessageLoop::TYPE_IO); content::TestBrowserThread io_thread(BrowserThread::IO, &loop); loop.PostTask(FROM_HERE, base::Bind(&DoReportIsNotSent)); loop.RunUntilIdle(); diff --git a/chrome/browser/net/chrome_network_delegate_unittest.cc b/chrome/browser/net/chrome_network_delegate_unittest.cc index 6afbfa2..9e9d626 100644 --- a/chrome/browser/net/chrome_network_delegate_unittest.cc +++ b/chrome/browser/net/chrome_network_delegate_unittest.cc @@ -78,7 +78,7 @@ class ChromeNetworkDelegateTest : public testing::Test { private: bool never_throttle_requests_original_value_; - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; scoped_refptr<extensions::EventRouterForwarder> forwarder_; BooleanPrefMember pref_member_; @@ -131,13 +131,13 @@ class ChromeNetworkDelegateSafeSearchTest : public testing::Test { GURL(url_string), &delegate_, &context_, network_delegate_); request.Start(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(expected_query_parameters, request.url().query()); } private: - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; scoped_refptr<extensions::EventRouterForwarder> forwarder_; @@ -316,7 +316,7 @@ class ChromeNetworkDelegatePrivacyModeTest : public testing::Test { } protected: - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; scoped_refptr<extensions::EventRouterForwarder> forwarder_; diff --git a/chrome/browser/net/connection_tester.cc b/chrome/browser/net/connection_tester.cc index c28fca1..4a7d56e 100644 --- a/chrome/browser/net/connection_tester.cc +++ b/chrome/browser/net/connection_tester.cc @@ -388,7 +388,7 @@ void ConnectionTester::TestRunner::OnResponseCompleted( // Post a task to notify the parent rather than handling it right away, // to avoid re-entrancy problems with URLRequest. (Don't want the caller // to end up deleting the URLRequest while in the middle of processing). - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&TestRunner::OnExperimentCompletedWithResult, weak_factory_.GetWeakPtr(), result)); diff --git a/chrome/browser/net/connection_tester_unittest.cc b/chrome/browser/net/connection_tester_unittest.cc index aafd6fe8..c386081 100644 --- a/chrome/browser/net/connection_tester_unittest.cc +++ b/chrome/browser/net/connection_tester_unittest.cc @@ -54,7 +54,7 @@ class ConnectionTesterDelegate : public ConnectionTester::Delegate { virtual void OnCompletedConnectionTestSuite() OVERRIDE { completed_connection_test_suite_count_++; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } int start_connection_test_suite_count() const { @@ -87,7 +87,7 @@ class ConnectionTesterDelegate : public ConnectionTester::Delegate { class ConnectionTesterTest : public PlatformTest { public: ConnectionTesterTest() - : message_loop_(MessageLoop::TYPE_IO), + : message_loop_(base::MessageLoop::TYPE_IO), io_thread_(BrowserThread::IO, &message_loop_), test_server_(net::SpawnedTestServer::TYPE_HTTP, net::SpawnedTestServer::kLocalhost, @@ -103,7 +103,7 @@ class ConnectionTesterTest : public PlatformTest { // SSLClientAuthCache calls RemoveObserver when destroyed, but if the // MessageLoop is already destroyed, then the RemoveObserver will be a // no-op, and the ObserverList will contain invalid entries. - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread io_thread_; net::SpawnedTestServer test_server_; ConnectionTesterDelegate test_delegate_; @@ -157,7 +157,7 @@ TEST_F(ConnectionTesterTest, RunAllTests) { tester.RunAllTests(test_server_.GetURL("echoall")); // Wait for all the tests to complete. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); const int kNumExperiments = ConnectionTester::PROXY_EXPERIMENT_COUNT * @@ -203,8 +203,9 @@ TEST_F(ConnectionTesterTest, DeleteWhileInProgress) { // |backup_task| that it will try to deref during the destructor, but // depending on the order that pending tasks were deleted in, it might // already be invalid! See http://crbug.com/43291. - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); } } // namespace diff --git a/chrome/browser/net/dns_probe_job.cc b/chrome/browser/net/dns_probe_job.cc index afa49cf..204484e 100644 --- a/chrome/browser/net/dns_probe_job.cc +++ b/chrome/browser/net/dns_probe_job.cc @@ -105,7 +105,7 @@ DnsProbeJobImpl::DnsProbeJobImpl(scoped_ptr<DnsClient> dns_client, DCHECK(dns_client_.get()); DCHECK(dns_client_->GetConfig()); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&DnsProbeJobImpl::Start, weak_factory_.GetWeakPtr())); diff --git a/chrome/browser/net/dns_probe_job_unittest.cc b/chrome/browser/net/dns_probe_job_unittest.cc index 1fe8766..d1779b1 100644 --- a/chrome/browser/net/dns_probe_job_unittest.cc +++ b/chrome/browser/net/dns_probe_job_unittest.cc @@ -70,7 +70,7 @@ void DnsProbeJobTest::RunProbe(MockDnsClientRule::Result good_result, callback_result_ = DnsProbeJob::SERVERS_UNKNOWN; // DnsProbeJob needs somewhere to post the callback. - scoped_ptr<MessageLoop> message_loop_(new MessageLoopForIO()); + scoped_ptr<base::MessageLoop> message_loop_(new base::MessageLoopForIO()); scoped_ptr<DnsProbeJob> job( DnsProbeJob::CreateJob(dns_client.Pass(), callback, net_log)); diff --git a/chrome/browser/net/dns_probe_service_unittest.cc b/chrome/browser/net/dns_probe_service_unittest.cc index cee5475..108332a 100644 --- a/chrome/browser/net/dns_probe_service_unittest.cc +++ b/chrome/browser/net/dns_probe_service_unittest.cc @@ -24,7 +24,7 @@ class MockDnsProbeJob : public DnsProbeJob { MockDnsProbeJob(const CallbackType& callback, DnsProbeJob::Result result) : weak_factory_(this) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&MockDnsProbeJob::CallCallback, weak_factory_.GetWeakPtr(), @@ -131,7 +131,7 @@ class DnsProbeServiceTest : public testing::Test { callback_called_ = false; } - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; TestDnsProbeService service_; bool callback_called_; DnsProbeResult callback_result_; diff --git a/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc b/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc index dc46f8b..2f14235 100644 --- a/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc +++ b/chrome/browser/net/http_pipelining_compatibility_client_unittest.cc @@ -204,7 +204,7 @@ class HttpPipeliningCompatibilityClientTest : public testing::Test { } } - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; net::SpawnedTestServer test_server_; net::TestURLRequestContextGetter* context_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/net/http_server_properties_manager_unittest.cc b/chrome/browser/net/http_server_properties_manager_unittest.cc index f3e1061..5ce5584 100644 --- a/chrome/browser/net/http_server_properties_manager_unittest.cc +++ b/chrome/browser/net/http_server_properties_manager_unittest.cc @@ -126,7 +126,7 @@ class HttpServerPropertiesManagerTest : public testing::Test { UpdatePrefsFromCacheOnIOConcrete)); } - MessageLoop loop_; + base::MessageLoop loop_; TestingPrefServiceSimple pref_service_; scoped_ptr<TestingHttpServerPropertiesManager> http_server_props_manager_; @@ -440,7 +440,7 @@ TEST_F(HttpServerPropertiesManagerTest, Clear) { ExpectPrefsUpdate(); // Clear http server data, time out if we do not get a completion callback. - http_server_props_manager_->Clear(MessageLoop::QuitClosure()); + http_server_props_manager_->Clear(base::MessageLoop::QuitClosure()); loop_.Run(); EXPECT_FALSE(http_server_props_manager_->SupportsSpdy(spdy_server_mail)); diff --git a/chrome/browser/net/load_timing_browsertest.cc b/chrome/browser/net/load_timing_browsertest.cc index 33c492b..e08ba23 100644 --- a/chrome/browser/net/load_timing_browsertest.cc +++ b/chrome/browser/net/load_timing_browsertest.cc @@ -135,7 +135,7 @@ class MockUrlRequestJobWithTiming : public net::URLRequestFileJob { base::TimeDelta::FromMilliseconds(100); } - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&MockUrlRequestJobWithTiming::DelayedStart, weak_factory_.GetWeakPtr()), diff --git a/chrome/browser/net/net_log_temp_file_unittest.cc b/chrome/browser/net/net_log_temp_file_unittest.cc index 6337b03..553c820 100644 --- a/chrome/browser/net/net_log_temp_file_unittest.cc +++ b/chrome/browser/net/net_log_temp_file_unittest.cc @@ -155,7 +155,7 @@ class NetLogTempFileTest : public ::testing::Test { base::FilePath net_export_log_; private: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread file_user_blocking_thread_; }; diff --git a/chrome/browser/net/network_stats.cc b/chrome/browser/net/network_stats.cc index 70f47ea..86a19f0 100644 --- a/chrome/browser/net/network_stats.cc +++ b/chrome/browser/net/network_stats.cc @@ -265,14 +265,14 @@ void NetworkStats::SendPacket() { void NetworkStats::SendNextPacketAfterDelay() { if (current_test_ == PACED_PACKET_TEST) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&NetworkStats::SendPacket, weak_factory_.GetWeakPtr()), average_time_); return; } - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&NetworkStats::SendPacket, weak_factory_.GetWeakPtr())); } @@ -324,7 +324,7 @@ void NetworkStats::OnReadComplete(int result) { // of 1ms so that the time-out will fire before we have time to really hog // the CPU too extensively (waiting for the time-out) in case of an infinite // loop. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&NetworkStats::ReadData, weak_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(1)); @@ -351,7 +351,7 @@ void NetworkStats::OnWriteComplete(int result) { DCHECK_EQ(bytes_to_send_, 0u); } - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&NetworkStats::SendPacket, weak_factory_.GetWeakPtr())); } @@ -432,7 +432,7 @@ void NetworkStats::DidSendData(int bytes_sent) { } void NetworkStats::StartReadDataTimer(int milliseconds) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&NetworkStats::OnReadDataTimeout, weak_factory_.GetWeakPtr(), @@ -649,7 +649,7 @@ void NetworkStats::Finish(Status status, int result) { if (next_test() == NON_PACED_PACKET_TEST || next_test() == PACED_PACKET_TEST) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&NetworkStats::RestartPacketTest, weak_factory_.GetWeakPtr())); diff --git a/chrome/browser/net/network_stats_unittest.cc b/chrome/browser/net/network_stats_unittest.cc index bb3093a..990419f 100644 --- a/chrome/browser/net/network_stats_unittest.cc +++ b/chrome/browser/net/network_stats_unittest.cc @@ -24,7 +24,7 @@ class NetworkStatsTest : public PlatformTest { // Flush the message loop to make application verifiers happy. message_loop_.RunUntilIdle(); } - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; }; class NetworkStatsTestUDP : public NetworkStatsTest { diff --git a/chrome/browser/net/network_time_tracker.cc b/chrome/browser/net/network_time_tracker.cc index 1334fb6..ff4dae5 100644 --- a/chrome/browser/net/network_time_tracker.cc +++ b/chrome/browser/net/network_time_tracker.cc @@ -128,7 +128,7 @@ NetworkTimeTracker::BuildNotifierUpdateCallback() { net::NetworkTimeNotifier::ObserverCallback NetworkTimeTracker::BuildObserverCallback() { return base::Bind(&OnNetworkTimeUpdatedOnIOThread, - MessageLoop::current()->message_loop_proxy(), + base::MessageLoop::current()->message_loop_proxy(), base::Bind(&NetworkTimeTracker::OnNetworkTimeUpdate, weak_ptr_factory_.GetWeakPtr())); } diff --git a/chrome/browser/net/network_time_tracker_unittest.cc b/chrome/browser/net/network_time_tracker_unittest.cc index 7aa80ff..f6a33b6 100644 --- a/chrome/browser/net/network_time_tracker_unittest.cc +++ b/chrome/browser/net/network_time_tracker_unittest.cc @@ -124,7 +124,7 @@ class NetworkTimeTrackerTest : public testing::Test { private: // Message loop and threads for the tracker's internal logic. - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread; content::TestBrowserThread io_thread; diff --git a/chrome/browser/net/predictor.cc b/chrome/browser/net/predictor.cc index c321ed2..b1a3f60 100644 --- a/chrome/browser/net/predictor.cc +++ b/chrome/browser/net/predictor.cc @@ -1070,7 +1070,7 @@ void Predictor::PostIncrementalTrimTask() { return; const TimeDelta kDurationBetweenTrimmingIncrements = TimeDelta::FromSeconds(kDurationBetweenTrimmingIncrementsSeconds); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&Predictor::IncrementalTrimReferrers, weak_factory_->GetWeakPtr(), false), diff --git a/chrome/browser/net/predictor_browsertest.cc b/chrome/browser/net/predictor_browsertest.cc index 946d656..975ab56 100644 --- a/chrome/browser/net/predictor_browsertest.cc +++ b/chrome/browser/net/predictor_browsertest.cc @@ -69,7 +69,7 @@ class HostResolutionRequestRecorder : public net::HostResolverProc { if (is_waiting_for_hostname_ && waiting_for_hostname_ == hostname) { is_waiting_for_hostname_ = false; waiting_for_hostname_.clear(); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } diff --git a/chrome/browser/net/predictor_unittest.cc b/chrome/browser/net/predictor_unittest.cc index f509e1c..a2940a8 100644 --- a/chrome/browser/net/predictor_unittest.cc +++ b/chrome/browser/net/predictor_unittest.cc @@ -49,7 +49,7 @@ class WaitForResolutionHelper { // When all hostnames have been resolved, exit the loop. timer_->Stop(); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); delete timer_; delete this; } @@ -92,14 +92,14 @@ class PredictorTest : public testing::Test { timer->Start(FROM_HERE, TimeDelta::FromMilliseconds(100), new WaitForResolutionHelper(predictor, hosts, timer), &WaitForResolutionHelper::Run); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } private: // IMPORTANT: do not move this below |host_resolver_|; the host resolver // must not outlive the message loop, otherwise bad things can happen // (like posting to a deleted message loop). - MessageLoopForUI loop_; + base::MessageLoopForUI loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; @@ -127,18 +127,18 @@ TEST_F(PredictorTest, ShutdownWhenResolutionIsPendingTest) { testing_master.ResolveList(names, UrlInfo::PAGE_SCAN_MOTIVATED); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, - MessageLoop::QuitClosure(), + base::MessageLoop::QuitClosure(), base::TimeDelta::FromMilliseconds(500)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_FALSE(testing_master.WasFound(localhost)); testing_master.Shutdown(); // Clean up after ourselves. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } TEST_F(PredictorTest, SingleLookupTest) { @@ -158,7 +158,7 @@ TEST_F(PredictorTest, SingleLookupTest) { EXPECT_TRUE(testing_master.WasFound(goog)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_GT(testing_master.peak_pending_lookups(), names.size() / 2); EXPECT_LE(testing_master.peak_pending_lookups(), names.size()); @@ -203,7 +203,7 @@ TEST_F(PredictorTest, ConcurrentLookupTest) { EXPECT_FALSE(testing_master.WasFound(bad1)); EXPECT_FALSE(testing_master.WasFound(bad2)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(testing_master.WasFound(bad1)); EXPECT_FALSE(testing_master.WasFound(bad2)); @@ -232,7 +232,7 @@ TEST_F(PredictorTest, MassiveConcurrentLookupTest) { WaitForResolution(&testing_master, names); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_LE(testing_master.peak_pending_lookups(), names.size()); EXPECT_LE(testing_master.peak_pending_lookups(), diff --git a/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc b/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc index c69fc93..770c8a9 100644 --- a/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc +++ b/chrome/browser/net/pref_proxy_config_tracker_impl_unittest.cc @@ -105,7 +105,7 @@ class PrefProxyConfigTrackerImplTestBase : public TESTBASE { proxy_config_service_.reset(); } - MessageLoop loop_; + base::MessageLoop loop_; TestProxyConfigService* delegate_service_; // weak scoped_ptr<ChromeProxyConfigService> proxy_config_service_; net::ProxyConfig fixed_config_; diff --git a/chrome/browser/net/sdch_dictionary_fetcher.cc b/chrome/browser/net/sdch_dictionary_fetcher.cc index 008e9a4..0e7d8c9 100644 --- a/chrome/browser/net/sdch_dictionary_fetcher.cc +++ b/chrome/browser/net/sdch_dictionary_fetcher.cc @@ -54,7 +54,7 @@ void SdchDictionaryFetcher::Schedule(const GURL& dictionary_url) { void SdchDictionaryFetcher::ScheduleDelayedRun() { if (fetch_queue_.empty() || current_fetch_.get() || task_is_pending_) return; - MessageLoop::current()->PostDelayedTask(FROM_HERE, + base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&SdchDictionaryFetcher::StartFetching, weak_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(kMsDelayFromRequestTillDownload)); diff --git a/chrome/browser/net/sqlite_server_bound_cert_store_unittest.cc b/chrome/browser/net/sqlite_server_bound_cert_store_unittest.cc index 44af9d6..68097c2 100644 --- a/chrome/browser/net/sqlite_server_bound_cert_store_unittest.cc +++ b/chrome/browser/net/sqlite_server_bound_cert_store_unittest.cc @@ -97,7 +97,7 @@ class SQLiteServerBoundCertStoreTest : public testing::Test { "a", "b")); } - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; content::TestBrowserThread db_thread_; content::TestBrowserThread io_thread_; base::ScopedTempDir temp_dir_; diff --git a/chrome/browser/net/ssl_config_service_manager_pref_unittest.cc b/chrome/browser/net/ssl_config_service_manager_pref_unittest.cc index 0e8fc37..fa29093 100644 --- a/chrome/browser/net/ssl_config_service_manager_pref_unittest.cc +++ b/chrome/browser/net/ssl_config_service_manager_pref_unittest.cc @@ -54,7 +54,7 @@ class SSLConfigServiceManagerPrefTest : public testing::Test { return config.channel_id_enabled; } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; }; diff --git a/chrome/browser/net/transport_security_persister_unittest.cc b/chrome/browser/net/transport_security_persister_unittest.cc index 4177bc8..1c121e8 100644 --- a/chrome/browser/net/transport_security_persister_unittest.cc +++ b/chrome/browser/net/transport_security_persister_unittest.cc @@ -21,7 +21,7 @@ using net::TransportSecurityState; class TransportSecurityPersisterTest : public testing::Test { public: TransportSecurityPersisterTest() - : message_loop_(MessageLoop::TYPE_IO), + : message_loop_(base::MessageLoop::TYPE_IO), test_file_thread_(content::BrowserThread::FILE, &message_loop_), test_io_thread_(content::BrowserThread::IO, &message_loop_) { } @@ -39,7 +39,7 @@ class TransportSecurityPersisterTest : public testing::Test { protected: // Ordering is important here. If member variables are not destroyed in the // right order, then DCHECKs will fail all over the place. - MessageLoop message_loop_; + base::MessageLoop message_loop_; // Needed for ImportantFileWriter, which TransportSecurityPersister uses. content::TestBrowserThread test_file_thread_; diff --git a/chrome/browser/notifications/balloon_collection_impl.cc b/chrome/browser/notifications/balloon_collection_impl.cc index 08971de..1d032d2 100644 --- a/chrome/browser/notifications/balloon_collection_impl.cc +++ b/chrome/browser/notifications/balloon_collection_impl.cc @@ -235,14 +235,14 @@ gfx::Rect BalloonCollectionImpl::GetBalloonsBoundingBox() const { #if USE_OFFSETS void BalloonCollectionImpl::AddMessageLoopObserver() { if (!added_as_message_loop_observer_) { - MessageLoopForUI::current()->AddObserver(this); + base::MessageLoopForUI::current()->AddObserver(this); added_as_message_loop_observer_ = true; } } void BalloonCollectionImpl::RemoveMessageLoopObserver() { if (added_as_message_loop_observer_) { - MessageLoopForUI::current()->RemoveObserver(this); + base::MessageLoopForUI::current()->RemoveObserver(this); added_as_message_loop_observer_ = false; } } @@ -267,7 +267,7 @@ void BalloonCollectionImpl::HandleMouseMoveEvent() { // Mouse has left the region. Schedule a reposition after // a short delay. if (!reposition_factory_.HasWeakPtrs()) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&BalloonCollectionImpl::CancelOffsets, reposition_factory_.GetWeakPtr()), diff --git a/chrome/browser/notifications/balloon_collection_impl.h b/chrome/browser/notifications/balloon_collection_impl.h index cff7077..07b223d 100644 --- a/chrome/browser/notifications/balloon_collection_impl.h +++ b/chrome/browser/notifications/balloon_collection_impl.h @@ -36,7 +36,7 @@ class BalloonCollectionImpl : public BalloonCollection, public content::NotificationObserver #if USE_OFFSETS - , public MessageLoopForUI::Observer + , public base::MessageLoopForUI::Observer #endif { public: diff --git a/chrome/browser/notifications/desktop_notification_service_unittest.cc b/chrome/browser/notifications/desktop_notification_service_unittest.cc index 389b3d2..a9626e0 100644 --- a/chrome/browser/notifications/desktop_notification_service_unittest.cc +++ b/chrome/browser/notifications/desktop_notification_service_unittest.cc @@ -30,7 +30,7 @@ class ThreadProxy : public base::RefCountedThreadSafe<ThreadProxy> { // The current message loop was already initalized by the test superclass. ui_thread_.reset( new content::TestBrowserThread(BrowserThread::UI, - MessageLoop::current())); + base::MessageLoop::current())); // Create IO thread, start its message loop. io_thread_.reset(new content::TestBrowserThread(BrowserThread::IO)); diff --git a/chrome/browser/notifications/desktop_notifications_unittest.cc b/chrome/browser/notifications/desktop_notifications_unittest.cc index dbf7e1c..dfc9967 100644 --- a/chrome/browser/notifications/desktop_notifications_unittest.cc +++ b/chrome/browser/notifications/desktop_notifications_unittest.cc @@ -166,7 +166,7 @@ TEST_F(DesktopNotificationsTest, TestShow) { EXPECT_TRUE(service_->ShowDesktopNotification( params, 0, 0, DesktopNotificationService::PageNotification)); - MessageLoopForUI::current()->RunUntilIdle(); + base::MessageLoopForUI::current()->RunUntilIdle(); EXPECT_EQ(1, balloon_collection_->count()); content::ShowDesktopNotificationHostMsgParams params2; @@ -177,7 +177,7 @@ TEST_F(DesktopNotificationsTest, TestShow) { EXPECT_TRUE(service_->ShowDesktopNotification( params2, 0, 0, DesktopNotificationService::PageNotification)); - MessageLoopForUI::current()->RunUntilIdle(); + base::MessageLoopForUI::current()->RunUntilIdle(); EXPECT_EQ(2, balloon_collection_->count()); EXPECT_EQ("notification displayed\n" @@ -193,7 +193,7 @@ TEST_F(DesktopNotificationsTest, TestClose) { // Request a notification; should open a balloon. EXPECT_TRUE(service_->ShowDesktopNotification( params, 0, 0, DesktopNotificationService::PageNotification)); - MessageLoopForUI::current()->RunUntilIdle(); + base::MessageLoopForUI::current()->RunUntilIdle(); EXPECT_EQ(1, balloon_collection_->count()); // Close all the open balloons. @@ -219,14 +219,14 @@ TEST_F(DesktopNotificationsTest, TestCancel) { EXPECT_TRUE(service_->ShowDesktopNotification( params, process_id, route_id, DesktopNotificationService::PageNotification)); - MessageLoopForUI::current()->RunUntilIdle(); + base::MessageLoopForUI::current()->RunUntilIdle(); EXPECT_EQ(1, balloon_collection_->count()); // Cancel the same notification service_->CancelDesktopNotification(process_id, route_id, notification_id); - MessageLoopForUI::current()->RunUntilIdle(); + base::MessageLoopForUI::current()->RunUntilIdle(); // Verify that the balloon collection is now empty. EXPECT_EQ(0, balloon_collection_->count()); @@ -334,7 +334,7 @@ TEST_F(DesktopNotificationsTest, TestCancelByProfile) { params, process_id, route_id, DesktopNotificationService::PageNotification)); } - MessageLoopForUI::current()->RunUntilIdle(); + base::MessageLoopForUI::current()->RunUntilIdle(); ui_manager_->CancelAllByProfile(second_profile); @@ -371,7 +371,7 @@ TEST_F(DesktopNotificationsTest, TestCancelBySourceOrigin) { odd_params, process_id, route_id, DesktopNotificationService::PageNotification)); } - MessageLoopForUI::current()->RunUntilIdle(); + base::MessageLoopForUI::current()->RunUntilIdle(); ui_manager_->CancelAllBySourceOrigin(odd_params.origin); @@ -394,7 +394,7 @@ TEST_F(DesktopNotificationsTest, TestQueueing) { params, process_id, route_id, DesktopNotificationService::PageNotification)); } - MessageLoopForUI::current()->RunUntilIdle(); + base::MessageLoopForUI::current()->RunUntilIdle(); // Build up an expected log of what should be happening. std::string expected_log; @@ -416,7 +416,7 @@ TEST_F(DesktopNotificationsTest, TestQueueing) { id <= kLotsOfToasts - balloon_collection_->max_balloon_count(); ++id) { service_->CancelDesktopNotification(process_id, route_id, id); - MessageLoopForUI::current()->RunUntilIdle(); + base::MessageLoopForUI::current()->RunUntilIdle(); expected_log.append("notification closed by script\n"); expected_log.append("notification displayed\n"); EXPECT_EQ(balloon_collection_->max_balloon_count(), @@ -428,7 +428,7 @@ TEST_F(DesktopNotificationsTest, TestQueueing) { for (; id <= kLotsOfToasts; ++id) { service_->CancelDesktopNotification(process_id, route_id, id); expected_log.append("notification closed by script\n"); - MessageLoopForUI::current()->RunUntilIdle(); + base::MessageLoopForUI::current()->RunUntilIdle(); EXPECT_EQ(expected_log, log_output_); } } @@ -461,7 +461,7 @@ TEST_F(DesktopNotificationsTest, TestUserInputEscaping) { EXPECT_TRUE(service_->ShowDesktopNotification( params, 0, 0, DesktopNotificationService::PageNotification)); - MessageLoopForUI::current()->RunUntilIdle(); + base::MessageLoopForUI::current()->RunUntilIdle(); EXPECT_EQ(1, balloon_collection_->count()); Balloon* balloon = (*balloon_collection_->balloons().begin()); GURL data_url = balloon->notification().content_url(); diff --git a/chrome/browser/notifications/desktop_notifications_unittest.h b/chrome/browser/notifications/desktop_notifications_unittest.h index 2fda90d..1aa5947 100644 --- a/chrome/browser/notifications/desktop_notifications_unittest.h +++ b/chrome/browser/notifications/desktop_notifications_unittest.h @@ -96,7 +96,7 @@ class DesktopNotificationsTest : public testing::Test { // Create a message loop to allow notifications code to post tasks, // and a thread so that notifications code runs on the expected thread. - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; // Local state mock. diff --git a/chrome/browser/omnibox_search_hint.cc b/chrome/browser/omnibox_search_hint.cc index a4c93e2..b888623 100644 --- a/chrome/browser/omnibox_search_hint.cc +++ b/chrome/browser/omnibox_search_hint.cc @@ -136,7 +136,7 @@ HintInfoBarDelegate::HintInfoBarDelegate(OmniboxSearchHint* omnibox_hint, weak_factory_(this) { // We want the info-bar to stick-around for few seconds and then be hidden // on the next navigation after that. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&HintInfoBarDelegate::AllowExpiry, weak_factory_.GetWeakPtr()), base::TimeDelta::FromSeconds(8)); diff --git a/chrome/browser/page_cycler/page_cycler_browsertest.cc b/chrome/browser/page_cycler/page_cycler_browsertest.cc index 00c52a2..6edf4f2 100644 --- a/chrome/browser/page_cycler/page_cycler_browsertest.cc +++ b/chrome/browser/page_cycler/page_cycler_browsertest.cc @@ -117,7 +117,8 @@ class PageCyclerBrowserTest : public content::NotificationObserver, const content::NotificationDetails& details) OVERRIDE { switch (type) { case chrome::NOTIFICATION_BROWSER_CLOSED: - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask( + FROM_HERE, base::MessageLoop::QuitClosure()); break; default: NOTREACHED(); diff --git a/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc b/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc index 393ecdb..25cce09 100644 --- a/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc +++ b/chrome/browser/password_manager/native_backend_gnome_x_unittest.cc @@ -307,8 +307,9 @@ class NativeBackendGnomeTest : public testing::Test { } virtual void TearDown() { - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); db_thread_.Stop(); } @@ -320,11 +321,11 @@ class NativeBackendGnomeTest : public testing::Test { // quit so we can get on with the rest of the test. BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, base::Bind(&PostQuitTask, &message_loop_)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } - static void PostQuitTask(MessageLoop* loop) { - loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + static void PostQuitTask(base::MessageLoop* loop) { + loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } void CheckUint32Attribute(const MockKeyringItem* item, @@ -378,7 +379,7 @@ class NativeBackendGnomeTest : public testing::Test { CheckStringAttribute(item, "application", app_string); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; diff --git a/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc b/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc index 11af55a..0da3455 100644 --- a/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc +++ b/chrome/browser/password_manager/native_backend_kwallet_x_unittest.cc @@ -212,7 +212,7 @@ class NativeBackendKWalletTest : public NativeBackendKWalletTestBase { void CheckPasswordForms(const std::string& folder, const ExpectationArray& sorted_expected); - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; TestingProfile profile_; @@ -278,8 +278,9 @@ void NativeBackendKWalletTest::SetUp() { } void NativeBackendKWalletTest::TearDown() { - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); db_thread_.Stop(); } diff --git a/chrome/browser/password_manager/password_manager_unittest.cc b/chrome/browser/password_manager/password_manager_unittest.cc index 661d34f..dfdd956 100644 --- a/chrome/browser/password_manager/password_manager_unittest.cc +++ b/chrome/browser/password_manager/password_manager_unittest.cc @@ -50,7 +50,7 @@ ACTION_P(SaveToScopedPtr, scoped) { class PasswordManagerTest : public ChromeRenderViewHostTestHarness { public: PasswordManagerTest() - : ui_thread_(BrowserThread::UI, MessageLoopForUI::current()) {} + : ui_thread_(BrowserThread::UI, base::MessageLoopForUI::current()) {} virtual ~PasswordManagerTest() {} protected: diff --git a/chrome/browser/password_manager/password_store_default_unittest.cc b/chrome/browser/password_manager/password_store_default_unittest.cc index 92d0e98..825f2ab 100644 --- a/chrome/browser/password_manager/password_store_default_unittest.cc +++ b/chrome/browser/password_manager/password_store_default_unittest.cc @@ -112,12 +112,13 @@ class PasswordStoreDefaultTest : public testing::Test { } virtual void TearDown() { - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); db_thread_.Stop(); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; // PasswordStore, WDS schedule work on this thread. content::TestBrowserThread db_thread_; @@ -132,7 +133,7 @@ ACTION(STLDeleteElements0) { ACTION(QuitUIMessageLoop) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } TEST_F(PasswordStoreDefaultTest, NonASCIIData) { @@ -184,7 +185,7 @@ TEST_F(PasswordStoreDefaultTest, NonASCIIData) { .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); store->GetAutofillableLogins(&consumer); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); STLDeleteElements(&expected_forms); } diff --git a/chrome/browser/password_manager/password_store_mac.cc b/chrome/browser/password_manager/password_store_mac.cc index 33aec57..5d18ff2 100644 --- a/chrome/browser/password_manager/password_store_mac.cc +++ b/chrome/browser/password_manager/password_store_mac.cc @@ -935,7 +935,7 @@ void PasswordStoreMac::GetAutofillableLoginsImpl(GetLoginsRequest* request) { bool PasswordStoreMac::FillAutofillableLogins( std::vector<PasswordForm*>* forms) { - DCHECK(thread_->message_loop() == MessageLoop::current()); + DCHECK(thread_->message_loop() == base::MessageLoop::current()); std::vector<PasswordForm*> database_forms; login_metadata_db_->GetAutofillableLogins(&database_forms); @@ -954,7 +954,7 @@ bool PasswordStoreMac::FillAutofillableLogins( bool PasswordStoreMac::FillBlacklistLogins( std::vector<PasswordForm*>* forms) { - DCHECK(thread_->message_loop() == MessageLoop::current()); + DCHECK(thread_->message_loop() == base::MessageLoop::current()); return login_metadata_db_->GetBlacklistLogins(forms); } diff --git a/chrome/browser/password_manager/password_store_mac_unittest.cc b/chrome/browser/password_manager/password_store_mac_unittest.cc index 5107a3d..4dcef68 100644 --- a/chrome/browser/password_manager/password_store_mac_unittest.cc +++ b/chrome/browser/password_manager/password_store_mac_unittest.cc @@ -42,7 +42,7 @@ ACTION(STLDeleteElements0) { ACTION(QuitUIMessageLoop) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } // namespace @@ -916,12 +916,13 @@ class PasswordStoreMacTest : public testing::Test { virtual void TearDown() { store_->ShutdownOnUIThread(); - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); } protected: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; MockAppleKeychain* keychain_; // Owned by store_. @@ -1002,7 +1003,7 @@ TEST_F(PasswordStoreMacTest, TestStoreUpdate) { EXPECT_CALL(consumer, OnGetPasswordStoreResults(_)).WillOnce( DoAll(WithArg<0>(STLDeleteElements0()), QuitUIMessageLoop())); store_->GetLogins(*joint_form, &consumer); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); MacKeychainPasswordFormAdapter keychain_adapter(keychain_); for (unsigned int i = 0; i < ARRAYSIZE_UNSAFE(updates); ++i) { diff --git a/chrome/browser/password_manager/password_store_unittest.cc b/chrome/browser/password_manager/password_store_unittest.cc index 0c5f083..5a32bcd 100644 --- a/chrome/browser/password_manager/password_store_unittest.cc +++ b/chrome/browser/password_manager/password_store_unittest.cc @@ -106,11 +106,12 @@ class PasswordStoreTest : public testing::Test { virtual void TearDown() { db_thread_.Stop(); - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; // PasswordStore schedules work on this thread. content::TestBrowserThread db_thread_; @@ -125,7 +126,7 @@ ACTION(STLDeleteElements0) { ACTION(QuitUIMessageLoop) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } TEST_F(PasswordStoreTest, IgnoreOldWwwGoogleLogins) { @@ -262,7 +263,7 @@ TEST_F(PasswordStoreTest, IgnoreOldWwwGoogleLogins) { store->GetLogins(accounts_google, &consumer); store->GetLogins(bar_example, &consumer); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); STLDeleteElements(&all_forms); } diff --git a/chrome/browser/password_manager/password_store_win_unittest.cc b/chrome/browser/password_manager/password_store_win_unittest.cc index e6fe9dd..6fdb985 100644 --- a/chrome/browser/password_manager/password_store_win_unittest.cc +++ b/chrome/browser/password_manager/password_store_win_unittest.cc @@ -137,12 +137,13 @@ class PasswordStoreWinTest : public testing::Test { BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); done.Wait(); - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); db_thread_.Stop(); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; // PasswordStore, WDS schedule work on this thread. content::TestBrowserThread db_thread_; @@ -161,7 +162,7 @@ ACTION(STLDeleteElements0) { ACTION(QuitUIMessageLoop) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } MATCHER(EmptyWDResult, "") { @@ -234,7 +235,7 @@ TEST_F(PasswordStoreWinTest, DISABLED_ConvertIE7Login) { .WillOnce(QuitUIMessageLoop()); store_->GetLogins(*form, &consumer); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); STLDeleteElements(&forms); } @@ -267,7 +268,7 @@ TEST_F(PasswordStoreWinTest, DISABLED_OutstandingWDSQueries) { store_ = NULL; wds_ = NULL; - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } // Hangs flakily, see http://crbug.com/43836. @@ -341,8 +342,8 @@ TEST_F(PasswordStoreWinTest, DISABLED_MultipleWDSQueriesOnDifferentThreads) { // Run the MessageLoop twice: once for the GetIE7Login that PasswordStoreWin // schedules on the DB thread and once for the one we just scheduled on the UI // thread. - MessageLoop::current()->Run(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); STLDeleteElements(&forms); } @@ -379,7 +380,7 @@ TEST_F(PasswordStoreWinTest, EmptyLogins) { .WillOnce(DoAll(WithArg<0>(STLDeleteElements0()), QuitUIMessageLoop())); store_->GetLogins(*form, &consumer); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } TEST_F(PasswordStoreWinTest, EmptyBlacklistLogins) { @@ -401,7 +402,7 @@ TEST_F(PasswordStoreWinTest, EmptyBlacklistLogins) { .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); store_->GetBlacklistLogins(&consumer); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } TEST_F(PasswordStoreWinTest, EmptyAutofillableLogins) { @@ -423,5 +424,5 @@ TEST_F(PasswordStoreWinTest, EmptyAutofillableLogins) { .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); store_->GetAutofillableLogins(&consumer); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } diff --git a/chrome/browser/password_manager/password_store_x_unittest.cc b/chrome/browser/password_manager/password_store_x_unittest.cc index 8ba62cc..6be0ab9 100644 --- a/chrome/browser/password_manager/password_store_x_unittest.cc +++ b/chrome/browser/password_manager/password_store_x_unittest.cc @@ -285,8 +285,9 @@ class PasswordStoreXTest : public testing::TestWithParam<BackendType> { } virtual void TearDown() { - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); db_thread_.Stop(); } @@ -301,7 +302,7 @@ class PasswordStoreXTest : public testing::TestWithParam<BackendType> { } } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; // PasswordStore, WDS schedule work on this thread. content::TestBrowserThread db_thread_; @@ -317,7 +318,7 @@ ACTION(STLDeleteElements0) { ACTION(QuitUIMessageLoop) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } TEST_P(PasswordStoreXTest, Notifications) { @@ -472,7 +473,7 @@ TEST_P(PasswordStoreXTest, NativeMigration) { .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); store->GetAutofillableLogins(&consumer); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // The blacklisted forms should have been migrated to the native backend. EXPECT_CALL(consumer, @@ -481,7 +482,7 @@ TEST_P(PasswordStoreXTest, NativeMigration) { .WillOnce(DoAll(WithArg<1>(STLDeleteElements0()), QuitUIMessageLoop())); store->GetBlacklistLogins(&consumer); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); VectorOfForms empty; MockLoginDatabaseReturn ld_return; diff --git a/chrome/browser/plugins/plugin_prefs.cc b/chrome/browser/plugins/plugin_prefs.cc index 56e33e2..e570c00 100644 --- a/chrome/browser/plugins/plugin_prefs.cc +++ b/chrome/browser/plugins/plugin_prefs.cc @@ -164,8 +164,8 @@ void PluginPrefs::EnablePlugin( } if (!can_enable) { - MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(callback, false)); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::Bind(callback, false)); return; } diff --git a/chrome/browser/plugins/plugin_prefs_unittest.cc b/chrome/browser/plugins/plugin_prefs_unittest.cc index ad1aa8e..42d1b05 100644 --- a/chrome/browser/plugins/plugin_prefs_unittest.cc +++ b/chrome/browser/plugins/plugin_prefs_unittest.cc @@ -180,7 +180,7 @@ TEST_F(PluginPrefsTest, EnabledAndDisabledByPolicy) { TEST_F(PluginPrefsTest, UnifiedPepperFlashState) { base::ShadowingAtExitManager at_exit_manager_; // Destroys the PluginService. - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); webkit::npapi::MockPluginList plugin_list; PluginService::GetInstance()->SetPluginListForTesting(&plugin_list); diff --git a/chrome/browser/policy/async_policy_provider_unittest.cc b/chrome/browser/policy/async_policy_provider_unittest.cc index 3520a87..0d04efe 100644 --- a/chrome/browser/policy/async_policy_provider_unittest.cc +++ b/chrome/browser/policy/async_policy_provider_unittest.cc @@ -80,7 +80,7 @@ class AsyncPolicyProviderTest : public testing::Test { MockPolicyLoader* loader_; scoped_ptr<AsyncPolicyProvider> provider_; - MessageLoop loop_; + base::MessageLoop loop_; private: content::TestBrowserThread ui_thread_; diff --git a/chrome/browser/policy/browser_policy_connector.cc b/chrome/browser/policy/browser_policy_connector.cc index 465ba2e..393edac 100644 --- a/chrome/browser/policy/browser_policy_connector.cc +++ b/chrome/browser/policy/browser_policy_connector.cc @@ -204,7 +204,7 @@ void BrowserPolicyConnector::Init( new policy::PolicyStatisticsCollector( GetPolicyService(), local_state_, - MessageLoop::current()->message_loop_proxy())); + base::MessageLoop::current()->message_loop_proxy())); policy_statistics_collector_->Initialize(); is_initialized_ = true; diff --git a/chrome/browser/policy/cloud/cloud_policy_core.cc b/chrome/browser/policy/cloud/cloud_policy_core.cc index f40e025..232ddc1 100644 --- a/chrome/browser/policy/cloud/cloud_policy_core.cc +++ b/chrome/browser/policy/cloud/cloud_policy_core.cc @@ -46,7 +46,7 @@ void CloudPolicyCore::StartRefreshScheduler() { refresh_scheduler_.reset( new CloudPolicyRefreshScheduler( client_.get(), store_, - MessageLoop::current()->message_loop_proxy())); + base::MessageLoop::current()->message_loop_proxy())); UpdateRefreshDelayFromPref(); } } diff --git a/chrome/browser/policy/cloud/cloud_policy_core_unittest.cc b/chrome/browser/policy/cloud/cloud_policy_core_unittest.cc index 95a3a25..6e7e447 100644 --- a/chrome/browser/policy/cloud/cloud_policy_core_unittest.cc +++ b/chrome/browser/policy/cloud/cloud_policy_core_unittest.cc @@ -26,7 +26,7 @@ class CloudPolicyCoreTest : public testing::Test { chrome::RegisterLocalState(prefs_.registry()); } - MessageLoop loop_; + base::MessageLoop loop_; TestingPrefServiceSimple prefs_; MockCloudPolicyStore store_; diff --git a/chrome/browser/policy/cloud/cloud_policy_manager_unittest.cc b/chrome/browser/policy/cloud/cloud_policy_manager_unittest.cc index f7d9564..0b3bdbb 100644 --- a/chrome/browser/policy/cloud/cloud_policy_manager_unittest.cc +++ b/chrome/browser/policy/cloud/cloud_policy_manager_unittest.cc @@ -179,7 +179,7 @@ class CloudPolicyManagerTest : public testing::Test { } // Required by the refresh scheduler that's created by the manager. - MessageLoop loop_; + base::MessageLoop loop_; // Testing policy. const PolicyNamespaceKey policy_ns_key_; diff --git a/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc b/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc index 9f3c403..9b15cbf 100644 --- a/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc +++ b/chrome/browser/policy/cloud/cloud_policy_refresh_scheduler_unittest.cc @@ -80,7 +80,7 @@ class CloudPolicyRefreshSchedulerTest : public testing::Test { EXPECT_LE(GetLastDelay(), expected_delay); } - MessageLoop loop_; + base::MessageLoop loop_; MockCloudPolicyClient client_; MockCloudPolicyStore store_; scoped_refptr<base::TestSimpleTaskRunner> task_runner_; diff --git a/chrome/browser/policy/cloud/cloud_policy_validator.cc b/chrome/browser/policy/cloud/cloud_policy_validator.cc index 7d975dd..422f8dc 100644 --- a/chrome/browser/policy/cloud/cloud_policy_validator.cc +++ b/chrome/browser/policy/cloud/cloud_policy_validator.cc @@ -131,7 +131,7 @@ void CloudPolicyValidatorBase::PostValidationTask( content::BrowserThread::FILE, FROM_HERE, base::Bind(&CloudPolicyValidatorBase::PerformValidation, base::Passed(scoped_ptr<CloudPolicyValidatorBase>(this)), - MessageLoop::current()->message_loop_proxy(), + base::MessageLoop::current()->message_loop_proxy(), completion_callback)); } diff --git a/chrome/browser/policy/cloud/cloud_policy_validator_unittest.cc b/chrome/browser/policy/cloud/cloud_policy_validator_unittest.cc index 55f9dbf..5c28fb7 100644 --- a/chrome/browser/policy/cloud/cloud_policy_validator_unittest.cc +++ b/chrome/browser/policy/cloud/cloud_policy_validator_unittest.cc @@ -32,7 +32,7 @@ ACTION_P(CheckStatus, expected_status) { class CloudPolicyValidatorTest : public testing::Test { public: CloudPolicyValidatorTest() - : loop_(MessageLoop::TYPE_UI), + : loop_(base::MessageLoop::TYPE_UI), timestamp_(base::Time::UnixEpoch() + base::TimeDelta::FromMilliseconds( PolicyBuilder::kFakeTimestamp)), @@ -90,7 +90,7 @@ class CloudPolicyValidatorTest : public testing::Test { validator->payload()->SerializeAsString()); } - MessageLoop loop_; + base::MessageLoop loop_; base::Time timestamp_; CloudPolicyValidatorBase::ValidateTimestampOption ignore_missing_timestamp_; CloudPolicyValidatorBase::ValidateDMTokenOption ignore_missing_dm_token_; diff --git a/chrome/browser/policy/cloud/component_cloud_policy_service_unittest.cc b/chrome/browser/policy/cloud/component_cloud_policy_service_unittest.cc index 37a4fac..d4e54d6 100644 --- a/chrome/browser/policy/cloud/component_cloud_policy_service_unittest.cc +++ b/chrome/browser/policy/cloud/component_cloud_policy_service_unittest.cc @@ -196,7 +196,7 @@ class ComponentCloudPolicyServiceTest : public testing::Test { return schema.Pass(); } - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; base::ScopedTempDir temp_dir_; diff --git a/chrome/browser/policy/cloud/device_management_service.cc b/chrome/browser/policy/cloud/device_management_service.cc index 8a755a6..3b065897 100644 --- a/chrome/browser/policy/cloud/device_management_service.cc +++ b/chrome/browser/policy/cloud/device_management_service.cc @@ -557,7 +557,7 @@ DeviceManagementRequestJob* DeviceManagementService::CreateJob( void DeviceManagementService::ScheduleInitialization(int64 delay_milliseconds) { if (initialized_) return; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&DeviceManagementService::Initialize, weak_ptr_factory_.GetWeakPtr()), diff --git a/chrome/browser/policy/cloud/device_management_service_browsertest.cc b/chrome/browser/policy/cloud/device_management_service_browsertest.cc index 30c4aa6..7a40776 100644 --- a/chrome/browser/policy/cloud/device_management_service_browsertest.cc +++ b/chrome/browser/policy/cloud/device_management_service_browsertest.cc @@ -120,8 +120,8 @@ class DeviceManagementServiceIntegrationTest .WillOnce( DoAll(Invoke(this, &DeviceManagementServiceIntegrationTest::RecordToken), - InvokeWithoutArgs(MessageLoop::current(), - &MessageLoop::Quit))); + InvokeWithoutArgs(base::MessageLoop::current(), + &base::MessageLoop::Quit))); scoped_ptr<DeviceManagementRequestJob> job( service_->CreateJob(DeviceManagementRequestJob::TYPE_REGISTRATION)); job->SetGaiaToken("gaia_auth_token"); @@ -130,7 +130,7 @@ class DeviceManagementServiceIntegrationTest job->GetRequest()->mutable_register_request(); job->Start(base::Bind(&DeviceManagementServiceIntegrationTest::OnJobDone, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } virtual void SetUpOnMainThread() OVERRIDE { @@ -178,8 +178,8 @@ IN_PROC_BROWSER_TEST_P(DeviceManagementServiceIntegrationTest, .WillOnce( DoAll(Invoke(this, &DeviceManagementServiceIntegrationTest::RecordAuthCode), - InvokeWithoutArgs(MessageLoop::current(), - &MessageLoop::Quit))); + InvokeWithoutArgs(base::MessageLoop::current(), + &base::MessageLoop::Quit))); scoped_ptr<DeviceManagementRequestJob> job(service_->CreateJob( DeviceManagementRequestJob::TYPE_API_AUTH_CODE_FETCH)); job->SetDMToken(token_); @@ -190,7 +190,7 @@ IN_PROC_BROWSER_TEST_P(DeviceManagementServiceIntegrationTest, request->set_oauth2_client_id("oauth2ClientId4Test"); job->Start(base::Bind(&DeviceManagementServiceIntegrationTest::OnJobDone, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); ASSERT_EQ("fake_auth_code", robot_auth_code_); } @@ -199,7 +199,8 @@ IN_PROC_BROWSER_TEST_P(DeviceManagementServiceIntegrationTest, PolicyFetch) { ExpectRequest(); EXPECT_CALL(*this, OnJobDone(DM_STATUS_SUCCESS, _, _)) - .WillOnce(InvokeWithoutArgs(MessageLoop::current(), &MessageLoop::Quit)); + .WillOnce(InvokeWithoutArgs(base::MessageLoop::current(), + &base::MessageLoop::Quit)); scoped_ptr<DeviceManagementRequestJob> job( service_->CreateJob(DeviceManagementRequestJob::TYPE_POLICY_FETCH)); job->SetDMToken(token_); @@ -210,7 +211,7 @@ IN_PROC_BROWSER_TEST_P(DeviceManagementServiceIntegrationTest, PolicyFetch) { request->add_request()->set_policy_type(dm_protocol::kChromeUserPolicyType); job->Start(base::Bind(&DeviceManagementServiceIntegrationTest::OnJobDone, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } IN_PROC_BROWSER_TEST_P(DeviceManagementServiceIntegrationTest, Unregistration) { @@ -218,7 +219,8 @@ IN_PROC_BROWSER_TEST_P(DeviceManagementServiceIntegrationTest, Unregistration) { ExpectRequest(); EXPECT_CALL(*this, OnJobDone(DM_STATUS_SUCCESS, _, _)) - .WillOnce(InvokeWithoutArgs(MessageLoop::current(), &MessageLoop::Quit)); + .WillOnce(InvokeWithoutArgs(base::MessageLoop::current(), + &base::MessageLoop::Quit)); scoped_ptr<DeviceManagementRequestJob> job( service_->CreateJob(DeviceManagementRequestJob::TYPE_UNREGISTRATION)); job->SetDMToken(token_); @@ -226,13 +228,14 @@ IN_PROC_BROWSER_TEST_P(DeviceManagementServiceIntegrationTest, Unregistration) { job->GetRequest()->mutable_unregister_request(); job->Start(base::Bind(&DeviceManagementServiceIntegrationTest::OnJobDone, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } IN_PROC_BROWSER_TEST_P(DeviceManagementServiceIntegrationTest, AutoEnrollment) { ExpectRequest(); EXPECT_CALL(*this, OnJobDone(DM_STATUS_SUCCESS, _, _)) - .WillOnce(InvokeWithoutArgs(MessageLoop::current(), &MessageLoop::Quit)); + .WillOnce(InvokeWithoutArgs(base::MessageLoop::current(), + &base::MessageLoop::Quit)); scoped_ptr<DeviceManagementRequestJob> job( service_->CreateJob(DeviceManagementRequestJob::TYPE_AUTO_ENROLLMENT)); job->SetClientID("testid"); @@ -240,7 +243,7 @@ IN_PROC_BROWSER_TEST_P(DeviceManagementServiceIntegrationTest, AutoEnrollment) { job->GetRequest()->mutable_auto_enrollment_request()->set_modulus(1); job->Start(base::Bind(&DeviceManagementServiceIntegrationTest::OnJobDone, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } INSTANTIATE_TEST_CASE_P( diff --git a/chrome/browser/policy/cloud/device_management_service_unittest.cc b/chrome/browser/policy/cloud/device_management_service_unittest.cc index 2e4ee82..78e7d00 100644 --- a/chrome/browser/policy/cloud/device_management_service_unittest.cc +++ b/chrome/browser/policy/cloud/device_management_service_unittest.cc @@ -166,7 +166,7 @@ class DeviceManagementServiceTestBase : public testing::Test { scoped_ptr<DeviceManagementService> service_; private: - MessageLoopForUI loop_; + base::MessageLoopForUI loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; }; diff --git a/chrome/browser/policy/cloud/user_cloud_policy_manager_unittest.cc b/chrome/browser/policy/cloud/user_cloud_policy_manager_unittest.cc index 026c149..6f4629d 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_manager_unittest.cc +++ b/chrome/browser/policy/cloud/user_cloud_policy_manager_unittest.cc @@ -55,7 +55,7 @@ class UserCloudPolicyManagerTest : public testing::Test { } // Required by the refresh scheduler that's created by the manager. - MessageLoop loop_; + base::MessageLoop loop_; // Convenience policy objects. PolicyMap policy_map_; diff --git a/chrome/browser/policy/cloud/user_cloud_policy_store_unittest.cc b/chrome/browser/policy/cloud/user_cloud_policy_store_unittest.cc index d2e5035..aa3f9084 100644 --- a/chrome/browser/policy/cloud/user_cloud_policy_store_unittest.cc +++ b/chrome/browser/policy/cloud/user_cloud_policy_store_unittest.cc @@ -37,7 +37,7 @@ void RunUntilIdle() { class UserCloudPolicyStoreTest : public testing::Test { public: UserCloudPolicyStoreTest() - : loop_(MessageLoop::TYPE_UI), + : loop_(base::MessageLoop::TYPE_UI), ui_thread_(content::BrowserThread::UI, &loop_), file_thread_(content::BrowserThread::FILE, &loop_), profile_(new TestingProfile()) {} @@ -93,7 +93,7 @@ class UserCloudPolicyStoreTest : public testing::Test { // CloudPolicyValidator() requires a FILE thread so declare one here. Both // |ui_thread_| and |file_thread_| share the same MessageLoop |loop_| so // callers can use RunLoop to manage both virtual threads. - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/policy/cloud/user_policy_signin_service.cc b/chrome/browser/policy/cloud/user_policy_signin_service.cc index 11400a7..46b60ca5 100644 --- a/chrome/browser/policy/cloud/user_policy_signin_service.cc +++ b/chrome/browser/policy/cloud/user_policy_signin_service.cc @@ -533,7 +533,7 @@ void UserPolicySigninService::OnClientError(CloudPolicyClient* client) { // Can't shutdown now because we're in the middle of a callback from // the CloudPolicyClient, so queue up a task to do the shutdown. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&UserPolicySigninService::ShutdownUserCloudPolicyManager, weak_factory_.GetWeakPtr())); diff --git a/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc b/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc index cb2e8c9..1dc0afd 100644 --- a/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc +++ b/chrome/browser/policy/cloud/user_policy_signin_service_unittest.cc @@ -83,7 +83,7 @@ class SigninManagerFake : public FakeSigninManager { class UserPolicySigninServiceTest : public testing::Test { public: UserPolicySigninServiceTest() - : loop_(MessageLoop::TYPE_IO), + : loop_(base::MessageLoop::TYPE_IO), ui_thread_(content::BrowserThread::UI, &loop_), file_thread_(content::BrowserThread::FILE, &loop_), io_thread_(content::BrowserThread::IO, &loop_), @@ -264,7 +264,7 @@ class UserPolicySigninServiceTest : public testing::Test { // BrowserPolicyConnector and UrlFetcherFactory want to initialize and free // various components asynchronously via tasks, so create fake threads here. - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc index 5ab8c10..7471b0b 100644 --- a/chrome/browser/policy/configuration_policy_pref_store_unittest.cc +++ b/chrome/browser/policy/configuration_policy_pref_store_unittest.cc @@ -69,7 +69,7 @@ class ConfigurationPolicyPrefStoreTest : public testing::Test { MockConfigurationPolicyProvider provider_; scoped_ptr<PolicyServiceImpl> policy_service_; scoped_refptr<ConfigurationPolicyPrefStore> store_; - MessageLoop loop_; + base::MessageLoop loop_; }; // Test cases for list-valued policy settings. diff --git a/chrome/browser/policy/configuration_policy_provider_test.h b/chrome/browser/policy/configuration_policy_provider_test.h index 1c98836..397e55a 100644 --- a/chrome/browser/policy/configuration_policy_provider_test.h +++ b/chrome/browser/policy/configuration_policy_provider_test.h @@ -52,7 +52,7 @@ class PolicyTestBase : public testing::Test { protected: // Create an actual IO loop (needed by FilePathWatcher). - MessageLoopForIO loop_; + base::MessageLoopForIO loop_; private: content::TestBrowserThread ui_thread_; diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc index 195bb18..4fc5c21 100644 --- a/chrome/browser/policy/policy_browsertest.cc +++ b/chrome/browser/policy/policy_browsertest.cc @@ -209,14 +209,14 @@ class MakeRequestFail { BrowserThread::PostTaskAndReply( BrowserThread::IO, FROM_HERE, base::Bind(MakeRequestFailOnIO, host_), - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); content::RunMessageLoop(); } ~MakeRequestFail() { BrowserThread::PostTaskAndReply( BrowserThread::IO, FROM_HERE, base::Bind(UndoMakeRequestFailOnIO, host_), - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); content::RunMessageLoop(); } @@ -333,13 +333,13 @@ bool IsJavascriptEnabled(content::WebContents* contents) { void CopyPluginListAndQuit(std::vector<webkit::WebPluginInfo>* out, const std::vector<webkit::WebPluginInfo>& in) { *out = in; - MessageLoop::current()->QuitWhenIdle(); + base::MessageLoop::current()->QuitWhenIdle(); } template<typename T> void CopyValueAndQuit(T* out, T in) { *out = in; - MessageLoop::current()->QuitWhenIdle(); + base::MessageLoop::current()->QuitWhenIdle(); } void GetPluginList(std::vector<webkit::WebPluginInfo>* plugins) { @@ -462,7 +462,7 @@ class PolicyTest : public InProcessBrowserTest { BrowserThread::PostTaskAndReply( BrowserThread::IO, FROM_HERE, base::Bind(URLRequestMockHTTPJob::AddUrlHandler, root_http), - MessageLoop::current()->QuitWhenIdleClosure()); + base::MessageLoop::current()->QuitWhenIdleClosure()); content::RunMessageLoop(); } @@ -531,7 +531,7 @@ class PolicyTest : public InProcessBrowserTest { BrowserThread::IO, FROM_HERE, base::Bind(base::DoNothing), - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); content::RunMessageLoop(); } #endif @@ -586,7 +586,7 @@ class PolicyTest : public InProcessBrowserTest { void UpdateProviderPolicy(const PolicyMap& policy) { provider_.UpdateChromePolicy(policy); - DCHECK(MessageLoop::current()); + DCHECK(base::MessageLoop::current()); base::RunLoop loop; loop.RunUntilIdle(); } @@ -2094,7 +2094,7 @@ class MediaStreamDevicesControllerBrowserTest base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); controller.DismissInfoBarAndTakeActionOnSettings(); - MessageLoop::current()->QuitWhenIdle(); + base::MessageLoop::current()->QuitWhenIdle(); } void FinishVideoTest() { @@ -2107,7 +2107,7 @@ class MediaStreamDevicesControllerBrowserTest base::Bind(&MediaStreamDevicesControllerBrowserTest::Accept, this)); controller.DismissInfoBarAndTakeActionOnSettings(); - MessageLoop::current()->QuitWhenIdle(); + base::MessageLoop::current()->QuitWhenIdle(); } bool policy_value_; @@ -2139,7 +2139,7 @@ IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishAudioTest, this)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, @@ -2196,7 +2196,7 @@ IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, base::Bind(&MediaStreamDevicesControllerBrowserTest::FinishVideoTest, this)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } IN_PROC_BROWSER_TEST_P(MediaStreamDevicesControllerBrowserTest, diff --git a/chrome/browser/policy/policy_service_impl.cc b/chrome/browser/policy/policy_service_impl.cc index 2cf3734..9302269 100644 --- a/chrome/browser/policy/policy_service_impl.cc +++ b/chrome/browser/policy/policy_service_impl.cc @@ -120,7 +120,7 @@ void PolicyServiceImpl::NotifyNamespaceUpdated( const PolicyMap& current) { // If running a unit test that hasn't setup a MessageLoop, don't send any // notifications. - if (!MessageLoop::current()) + if (!base::MessageLoop::current()) return; // Don't queue up a task if we have no observers - that way Observers added @@ -132,7 +132,7 @@ void PolicyServiceImpl::NotifyNamespaceUpdated( // call to MergeAndTriggerUpdates() by modifying policy. scoped_ptr<PolicyChangeInfo> changes( new PolicyChangeInfo(ns, previous, current)); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&PolicyServiceImpl::NotifyNamespaceUpdatedTask, weak_ptr_factory_.GetWeakPtr(), diff --git a/chrome/browser/policy/policy_service_impl_unittest.cc b/chrome/browser/policy/policy_service_impl_unittest.cc index 9e56f3f..00b88af 100644 --- a/chrome/browser/policy/policy_service_impl_unittest.cc +++ b/chrome/browser/policy/policy_service_impl_unittest.cc @@ -160,7 +160,7 @@ class PolicyServiceTest : public testing::Test { PolicyMap policy1_; PolicyMap policy2_; scoped_ptr<PolicyServiceImpl> policy_service_; - MessageLoop loop_; + base::MessageLoop loop_; private: DISALLOW_COPY_AND_ASSIGN(PolicyServiceTest); diff --git a/chrome/browser/policy/url_blacklist_manager.cc b/chrome/browser/policy/url_blacklist_manager.cc index a4525ed..9cc00bc 100644 --- a/chrome/browser/policy/url_blacklist_manager.cc +++ b/chrome/browser/policy/url_blacklist_manager.cc @@ -334,7 +334,7 @@ void URLBlacklistManager::ScheduleUpdate() { // change the blacklist are updated in one message loop cycle. In those cases, // only rebuild the blacklist after all the preference updates are processed. ui_weak_ptr_factory_.InvalidateWeakPtrs(); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&URLBlacklistManager::Update, ui_weak_ptr_factory_.GetWeakPtr())); diff --git a/chrome/browser/policy/url_blacklist_manager_unittest.cc b/chrome/browser/policy/url_blacklist_manager_unittest.cc index 7fed421..b64ddda 100644 --- a/chrome/browser/policy/url_blacklist_manager_unittest.cc +++ b/chrome/browser/policy/url_blacklist_manager_unittest.cc @@ -70,7 +70,7 @@ class TestingURLBlacklistManager : public URLBlacklistManager { class URLBlacklistManagerTest : public testing::Test { protected: URLBlacklistManagerTest() - : loop_(MessageLoop::TYPE_IO), + : loop_(base::MessageLoop::TYPE_IO), ui_thread_(BrowserThread::UI, &loop_), file_thread_(BrowserThread::FILE, &loop_), io_thread_(BrowserThread::IO, &loop_) { @@ -93,7 +93,7 @@ class URLBlacklistManagerTest : public testing::Test { blacklist_manager_.reset(); } - MessageLoop loop_; + base::MessageLoop loop_; TestingPrefServiceSimple pref_service_; scoped_ptr<TestingURLBlacklistManager> blacklist_manager_; diff --git a/chrome/browser/predictors/autocomplete_action_predictor_table_unittest.cc b/chrome/browser/predictors/autocomplete_action_predictor_table_unittest.cc index bbd6cb3..10c44e9 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor_table_unittest.cc +++ b/chrome/browser/predictors/autocomplete_action_predictor_table_unittest.cc @@ -54,7 +54,7 @@ class AutocompleteActionPredictorTableTest : public testing::Test { private: TestingProfile profile_; scoped_ptr<PredictorDatabase> db_; - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread db_thread_; }; @@ -71,7 +71,7 @@ class AutocompleteActionPredictorTableReopenTest }; AutocompleteActionPredictorTableTest::AutocompleteActionPredictorTableTest() - : loop_(MessageLoop::TYPE_DEFAULT), + : loop_(base::MessageLoop::TYPE_DEFAULT), db_thread_(BrowserThread::DB, &loop_) { } diff --git a/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc b/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc index 675df556..1ac2e7f 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc +++ b/chrome/browser/predictors/autocomplete_action_predictor_unittest.cc @@ -82,7 +82,7 @@ namespace predictors { class AutocompleteActionPredictorTest : public testing::Test { public: AutocompleteActionPredictorTest() - : loop_(MessageLoop::TYPE_DEFAULT), + : loop_(base::MessageLoop::TYPE_DEFAULT), ui_thread_(BrowserThread::UI, &loop_), db_thread_(BrowserThread::DB, &loop_), file_thread_(BrowserThread::FILE, &loop_), @@ -214,7 +214,7 @@ class AutocompleteActionPredictorTest : public testing::Test { } private: - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc b/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc index fa5be14..7ae4d31 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc +++ b/chrome/browser/predictors/resource_prefetch_predictor_tables_unittest.cc @@ -31,7 +31,7 @@ class ResourcePrefetchPredictorTablesTest : public testing::Test { void TestDeleteSingleDataPoint(); void TestDeleteAllData(); - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread db_thread_; TestingProfile profile_; scoped_ptr<PredictorDatabase> db_; @@ -88,7 +88,7 @@ class ResourcePrefetchPredictorTablesReopenTest }; ResourcePrefetchPredictorTablesTest::ResourcePrefetchPredictorTablesTest() - : loop_(MessageLoop::TYPE_DEFAULT), + : loop_(base::MessageLoop::TYPE_DEFAULT), db_thread_(content::BrowserThread::DB, &loop_), db_(new PredictorDatabase(&profile_)), tables_(db_->resource_prefetch_tables()) { diff --git a/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc b/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc index b6203da..aa1e02a 100644 --- a/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc +++ b/chrome/browser/predictors/resource_prefetch_predictor_unittest.cc @@ -155,7 +155,7 @@ class ResourcePrefetchPredictorTest : public testing::Test { void InitializeSampleData(); - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; scoped_ptr<TestingProfile> profile_; @@ -170,7 +170,7 @@ class ResourcePrefetchPredictorTest : public testing::Test { }; ResourcePrefetchPredictorTest::ResourcePrefetchPredictorTest() - : loop_(MessageLoop::TYPE_DEFAULT), + : loop_(base::MessageLoop::TYPE_DEFAULT), ui_thread_(content::BrowserThread::UI, &loop_), db_thread_(content::BrowserThread::DB, &loop_), profile_(new TestingProfile()), diff --git a/chrome/browser/predictors/resource_prefetcher_unittest.cc b/chrome/browser/predictors/resource_prefetcher_unittest.cc index 865c8af..b53dae1 100644 --- a/chrome/browser/predictors/resource_prefetcher_unittest.cc +++ b/chrome/browser/predictors/resource_prefetcher_unittest.cc @@ -47,7 +47,7 @@ class TestResourcePrefetcher : public ResourcePrefetcher { // Delegate for ResourcePrefetcher. class TestResourcePrefetcherDelegate : public ResourcePrefetcher::Delegate { public: - explicit TestResourcePrefetcherDelegate(MessageLoop* loop) + explicit TestResourcePrefetcherDelegate(base::MessageLoop* loop) : request_context_getter_(new net::TestURLRequestContextGetter( loop->message_loop_proxy())) { } ~TestResourcePrefetcherDelegate() { } @@ -128,7 +128,7 @@ class ResourcePrefetcherTest : public testing::Test { prefetcher_->OnResponseStarted(GetInFlightRequest(url)); } - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread io_thread_; ResourcePrefetchPredictorConfig config_; TestResourcePrefetcherDelegate prefetcher_delegate_; @@ -139,7 +139,7 @@ class ResourcePrefetcherTest : public testing::Test { }; ResourcePrefetcherTest::ResourcePrefetcherTest() - : loop_(MessageLoop::TYPE_IO), + : loop_(base::MessageLoop::TYPE_IO), io_thread_(content::BrowserThread::IO, &loop_), prefetcher_delegate_(&loop_) { config_.max_prefetches_inflight_per_navigation = 5; diff --git a/chrome/browser/prefs/chrome_pref_service_unittest.cc b/chrome/browser/prefs/chrome_pref_service_unittest.cc index 4dab4fc..ffe54f7 100644 --- a/chrome/browser/prefs/chrome_pref_service_unittest.cc +++ b/chrome/browser/prefs/chrome_pref_service_unittest.cc @@ -87,7 +87,7 @@ class ChromePrefServiceUserFilePrefsTest : public testing::Test { // The path to the directory where the test data is stored. base::FilePath data_dir_; // A message loop that we can use as the file thread message loop. - MessageLoop message_loop_; + base::MessageLoop message_loop_; }; // Verifies that ListValue and DictionaryValue pref with non emtpy default diff --git a/chrome/browser/prerender/prerender_browsertest.cc b/chrome/browser/prerender/prerender_browsertest.cc index bf5c1a6..80199b5 100644 --- a/chrome/browser/prerender/prerender_browsertest.cc +++ b/chrome/browser/prerender/prerender_browsertest.cc @@ -192,7 +192,7 @@ class ChannelDestructionWatcher { channel_destroyed_ = true; if (waiting_for_channel_destruction_) { waiting_for_channel_destruction_ = false; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } @@ -230,7 +230,7 @@ class TestPrerenderContents : public PrerenderContents { prerender_should_wait_for_ready_title_( prerender_should_wait_for_ready_title) { if (expected_number_of_loads == 0) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } virtual ~TestPrerenderContents() { @@ -263,7 +263,7 @@ class TestPrerenderContents : public PrerenderContents { if (quit_message_loop_on_destruction_) { // The message loop may not be running if this is swapped in // synchronously on a Navigation. - MessageLoop* loop = MessageLoopForUI::current(); + base::MessageLoop* loop = base::MessageLoopForUI::current(); if (loop->is_running()) loop->Quit(); } @@ -299,7 +299,7 @@ class TestPrerenderContents : public PrerenderContents { ++number_of_loads_; if (ShouldRenderPrerenderedPageCorrectly(expected_final_status_) && number_of_loads_ == expected_number_of_loads_) { - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } @@ -308,7 +308,7 @@ class TestPrerenderContents : public PrerenderContents { PrerenderContents::AddPendingPrerender(pending_prerender_info.Pass()); if (expected_pending_prerenders_ > 0 && pending_prerender_count() == expected_pending_prerenders_) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } @@ -2406,7 +2406,7 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderClearHistory) { // Post a task to clear the history, and run the message loop until it // destroys the prerender. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ClearBrowsingData, current_browser(), BrowsingDataRemover::REMOVE_HISTORY)); @@ -2425,7 +2425,7 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderClearCache) { // Post a task to clear the cache, and run the message loop until it // destroys the prerender. - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&ClearBrowsingData, current_browser(), BrowsingDataRemover::REMOVE_CACHE)); content::RunMessageLoop(); @@ -2440,7 +2440,7 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderCancelAll) { FINAL_STATUS_CANCELLED, 1); // Post a task to cancel all the prerenders. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&CancelAllPrerenders, GetPrerenderManager())); content::RunMessageLoop(); EXPECT_TRUE(GetPrerenderContents() == NULL); @@ -2453,7 +2453,7 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, PrerenderEvents) { EXPECT_TRUE(DidReceivePrerenderLoadEventForLinkNumber(0)); EXPECT_FALSE(DidReceivePrerenderStopEventForLinkNumber(0)); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&CancelAllPrerenders, GetPrerenderManager())); content::RunMessageLoop(); @@ -2470,7 +2470,7 @@ IN_PROC_BROWSER_TEST_F(PrerenderBrowserTest, FINAL_STATUS_CANCELLED, 1); // Post a task to cancel all the prerenders. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&CancelAllPrerenders, GetPrerenderManager())); content::RunMessageLoop(); EXPECT_TRUE(GetPrerenderContents() == NULL); diff --git a/chrome/browser/prerender/prerender_local_predictor.cc b/chrome/browser/prerender/prerender_local_predictor.cc index d5e06ff..2284237 100644 --- a/chrome/browser/prerender/prerender_local_predictor.cc +++ b/chrome/browser/prerender/prerender_local_predictor.cc @@ -312,7 +312,7 @@ PrerenderLocalPredictor::PrerenderLocalPredictor( weak_factory_(this), current_prerender_would_have_matched_(false) { RecordEvent(EVENT_CONSTRUCTED); - if (MessageLoop::current()) { + if (base::MessageLoop::current()) { timer_.Start(FROM_HERE, base::TimeDelta::FromMilliseconds(kInitDelayMs), this, diff --git a/chrome/browser/prerender/prerender_manager.cc b/chrome/browser/prerender/prerender_manager.cc index 1374fd1..3ead07f 100644 --- a/chrome/browser/prerender/prerender_manager.cc +++ b/chrome/browser/prerender/prerender_manager.cc @@ -156,7 +156,7 @@ class PrerenderManager::OnCloseWebContentsDeleter : manager_(manager), tab_(tab) { tab_->SetDelegate(this); - MessageLoop::current()->PostDelayedTask(FROM_HERE, + base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&OnCloseWebContentsDeleter::ScheduleWebContentsForDeletion, AsWeakPtr(), true), base::TimeDelta::FromSeconds(kDeleteWithExtremePrejudiceSeconds)); @@ -1187,7 +1187,7 @@ void PrerenderManager::PeriodicCleanup() { void PrerenderManager::PostCleanupTask() { DCHECK(CalledOnValidThread()); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&PrerenderManager::PeriodicCleanup, AsWeakPtr())); } diff --git a/chrome/browser/prerender/prerender_manager_unittest.cc b/chrome/browser/prerender/prerender_manager_unittest.cc index 86d6f33..677deab 100644 --- a/chrome/browser/prerender/prerender_manager_unittest.cc +++ b/chrome/browser/prerender/prerender_manager_unittest.cc @@ -23,7 +23,7 @@ class PrerenderManagerTest : public testing::Test { PrerenderManager* prerender_manager() { return &prerender_manager_; } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; PrerenderManager prerender_manager_; }; diff --git a/chrome/browser/prerender/prerender_tracker_unittest.cc b/chrome/browser/prerender/prerender_tracker_unittest.cc index a736b0b..81e6db6 100644 --- a/chrome/browser/prerender/prerender_tracker_unittest.cc +++ b/chrome/browser/prerender/prerender_tracker_unittest.cc @@ -134,7 +134,7 @@ class PrerenderTrackerTest : public testing::Test { } private: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/prerender/prerender_unittest.cc b/chrome/browser/prerender/prerender_unittest.cc index 036742a..dba0e3a 100644 --- a/chrome/browser/prerender/prerender_unittest.cc +++ b/chrome/browser/prerender/prerender_unittest.cc @@ -349,7 +349,7 @@ class PrerenderTest : public testing::Test { // Needed to pass PrerenderManager's DCHECKs. TestingProfile profile_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; scoped_ptr<UnitTestPrerenderManager> prerender_manager_; scoped_ptr<PrerenderLinkManager> prerender_link_manager_; diff --git a/chrome/browser/printing/background_printing_manager.cc b/chrome/browser/printing/background_printing_manager.cc index 953a38e..c97f89a 100644 --- a/chrome/browser/printing/background_printing_manager.cc +++ b/chrome/browser/printing/background_printing_manager.cc @@ -153,7 +153,7 @@ void BackgroundPrintingManager::DeletePreviewContents( content::Source<WebContents>(preview_contents)); printing_contents_set_.erase(preview_contents); printing_contents_pending_deletion_set_.insert(preview_contents); - MessageLoop::current()->DeleteSoon(FROM_HERE, preview_contents); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, preview_contents); } bool BackgroundPrintingManager::HasSharedRenderProcessHost( diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc b/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc index 682dbc0..2fffdb3 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc @@ -114,22 +114,23 @@ bool CloudPrintProxyService::ApplyCloudPrintConnectorPolicy() { DisableForUser(); profile_->GetPrefs()->SetString(prefs::kCloudPrintEmail, std::string()); if (enforcing_connector_policy_) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&CloudPrintProxyService::RefreshCloudPrintProxyStatus, weak_factory_.GetWeakPtr())); } return false; } else if (enforcing_connector_policy_) { - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); } } return true; } void CloudPrintProxyService::OnCloudPrintSetupClosed() { - MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&chrome::EndKeepAlive)); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::Bind(&chrome::EndKeepAlive)); } void CloudPrintProxyService::GetPrintersAvalibleForRegistration( diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc index d6eefc5..ce27b95 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service_unittest.cc @@ -87,7 +87,7 @@ void CallTask(const base::Closure& task) { void PostTask(const base::Closure& task) { if (!task.is_null()) - MessageLoop::current()->PostTask(FROM_HERE, task); + base::MessageLoop::current()->PostTask(FROM_HERE, task); } void MockServiceProcessControl::SetConnectSuccessMockExpectations( @@ -196,7 +196,7 @@ class CloudPrintProxyPolicyTest : public ::testing::Test { } protected: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; TestingProfile profile_; }; @@ -432,7 +432,7 @@ BrowserContextKeyedService* TestCloudPrintProxyServiceFactory( service->GetMockServiceProcessControl()->SetWillBeDisabledExpectations(); service->Initialize(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); return service; } @@ -450,5 +450,5 @@ TEST_F(CloudPrintProxyPolicyTest, StartupBrowserCreatorWithCommandLine) { command_line.AppendSwitch(switches::kCheckCloudPrintConnectorPolicy); EXPECT_FALSE(LaunchBrowser(command_line, &profile_)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } diff --git a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc index 2f8de5e..fd41ece 100644 --- a/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc +++ b/chrome/browser/printing/cloud_print/test/cloud_print_proxy_process_browsertest.cc @@ -92,20 +92,21 @@ class TestServiceProcess : public ServiceProcess { TestServiceProcess() { } virtual ~TestServiceProcess() { } - bool Initialize(MessageLoopForUI* message_loop, ServiceProcessState* state); + bool Initialize(base::MessageLoopForUI* message_loop, + ServiceProcessState* state); base::MessageLoopProxy* IOMessageLoopProxy() { return io_thread_->message_loop_proxy(); } }; -bool TestServiceProcess::Initialize(MessageLoopForUI* message_loop, +bool TestServiceProcess::Initialize(base::MessageLoopForUI* message_loop, ServiceProcessState* state) { main_message_loop_ = message_loop; service_process_state_.reset(state); - base::Thread::Options options(MessageLoop::TYPE_IO, 0); + base::Thread::Options options(base::MessageLoop::TYPE_IO, 0); io_thread_.reset(new base::Thread("TestServiceProcess_IO")); return io_thread_->StartWithOptions(options); } @@ -202,7 +203,7 @@ typedef base::Callback<void(MockServiceIPCServer* server)> // service process. Any non-zero return value will be printed out and can help // determine the failure. int CloudPrintMockService_Main(SetExpectationsCallback set_expectations) { - MessageLoopForUI main_message_loop; + base::MessageLoopForUI main_message_loop; main_message_loop.set_thread_name("Main Thread"); #if defined(OS_MACOSX) @@ -315,7 +316,7 @@ class CloudPrintProxyPolicyStartupTest : public base::MultiProcessTest, } protected: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; base::Thread io_thread_; @@ -346,7 +347,7 @@ class CloudPrintProxyPolicyStartupTest : public base::MultiProcessTest, void Notify() { seen_ = true; if (running_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } private: @@ -366,7 +367,7 @@ CloudPrintProxyPolicyStartupTest::~CloudPrintProxyPolicyStartupTest() { } void CloudPrintProxyPolicyStartupTest::SetUp() { - base::Thread::Options options(MessageLoop::TYPE_IO, 0); + base::Thread::Options options(base::MessageLoop::TYPE_IO, 0); ASSERT_TRUE(io_thread_.StartWithOptions(options)); #if defined(OS_MACOSX) @@ -487,14 +488,15 @@ TEST_F(CloudPrintProxyPolicyStartupTest, StartBrowserWithoutPolicy) { test_launcher_utils::PrepareBrowserCommandLineForTests(&command_line); WaitForConnect(); - MessageLoop::current()->PostDelayedTask(FROM_HERE, - MessageLoop::QuitClosure(), - TestTimeouts::action_timeout()); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TestTimeouts::action_timeout()); bool run_loop = LaunchBrowser(command_line, profile); EXPECT_FALSE(run_loop); if (run_loop) - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(MockServiceIPCServer::EnabledUserId(), prefs->GetString(prefs::kCloudPrintEmail)); @@ -529,16 +531,17 @@ TEST_F(CloudPrintProxyPolicyStartupTest, StartBrowserWithPolicy) { test_launcher_utils::PrepareBrowserCommandLineForTests(&command_line); WaitForConnect(); - MessageLoop::current()->PostDelayedTask(FROM_HERE, - MessageLoop::QuitClosure(), - TestTimeouts::action_timeout()); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + TestTimeouts::action_timeout()); bool run_loop = LaunchBrowser(command_line, profile); // No expectations on run_loop being true here; that would be a race // condition. if (run_loop) - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ("", prefs->GetString(prefs::kCloudPrintEmail)); diff --git a/chrome/browser/printing/print_dialog_cloud_interative_uitest.cc b/chrome/browser/printing/print_dialog_cloud_interative_uitest.cc index eb8eef4..36b8af6 100644 --- a/chrome/browser/printing/print_dialog_cloud_interative_uitest.cc +++ b/chrome/browser/printing/print_dialog_cloud_interative_uitest.cc @@ -161,7 +161,7 @@ class PrintDialogCloudTest : public InProcessBrowserTest { virtual void OnResponseCompleted(net::URLRequest* request) OVERRIDE { BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); } }; diff --git a/chrome/browser/printing/print_dialog_cloud_unittest.cc b/chrome/browser/printing/print_dialog_cloud_unittest.cc index ce50f28..72f18ed 100644 --- a/chrome/browser/printing/print_dialog_cloud_unittest.cc +++ b/chrome/browser/printing/print_dialog_cloud_unittest.cc @@ -235,7 +235,7 @@ class CloudPrintDataSenderTest : public testing::Test { scoped_refptr<CloudPrintDataSender> print_data_sender_; scoped_ptr<MockCloudPrintDataSenderHelper> mock_helper_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread file_thread_; content::TestBrowserThread io_thread_; }; @@ -253,7 +253,7 @@ TEST_F(CloudPrintDataSenderTest, CanSend) { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&CloudPrintDataSender::SendPrintData, print_data_sender)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } TEST_F(CloudPrintDataSenderTest, NoData) { @@ -264,7 +264,7 @@ TEST_F(CloudPrintDataSenderTest, NoData) { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&CloudPrintDataSender::SendPrintData, print_data_sender)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } TEST_F(CloudPrintDataSenderTest, EmptyData) { @@ -277,7 +277,7 @@ TEST_F(CloudPrintDataSenderTest, EmptyData) { BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, base::Bind(&CloudPrintDataSender::SendPrintData, print_data_sender)); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } // Testing for CloudPrintFlowHandler needs a mock @@ -316,7 +316,7 @@ class CloudPrintWebDialogDelegateTest : public testing::Test { delete mock_flow_handler_.get(); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; base::WeakPtr<MockCloudPrintFlowHandler> mock_flow_handler_; scoped_ptr<CloudPrintWebDialogDelegate> delegate_; diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc index 6c91282..2e95728 100644 --- a/chrome/browser/printing/print_job.cc +++ b/chrome/browser/printing/print_job.cc @@ -31,7 +31,7 @@ void HoldRefCallback(const scoped_refptr<printing::PrintJobWorkerOwner>& owner, namespace printing { PrintJob::PrintJob() - : ui_message_loop_(MessageLoop::current()), + : ui_message_loop_(base::MessageLoop::current()), source_(NULL), worker_(), settings_(), @@ -44,8 +44,8 @@ PrintJob::PrintJob() DCHECK(ui_message_loop_); // This is normally a UI message loop, but in unit tests, the message loop is // of the 'default' type. - DCHECK(ui_message_loop_->type() == MessageLoop::TYPE_UI || - ui_message_loop_->type() == MessageLoop::TYPE_DEFAULT); + DCHECK(ui_message_loop_->type() == base::MessageLoop::TYPE_UI || + ui_message_loop_->type() == base::MessageLoop::TYPE_DEFAULT); ui_message_loop_->AddDestructionObserver(this); } @@ -56,7 +56,7 @@ PrintJob::~PrintJob() { DCHECK(!is_canceling_); if (worker_.get()) DCHECK(worker_->message_loop() == NULL); - DCHECK_EQ(ui_message_loop_, MessageLoop::current()); + DCHECK_EQ(ui_message_loop_, base::MessageLoop::current()); } void PrintJob::Initialize(PrintJobWorkerOwner* job, @@ -84,7 +84,7 @@ void PrintJob::Initialize(PrintJobWorkerOwner* job, void PrintJob::Observe(int type, const content::NotificationSource& source, const content::NotificationDetails& details) { - DCHECK_EQ(ui_message_loop_, MessageLoop::current()); + DCHECK_EQ(ui_message_loop_, base::MessageLoop::current()); switch (type) { case chrome::NOTIFICATION_PRINT_JOB_EVENT: { OnNotifyPrintJobEvent(*content::Details<JobEventDetails>(details).ptr()); @@ -126,7 +126,7 @@ void PrintJob::WillDestroyCurrentMessageLoop() { } void PrintJob::StartPrinting() { - DCHECK_EQ(ui_message_loop_, MessageLoop::current()); + DCHECK_EQ(ui_message_loop_, base::MessageLoop::current()); DCHECK(worker_->message_loop()); DCHECK(!is_job_pending_); if (!worker_->message_loop() || is_job_pending_) @@ -151,7 +151,7 @@ void PrintJob::StartPrinting() { } void PrintJob::Stop() { - DCHECK_EQ(ui_message_loop_, MessageLoop::current()); + DCHECK_EQ(ui_message_loop_, base::MessageLoop::current()); if (quit_factory_.HasWeakPtrs()) { // In case we're running a nested message loop to wait for a job to finish, @@ -163,7 +163,7 @@ void PrintJob::Stop() { // Be sure to live long enough. scoped_refptr<PrintJob> handle(this); - MessageLoop* worker_loop = worker_->message_loop(); + base::MessageLoop* worker_loop = worker_->message_loop(); if (worker_loop) { ControlledWorkerShutdown(); @@ -183,8 +183,9 @@ void PrintJob::Cancel() { // Be sure to live long enough. scoped_refptr<PrintJob> handle(this); - DCHECK_EQ(ui_message_loop_, MessageLoop::current()); - MessageLoop* worker_loop = worker_.get() ? worker_->message_loop() : NULL; + DCHECK_EQ(ui_message_loop_, base::MessageLoop::current()); + base::MessageLoop* worker_loop = + worker_.get() ? worker_->message_loop() : NULL; if (worker_loop) { // Call this right now so it renders the context invalid. Do not use // InvokeLater since it would take too much time. @@ -205,11 +206,12 @@ bool PrintJob::FlushJob(base::TimeDelta timeout) { // Make sure the object outlive this message loop. scoped_refptr<PrintJob> handle(this); - MessageLoop::current()->PostDelayedTask(FROM_HERE, + base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&PrintJob::Quit, quit_factory_.GetWeakPtr()), timeout); - MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); - MessageLoop::current()->Run(); + base::MessageLoop::ScopedNestableTaskAllower allow( + base::MessageLoop::current()); + base::MessageLoop::current()->Run(); return true; } @@ -281,7 +283,7 @@ void PrintJob::OnNotifyPrintJobEvent(const JobEventDetails& event_details) { } case JobEventDetails::DOC_DONE: { // This will call Stop() and broadcast a JOB_DONE message. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&PrintJob::OnDocumentDone, this)); break; } @@ -309,7 +311,7 @@ void PrintJob::OnDocumentDone() { } void PrintJob::ControlledWorkerShutdown() { - DCHECK_EQ(ui_message_loop_, MessageLoop::current()); + DCHECK_EQ(ui_message_loop_, base::MessageLoop::current()); // The deadlock this code works around is specific to window messaging on // Windows, so we aren't likely to need it on any other platforms. @@ -375,7 +377,7 @@ void PrintJob::HoldUntilStopIsCalled(const scoped_refptr<PrintJob>&) { } void PrintJob::Quit() { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // Takes settings_ ownership and will be deleted in the receiving thread. diff --git a/chrome/browser/printing/print_job.h b/chrome/browser/printing/print_job.h index 1cb6eda..83b4bca 100644 --- a/chrome/browser/printing/print_job.h +++ b/chrome/browser/printing/print_job.h @@ -34,7 +34,7 @@ class PrinterQuery; // runs in the UI thread. class PrintJob : public PrintJobWorkerOwner, public content::NotificationObserver, - public MessageLoop::DestructionObserver { + public base::MessageLoop::DestructionObserver { public: // Create a empty PrintJob. When initializing with this constructor, // post-constructor initialization must be done with Initialize(). @@ -54,7 +54,7 @@ class PrintJob : public PrintJobWorkerOwner, virtual void GetSettingsDone(const PrintSettings& new_settings, PrintingContext::Result result) OVERRIDE; virtual PrintJobWorker* DetachWorker(PrintJobWorkerOwner* new_owner) OVERRIDE; - virtual MessageLoop* message_loop() OVERRIDE; + virtual base::MessageLoop* message_loop() OVERRIDE; virtual const PrintSettings& settings() const OVERRIDE; virtual int cookie() const OVERRIDE; @@ -124,7 +124,7 @@ class PrintJob : public PrintJobWorkerOwner, // Main message loop reference. Used to send notifications in the right // thread. - MessageLoop* const ui_message_loop_; + base::MessageLoop* const ui_message_loop_; // Source that generates the PrintedPage's (i.e. a WebContents). It will be // set back to NULL if the source is deleted before this object. diff --git a/chrome/browser/printing/print_job_unittest.cc b/chrome/browser/printing/print_job_unittest.cc index 24ddfa3..eb41acd 100644 --- a/chrome/browser/printing/print_job_unittest.cc +++ b/chrome/browser/printing/print_job_unittest.cc @@ -46,7 +46,7 @@ class TestOwner : public printing::PrintJobWorkerOwner { settings_ = worker->printing_context()->settings(); return worker; } - virtual MessageLoop* message_loop() OVERRIDE { + virtual base::MessageLoop* message_loop() OVERRIDE { EXPECT_FALSE(true); return NULL; } @@ -93,7 +93,7 @@ TEST_F(PrintJobTest, SimplePrint) { // known lifetime. // This message loop is actually never run. - MessageLoop current; + base::MessageLoop current; content::NotificationRegistrar registrar_; TestPrintNotifObserv observ; @@ -101,7 +101,7 @@ TEST_F(PrintJobTest, SimplePrint) { content::NotificationService::AllSources()); volatile bool check = false; scoped_refptr<printing::PrintJob> job(new TestPrintJob(&check)); - EXPECT_EQ(MessageLoop::current(), job->message_loop()); + EXPECT_EQ(base::MessageLoop::current(), job->message_loop()); scoped_refptr<TestOwner> owner(new TestOwner); TestSource source; job->Initialize(owner, &source, 1); @@ -120,7 +120,7 @@ TEST_F(PrintJobTest, SimplePrint) { TEST_F(PrintJobTest, SimplePrintLateInit) { volatile bool check = false; - MessageLoop current; + base::MessageLoop current; scoped_refptr<printing::PrintJob> job(new TestPrintJob(&check)); job = NULL; EXPECT_TRUE(check); diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc index 70459ed..a90cda0 100644 --- a/chrome/browser/printing/print_job_worker.cc +++ b/chrome/browser/printing/print_job_worker.cc @@ -53,7 +53,7 @@ PrintJobWorker::PrintJobWorker(PrintJobWorkerOwner* owner) owner_(owner), weak_factory_(this) { // The object is created in the IO thread. - DCHECK_EQ(owner_->message_loop(), MessageLoop::current()); + DCHECK_EQ(owner_->message_loop(), base::MessageLoop::current()); printing_context_.reset(PrintingContext::Create( g_browser_process->GetApplicationLocale())); @@ -63,7 +63,7 @@ PrintJobWorker::~PrintJobWorker() { // The object is normally deleted in the UI thread, but when the user // cancels printing or in the case of print preview, the worker is destroyed // on the I/O thread. - DCHECK_EQ(owner_->message_loop(), MessageLoop::current()); + DCHECK_EQ(owner_->message_loop(), base::MessageLoop::current()); Stop(); } @@ -82,7 +82,7 @@ void PrintJobWorker::GetSettings(bool ask_user_for_settings, int document_page_count, bool has_selection, MarginType margin_type) { - DCHECK_EQ(message_loop(), MessageLoop::current()); + DCHECK_EQ(message_loop(), base::MessageLoop::current()); DCHECK_EQ(page_number_, PageNumber::npos()); // Recursive task processing is needed for the dialog in case it needs to be @@ -112,7 +112,7 @@ void PrintJobWorker::GetSettings(bool ask_user_for_settings, } void PrintJobWorker::SetSettings(const DictionaryValue* const new_settings) { - DCHECK_EQ(message_loop(), MessageLoop::current()); + DCHECK_EQ(message_loop(), base::MessageLoop::current()); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, @@ -194,7 +194,7 @@ void PrintJobWorker::UseDefaultSettings() { } void PrintJobWorker::StartPrinting(PrintedDocument* new_document) { - DCHECK_EQ(message_loop(), MessageLoop::current()); + DCHECK_EQ(message_loop(), base::MessageLoop::current()); DCHECK_EQ(page_number_, PageNumber::npos()); DCHECK_EQ(document_, new_document); DCHECK(document_.get()); @@ -228,7 +228,7 @@ void PrintJobWorker::StartPrinting(PrintedDocument* new_document) { } void PrintJobWorker::OnDocumentChanged(PrintedDocument* new_document) { - DCHECK_EQ(message_loop(), MessageLoop::current()); + DCHECK_EQ(message_loop(), base::MessageLoop::current()); DCHECK_EQ(page_number_, PageNumber::npos()); DCHECK(!new_document || new_document->settings().Equals(printing_context_->settings())); @@ -244,7 +244,7 @@ void PrintJobWorker::OnNewPage() { return; // message_loop() could return NULL when the print job is cancelled. - DCHECK_EQ(message_loop(), MessageLoop::current()); + DCHECK_EQ(message_loop(), base::MessageLoop::current()); if (page_number_ == PageNumber::npos()) { // Find first page to print. @@ -267,7 +267,7 @@ void PrintJobWorker::OnNewPage() { scoped_refptr<PrintedPage> page; if (!document_->GetPage(page_number_.ToInt(), &page)) { // We need to wait for the page to be available. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&PrintJobWorker::OnNewPage, weak_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(500)); @@ -292,7 +292,7 @@ void PrintJobWorker::Cancel() { } void PrintJobWorker::OnDocumentDone() { - DCHECK_EQ(message_loop(), MessageLoop::current()); + DCHECK_EQ(message_loop(), base::MessageLoop::current()); DCHECK_EQ(page_number_, PageNumber::npos()); DCHECK(document_.get()); @@ -311,7 +311,7 @@ void PrintJobWorker::OnDocumentDone() { } void PrintJobWorker::SpoolPage(PrintedPage* page) { - DCHECK_EQ(message_loop(), MessageLoop::current()); + DCHECK_EQ(message_loop(), base::MessageLoop::current()); DCHECK_NE(page_number_, PageNumber::npos()); // Signal everyone that the page is about to be printed. @@ -360,7 +360,7 @@ void PrintJobWorker::SpoolPage(PrintedPage* page) { } void PrintJobWorker::OnFailure() { - DCHECK_EQ(message_loop(), MessageLoop::current()); + DCHECK_EQ(message_loop(), base::MessageLoop::current()); // We may loose our last reference by broadcasting the FAILED event. scoped_refptr<PrintJobWorkerOwner> handle(owner_); diff --git a/chrome/browser/printing/print_view_manager.cc b/chrome/browser/printing/print_view_manager.cc index b9b2497..8aed1a0 100644 --- a/chrome/browser/printing/print_view_manager.cc +++ b/chrome/browser/printing/print_view_manager.cc @@ -490,7 +490,7 @@ void PrintViewManager::ShouldQuitFromInnerMessageLoop() { inside_inner_message_loop_) { // We are in a message loop created by RenderAllMissingPagesNow. Quit from // it. - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); inside_inner_message_loop_ = false; } } @@ -595,17 +595,18 @@ bool PrintViewManager::RunInnerMessageLoop() { // be CPU bound, the page overly complex/large or the system just // memory-bound. static const int kPrinterSettingsTimeout = 60000; - base::OneShotTimer<MessageLoop> quit_timer; + base::OneShotTimer<base::MessageLoop> quit_timer; quit_timer.Start(FROM_HERE, TimeDelta::FromMilliseconds(kPrinterSettingsTimeout), - MessageLoop::current(), &MessageLoop::Quit); + base::MessageLoop::current(), &base::MessageLoop::Quit); inside_inner_message_loop_ = true; // Need to enable recursive task. { - MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); - MessageLoop::current()->Run(); + base::MessageLoop::ScopedNestableTaskAllower allow( + base::MessageLoop::current()); + base::MessageLoop::current()->Run(); } bool success = true; diff --git a/chrome/browser/printing/printer_query.cc b/chrome/browser/printing/printer_query.cc index b9d9ed9..07ae0d8 100644 --- a/chrome/browser/printing/printer_query.cc +++ b/chrome/browser/printing/printer_query.cc @@ -14,12 +14,12 @@ namespace printing { PrinterQuery::PrinterQuery() - : io_message_loop_(MessageLoop::current()), + : io_message_loop_(base::MessageLoop::current()), worker_(new PrintJobWorker(this)), is_print_dialog_box_shown_(false), cookie_(PrintSettings::NewCookie()), last_status_(PrintingContext::FAILED) { - DCHECK_EQ(io_message_loop_->type(), MessageLoop::TYPE_IO); + DCHECK_EQ(io_message_loop_->type(), base::MessageLoop::TYPE_IO); } PrinterQuery::~PrinterQuery() { @@ -74,7 +74,7 @@ void PrinterQuery::GetSettings(GetSettingsAskParam ask_user_for_settings, bool has_selection, MarginType margin_type, const base::Closure& callback) { - DCHECK_EQ(io_message_loop_, MessageLoop::current()); + DCHECK_EQ(io_message_loop_, base::MessageLoop::current()); DCHECK(!is_print_dialog_box_shown_); StartWorker(callback); diff --git a/chrome/browser/printing/printing_layout_browsertest.cc b/chrome/browser/printing/printing_layout_browsertest.cc index 2e00618..d97762b 100644 --- a/chrome/browser/printing/printing_layout_browsertest.cc +++ b/chrome/browser/printing/printing_layout_browsertest.cc @@ -78,14 +78,16 @@ class PrintingLayoutTest : public PrintingTest<InProcessBrowserTest>, switch (content::Details<printing::JobEventDetails>(details)->type()) { case printing::JobEventDetails::JOB_DONE: { // Succeeded. - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask( + FROM_HERE, base::MessageLoop::QuitClosure()); break; } case printing::JobEventDetails::USER_INIT_CANCELED: case printing::JobEventDetails::FAILED: { // Failed. ASSERT_TRUE(false); - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask( + FROM_HERE, base::MessageLoop::QuitClosure()); break; } case printing::JobEventDetails::NEW_DOC: diff --git a/chrome/browser/process_singleton_browsertest.cc b/chrome/browser/process_singleton_browsertest.cc index 5ff8f00..d5dc29d 100644 --- a/chrome/browser/process_singleton_browsertest.cc +++ b/chrome/browser/process_singleton_browsertest.cc @@ -252,7 +252,7 @@ IN_PROC_BROWSER_TEST_F(ProcessSingletonTest, MAYBE_StartupRaceCondition) { chrome_starters_[i]->Reset(); ASSERT_TRUE(chrome_starter_threads_[i]->IsRunning()); - ASSERT_NE(static_cast<MessageLoop*>(NULL), + ASSERT_NE(static_cast<base::MessageLoop*>(NULL), chrome_starter_threads_[i]->message_loop()); chrome_starter_threads_[i]->message_loop()->PostTask( diff --git a/chrome/browser/process_singleton_linux.cc b/chrome/browser/process_singleton_linux.cc index d77e083..908637f 100644 --- a/chrome/browser/process_singleton_linux.cc +++ b/chrome/browser/process_singleton_linux.cc @@ -406,16 +406,16 @@ bool ConnectSocket(ScopedSocket* socket, // This class sets up a listener on the singleton socket and handles parsing // messages that come in on the singleton socket. class ProcessSingleton::LinuxWatcher - : public MessageLoopForIO::Watcher, - public MessageLoop::DestructionObserver, + : public base::MessageLoopForIO::Watcher, + public base::MessageLoop::DestructionObserver, public base::RefCountedThreadSafe<ProcessSingleton::LinuxWatcher, BrowserThread::DeleteOnIOThread> { public: // A helper class to read message from an established socket. - class SocketReader : public MessageLoopForIO::Watcher { + class SocketReader : public base::MessageLoopForIO::Watcher { public: SocketReader(ProcessSingleton::LinuxWatcher* parent, - MessageLoop* ui_message_loop, + base::MessageLoop* ui_message_loop, int fd) : parent_(parent), ui_message_loop_(ui_message_loop), @@ -423,8 +423,8 @@ class ProcessSingleton::LinuxWatcher bytes_read_(0) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); // Wait for reads. - MessageLoopForIO::current()->WatchFileDescriptor( - fd, true, MessageLoopForIO::WATCH_READ, &fd_reader_, this); + base::MessageLoopForIO::current()->WatchFileDescriptor( + fd, true, base::MessageLoopForIO::WATCH_READ, &fd_reader_, this); // If we haven't completed in a reasonable amount of time, give up. timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(kTimeoutInSeconds), this, &SocketReader::CleanupAndDeleteSelf); @@ -453,13 +453,13 @@ class ProcessSingleton::LinuxWatcher // We're deleted beyond this point. } - MessageLoopForIO::FileDescriptorWatcher fd_reader_; + base::MessageLoopForIO::FileDescriptorWatcher fd_reader_; // The ProcessSingleton::LinuxWatcher that owns us. ProcessSingleton::LinuxWatcher* const parent_; // A reference to the UI message loop. - MessageLoop* const ui_message_loop_; + base::MessageLoop* const ui_message_loop_; // The file descriptor we're reading. const int fd_; @@ -478,7 +478,7 @@ class ProcessSingleton::LinuxWatcher // We expect to only be constructed on the UI thread. explicit LinuxWatcher(ProcessSingleton* parent) - : ui_message_loop_(MessageLoop::current()), + : ui_message_loop_(base::MessageLoop::current()), parent_(parent) { } @@ -513,18 +513,18 @@ class ProcessSingleton::LinuxWatcher DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); STLDeleteElements(&readers_); - MessageLoopForIO* ml = MessageLoopForIO::current(); + base::MessageLoopForIO* ml = base::MessageLoopForIO::current(); ml->RemoveDestructionObserver(this); } // Removes and deletes the SocketReader. void RemoveSocketReader(SocketReader* reader); - MessageLoopForIO::FileDescriptorWatcher fd_watcher_; + base::MessageLoopForIO::FileDescriptorWatcher fd_watcher_; // A reference to the UI message loop (i.e., the message loop we were // constructed on). - MessageLoop* ui_message_loop_; + base::MessageLoop* ui_message_loop_; // The ProcessSingleton that owns us. ProcessSingleton* const parent_; @@ -556,16 +556,16 @@ void ProcessSingleton::LinuxWatcher::OnFileCanReadWithoutBlocking(int fd) { void ProcessSingleton::LinuxWatcher::StartListening(int socket) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); // Watch for client connections on this socket. - MessageLoopForIO* ml = MessageLoopForIO::current(); + base::MessageLoopForIO* ml = base::MessageLoopForIO::current(); ml->AddDestructionObserver(this); - ml->WatchFileDescriptor(socket, true, MessageLoopForIO::WATCH_READ, + ml->WatchFileDescriptor(socket, true, base::MessageLoopForIO::WATCH_READ, &fd_watcher_, this); } void ProcessSingleton::LinuxWatcher::HandleMessage( const std::string& current_dir, const std::vector<std::string>& argv, SocketReader* reader) { - DCHECK(ui_message_loop_ == MessageLoop::current()); + DCHECK(ui_message_loop_ == base::MessageLoop::current()); DCHECK(reader); if (parent_->notification_callback_.Run(CommandLine(argv), diff --git a/chrome/browser/profiles/profile_destroyer.cc b/chrome/browser/profiles/profile_destroyer.cc index 8c98be2..7aa57d2 100644 --- a/chrome/browser/profiles/profile_destroyer.cc +++ b/chrome/browser/profiles/profile_destroyer.cc @@ -141,7 +141,7 @@ void ProfileDestroyer::Observe(int type, if (num_hosts_ == 0) { // Delay the destruction one step further in case other observers of this // notification need to look at the profile attached to the host. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ProfileDestroyer::DestroyProfile, this)); } } diff --git a/chrome/browser/profiles/profile_destroyer_unittest.cc b/chrome/browser/profiles/profile_destroyer_unittest.cc index c1c9297..3c04289 100644 --- a/chrome/browser/profiles/profile_destroyer_unittest.cc +++ b/chrome/browser/profiles/profile_destroyer_unittest.cc @@ -86,12 +86,12 @@ TEST_F(ProfileDestroyerTest, DelayProfileDestruction) { render_process_host1.release()->Cleanup(); // And asynchronicity kicked in properly. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(off_the_record_profile_->destroyed_otr_profile_); // I meant, ALL the render process hosts... :-) render_process_host2.release()->Cleanup(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(off_the_record_profile_->destroyed_otr_profile_); } @@ -118,7 +118,7 @@ TEST_F(ProfileDestroyerTest, DelayOriginalProfileDestruction) { EXPECT_FALSE(original_profile->destroyed_otr_profile_); render_process_host1.release()->Cleanup(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(NULL, TestingOriginalDestructionProfile::living_instance_); // And the same protection should apply to the main profile. @@ -133,6 +133,6 @@ TEST_F(ProfileDestroyerTest, DelayOriginalProfileDestruction) { ProfileDestroyer::DestroyProfileWhenAppropriate(main_profile); EXPECT_EQ(main_profile, TestingOriginalDestructionProfile::living_instance_); render_process_host2.release()->Cleanup(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(NULL, TestingOriginalDestructionProfile::living_instance_); } diff --git a/chrome/browser/profiles/profile_info_cache_unittest.h b/chrome/browser/profiles/profile_info_cache_unittest.h index ec2ec70..79b9cf5 100644 --- a/chrome/browser/profiles/profile_info_cache_unittest.h +++ b/chrome/browser/profiles/profile_info_cache_unittest.h @@ -62,7 +62,7 @@ class ProfileInfoCacheTest : public testing::Test { TestingProfileManager testing_profile_manager_; private: - MessageLoopForUI ui_loop_; + base::MessageLoopForUI ui_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; ProfileNameVerifierObserver name_observer_; diff --git a/chrome/browser/profiles/profile_manager_browsertest.cc b/chrome/browser/profiles/profile_manager_browsertest.cc index 4499aa8..9cf447b 100644 --- a/chrome/browser/profiles/profile_manager_browsertest.cc +++ b/chrome/browser/profiles/profile_manager_browsertest.cc @@ -23,7 +23,7 @@ namespace { void OnUnblockOnProfileCreation(Profile* profile, Profile::CreateStatus status) { if (status == Profile::CREATE_STATUS_INITIALIZED) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void ProfileCreationComplete(Profile* profile, Profile::CreateStatus status) { @@ -32,7 +32,7 @@ void ProfileCreationComplete(Profile* profile, Profile::CreateStatus status) { EXPECT_EQ(chrome::GetTotalBrowserCountForProfile(profile), 0U); EXPECT_EQ(chrome::GetTotalBrowserCount(), 1U); if (status == Profile::CREATE_STATUS_INITIALIZED) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } class ProfileRemovalObserver : public ProfileInfoCacheObserver { diff --git a/chrome/browser/profiles/profile_manager_unittest.cc b/chrome/browser/profiles/profile_manager_unittest.cc index 42c2ac2..ecd48e9 100644 --- a/chrome/browser/profiles/profile_manager_unittest.cc +++ b/chrome/browser/profiles/profile_manager_unittest.cc @@ -138,7 +138,7 @@ class ProfileManagerTest : public testing::Test { scoped_refptr<extensions::EventRouterForwarder> extension_event_router_forwarder_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc b/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc index 7835a0e..aedcfb2 100644 --- a/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc +++ b/chrome/browser/profiles/profile_shortcut_manager_unittest_win.cc @@ -86,8 +86,9 @@ class ProfileShortcutManagerTest : public testing::Test { } void RunPendingTasks() { - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); } void SetupDefaultProfileShortcut(const tracked_objects::Location& location) { @@ -269,7 +270,7 @@ class ProfileShortcutManagerTest : public testing::Test { return system_shortcuts_directory; } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; scoped_ptr<TestingProfileManager> profile_manager_; diff --git a/chrome/browser/renderer_host/plugin_info_message_filter_unittest.cc b/chrome/browser/renderer_host/plugin_info_message_filter_unittest.cc index f7e905f..9356849 100644 --- a/chrome/browser/renderer_host/plugin_info_message_filter_unittest.cc +++ b/chrome/browser/renderer_host/plugin_info_message_filter_unittest.cc @@ -111,10 +111,10 @@ class PluginInfoMessageFilterTest : public ::testing::Test { private: void PluginsLoaded(const std::vector<webkit::WebPluginInfo>& plugins) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; // PluginService::GetPlugins on Windows jumps to the FILE thread even with // a MockPluginList. content::TestBrowserThread file_thread_; diff --git a/chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc b/chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc index df850d1..d92ec09 100644 --- a/chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc +++ b/chrome/browser/renderer_host/render_process_host_chrome_browsertest.cc @@ -78,8 +78,8 @@ class ChromeRenderProcessHostTest : public InProcessBrowserTest { // Ensure that the backgrounding / foregrounding gets a chance to run. content::BrowserThread::PostTaskAndReply( content::BrowserThread::PROCESS_LAUNCHER, FROM_HERE, - base::Bind(&base::DoNothing), MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::Bind(&base::DoNothing), base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); return wc->GetRenderProcessHost()->GetHandle(); } diff --git a/chrome/browser/renderer_host/web_cache_manager.cc b/chrome/browser/renderer_host/web_cache_manager.cc index b7966a4..812fcca 100644 --- a/chrome/browser/renderer_host/web_cache_manager.cc +++ b/chrome/browser/renderer_host/web_cache_manager.cc @@ -418,7 +418,7 @@ void WebCacheManager::ReviseAllocationStrategy() { void WebCacheManager::ReviseAllocationStrategyLater() { // Ask to be called back in a few milliseconds to actually recompute our // allocation. - MessageLoop::current()->PostDelayedTask(FROM_HERE, + base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind( &WebCacheManager::ReviseAllocationStrategy, weak_factory_.GetWeakPtr()), diff --git a/chrome/browser/renderer_host/web_cache_manager_unittest.cc b/chrome/browser/renderer_host/web_cache_manager_unittest.cc index 80f1716..9cd53cb 100644 --- a/chrome/browser/renderer_host/web_cache_manager_unittest.cc +++ b/chrome/browser/renderer_host/web_cache_manager_unittest.cc @@ -93,7 +93,7 @@ class WebCacheManagerTest : public testing::Test { private: WebCacheManager manager_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; }; diff --git a/chrome/browser/safe_browsing/browser_feature_extractor.cc b/chrome/browser/safe_browsing/browser_feature_extractor.cc index 48c166c..00cc9d1 100644 --- a/chrome/browser/safe_browsing/browser_feature_extractor.cc +++ b/chrome/browser/safe_browsing/browser_feature_extractor.cc @@ -221,7 +221,7 @@ void BrowserFeatureExtractor::ExtractFeatures(const BrowseInfo* info, ExtractBrowseInfoFeatures(*info, request); pending_extractions_[request] = callback; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&BrowserFeatureExtractor::StartExtractFeatures, weak_factory_.GetWeakPtr(), request, callback)); diff --git a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc index 726d175..034cbdc 100644 --- a/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc +++ b/chrome/browser/safe_browsing/browser_feature_extractor_unittest.cc @@ -116,7 +116,7 @@ class BrowserFeatureExtractorTest : public ChromeRenderViewHostTestHarness { bool ExtractFeatures(ClientPhishingRequest* request) { StartExtractFeatures(request); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(1U, success_.count(request)); return success_.count(request) ? success_[request] : false; } @@ -173,7 +173,7 @@ class BrowserFeatureExtractorTest : public ChromeRenderViewHostTestHarness { ASSERT_EQ(0U, success_.count(request)); success_[request] = success; if (--num_pending_ == 0) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } }; @@ -279,7 +279,7 @@ TEST_F(BrowserFeatureExtractorTest, MultipleRequestsAtOnce) { request2.set_client_score(1.0); StartExtractFeatures(&request2); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(success_[&request]); // Success is false because the second URL is not in the history and we are // not able to distinguish between a missing URL in the history and an error. diff --git a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc index 2b63648..4042396 100644 --- a/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc +++ b/chrome/browser/safe_browsing/client_side_detection_host_unittest.cc @@ -74,7 +74,7 @@ MATCHER(CallbackIsNull, "") { ACTION(QuitUIMessageLoop) { EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI)); - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } // It's kind of insane that InvokeArgument doesn't work with callbacks, but it @@ -177,7 +177,7 @@ void QuitUIMessageLoopFromIO() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); } } // namespace @@ -222,7 +222,7 @@ class ClientSideDetectionHostTest : public ChromeRenderViewHostTestHarness { } static void RunAllPendingOnIO(base::WaitableEvent* event) { - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); event->Signal(); } @@ -266,7 +266,7 @@ class ClientSideDetectionHostTest : public ChromeRenderViewHostTestHarness { BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, base::Bind(&QuitUIMessageLoopFromIO)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } void ExpectPreClassificationChecks(const GURL& url, @@ -306,7 +306,7 @@ class ClientSideDetectionHostTest : public ChromeRenderViewHostTestHarness { // Wait for CheckCsdWhitelist to be called if at all. FlushIOMessageLoop(); // Checks for CheckCache() to be called if at all. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(Mock::VerifyAndClear(csd_service_.get())); EXPECT_TRUE(Mock::VerifyAndClear(ui_manager_.get())); EXPECT_TRUE(Mock::VerifyAndClear(database_manager_.get())); @@ -403,7 +403,7 @@ TEST_F(ClientSideDetectionHostTest, OnPhishingDetectionDoneNotPhishing) { // Make sure DoDisplayBlockingPage is not going to be called. EXPECT_CALL(*ui_manager_, DoDisplayBlockingPage(_)).Times(0); cb.Run(GURL(verdict.url()), false); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(Mock::VerifyAndClear(ui_manager_.get())); } @@ -435,7 +435,7 @@ TEST_F(ClientSideDetectionHostTest, OnPhishingDetectionDoneDisabled) { // Make sure DoDisplayBlockingPage is not going to be called. EXPECT_CALL(*ui_manager_, DoDisplayBlockingPage(_)).Times(0); cb.Run(GURL(verdict.url()), false); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(Mock::VerifyAndClear(ui_manager_.get())); } @@ -470,7 +470,7 @@ TEST_F(ClientSideDetectionHostTest, OnPhishingDetectionDoneShowInterstitial) { .WillOnce(SaveArg<0>(&resource)); cb.Run(phishing_url, true); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(Mock::VerifyAndClear(ui_manager_.get())); EXPECT_EQ(phishing_url, resource.url); EXPECT_EQ(phishing_url, resource.original_url); @@ -548,7 +548,7 @@ TEST_F(ClientSideDetectionHostTest, OnPhishingDetectionDoneMultiplePings) { redirect_chain.push_back(other_phishing_url); SetRedirectChain(redirect_chain); OnPhishingDetectionDone(verdict.SerializeAsString()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(Mock::VerifyAndClear(csd_service_.get())); ASSERT_FALSE(cb_other.is_null()); @@ -561,7 +561,7 @@ TEST_F(ClientSideDetectionHostTest, OnPhishingDetectionDoneMultiplePings) { cb.Run(phishing_url, true); // Should have no effect. cb_other.Run(other_phishing_url, true); // Should show interstitial. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(Mock::VerifyAndClear(ui_manager_.get())); EXPECT_EQ(other_phishing_url, resource.url); EXPECT_EQ(other_phishing_url, resource.original_url); @@ -627,7 +627,7 @@ TEST_F(ClientSideDetectionHostTest, redirect_chain.push_back(url); SetRedirectChain(redirect_chain); OnPhishingDetectionDone(verdict.SerializeAsString()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(Mock::VerifyAndClear(csd_service_.get())); } @@ -954,7 +954,7 @@ TEST_F(ClientSideDetectionHostTest, ShouldClassifyUrl) { // Wait for CheckCsdWhitelist to be called on the IO thread. FlushIOMessageLoop(); // Wait for CheckCache() to be called on the UI thread. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Now we check that all expected functions were indeed called on the two // service objects. EXPECT_TRUE(Mock::VerifyAndClear(csd_service_.get())); diff --git a/chrome/browser/safe_browsing/client_side_detection_service.cc b/chrome/browser/safe_browsing/client_side_detection_service.cc index 5372789..7ec973d 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service.cc +++ b/chrome/browser/safe_browsing/client_side_detection_service.cc @@ -164,7 +164,7 @@ void ClientSideDetectionService::SendClientReportPhishingRequest( ClientPhishingRequest* verdict, const ClientReportPhishingRequestCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ClientSideDetectionService::StartClientReportPhishingRequest, weak_factory_.GetWeakPtr(), verdict, callback)); @@ -174,7 +174,7 @@ void ClientSideDetectionService::SendClientReportMalwareRequest( ClientMalwareRequest* verdict, const ClientReportMalwareRequestCallback& callback) { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ClientSideDetectionService::StartClientReportMalwareRequest, weak_factory_.GetWeakPtr(), verdict, callback)); @@ -294,7 +294,7 @@ void ClientSideDetectionService::ScheduleFetchModel(int64 delay_ms) { if (CommandLine::ForCurrentProcess()->HasSwitch( switches::kSbDisableAutoUpdate)) return; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ClientSideDetectionService::StartFetchModel, weak_factory_.GetWeakPtr()), diff --git a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc index 829bfeb..87d471e 100644 --- a/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc +++ b/chrome/browser/safe_browsing/client_side_detection_service_unittest.cc @@ -54,7 +54,7 @@ class MockClientSideDetectionService : public ClientSideDetectionService { }; ACTION(QuitCurrentMessageLoop) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } // namespace @@ -216,7 +216,7 @@ class ClientSideDetectionServiceTest : public testing::Test { protected: scoped_ptr<ClientSideDetectionService> csd_service_; scoped_ptr<net::FakeURLFetcherFactory> factory_; - MessageLoop msg_loop_; + base::MessageLoop msg_loop_; private: void SendRequestDone(GURL phishing_url, bool is_phishing) { diff --git a/chrome/browser/safe_browsing/database_manager.cc b/chrome/browser/safe_browsing/database_manager.cc index 7444720..ed89563 100644 --- a/chrome/browser/safe_browsing/database_manager.cc +++ b/chrome/browser/safe_browsing/database_manager.cc @@ -597,7 +597,8 @@ void SafeBrowsingDatabaseManager::CloseDatabase() { } SafeBrowsingDatabase* SafeBrowsingDatabaseManager::GetDatabase() { - DCHECK_EQ(MessageLoop::current(), safe_browsing_thread_->message_loop()); + DCHECK_EQ(base::MessageLoop::current(), + safe_browsing_thread_->message_loop()); if (database_) return database_; startup_metric_utils::ScopedSlowStartupUMA @@ -682,7 +683,8 @@ void SafeBrowsingDatabaseManager::OnCheckDone(SafeBrowsingCheck* check) { void SafeBrowsingDatabaseManager::GetAllChunksFromDatabase( GetChunksCallback callback) { - DCHECK_EQ(MessageLoop::current(), safe_browsing_thread_->message_loop()); + DCHECK_EQ(base::MessageLoop::current(), + safe_browsing_thread_->message_loop()); bool database_error = true; std::vector<SBListChunkRanges> lists; @@ -749,7 +751,8 @@ void SafeBrowsingDatabaseManager::DatabaseLoadComplete() { void SafeBrowsingDatabaseManager::AddDatabaseChunks( const std::string& list_name, SBChunkList* chunks, AddChunksCallback callback) { - DCHECK_EQ(MessageLoop::current(), safe_browsing_thread_->message_loop()); + DCHECK_EQ(base::MessageLoop::current(), + safe_browsing_thread_->message_loop()); if (chunks) { GetDatabase()->InsertChunks(list_name, *chunks); delete chunks; @@ -762,7 +765,8 @@ void SafeBrowsingDatabaseManager::AddDatabaseChunks( void SafeBrowsingDatabaseManager::DeleteDatabaseChunks( std::vector<SBChunkDelete>* chunk_deletes) { - DCHECK_EQ(MessageLoop::current(), safe_browsing_thread_->message_loop()); + DCHECK_EQ(base::MessageLoop::current(), + safe_browsing_thread_->message_loop()); if (chunk_deletes) { GetDatabase()->DeleteChunks(*chunk_deletes); delete chunk_deletes; @@ -797,7 +801,8 @@ SBThreatType SafeBrowsingDatabaseManager::GetThreatTypeFromListname( void SafeBrowsingDatabaseManager::DatabaseUpdateFinished( bool update_succeeded) { - DCHECK_EQ(MessageLoop::current(), safe_browsing_thread_->message_loop()); + DCHECK_EQ(base::MessageLoop::current(), + safe_browsing_thread_->message_loop()); GetDatabase()->UpdateFinished(update_succeeded); DCHECK(database_update_in_progress_); database_update_in_progress_ = false; @@ -816,7 +821,8 @@ void SafeBrowsingDatabaseManager::NotifyDatabaseUpdateFinished( } void SafeBrowsingDatabaseManager::OnCloseDatabase() { - DCHECK_EQ(MessageLoop::current(), safe_browsing_thread_->message_loop()); + DCHECK_EQ(base::MessageLoop::current(), + safe_browsing_thread_->message_loop()); DCHECK(closing_database_); // Because |closing_database_| is true, nothing on the IO thread will be @@ -833,14 +839,16 @@ void SafeBrowsingDatabaseManager::OnCloseDatabase() { } void SafeBrowsingDatabaseManager::OnResetDatabase() { - DCHECK_EQ(MessageLoop::current(), safe_browsing_thread_->message_loop()); + DCHECK_EQ(base::MessageLoop::current(), + safe_browsing_thread_->message_loop()); GetDatabase()->ResetDatabase(); } void SafeBrowsingDatabaseManager::CacheHashResults( const std::vector<SBPrefix>& prefixes, const std::vector<SBFullHashResult>& full_hashes) { - DCHECK_EQ(MessageLoop::current(), safe_browsing_thread_->message_loop()); + DCHECK_EQ(base::MessageLoop::current(), + safe_browsing_thread_->message_loop()); GetDatabase()->CacheHashResults(prefixes, full_hashes); } @@ -914,7 +922,8 @@ bool SafeBrowsingDatabaseManager::HandleOneCheck( void SafeBrowsingDatabaseManager::CheckDownloadHashOnSBThread( SafeBrowsingCheck* check) { - DCHECK_EQ(MessageLoop::current(), safe_browsing_thread_->message_loop()); + DCHECK_EQ(base::MessageLoop::current(), + safe_browsing_thread_->message_loop()); DCHECK(enable_download_protection_); DCHECK_EQ(1u, check->full_hashes.size()); @@ -938,7 +947,8 @@ void SafeBrowsingDatabaseManager::CheckDownloadHashOnSBThread( void SafeBrowsingDatabaseManager::CheckDownloadUrlOnSBThread( SafeBrowsingCheck* check) { - DCHECK_EQ(MessageLoop::current(), safe_browsing_thread_->message_loop()); + DCHECK_EQ(base::MessageLoop::current(), + safe_browsing_thread_->message_loop()); DCHECK(enable_download_protection_); std::vector<SBPrefix> prefix_hits; @@ -962,7 +972,8 @@ void SafeBrowsingDatabaseManager::CheckDownloadUrlOnSBThread( void SafeBrowsingDatabaseManager::CheckExtensionIDsOnSBThread( SafeBrowsingCheck* check) { - DCHECK_EQ(MessageLoop::current(), safe_browsing_thread_->message_loop()); + DCHECK_EQ(base::MessageLoop::current(), + safe_browsing_thread_->message_loop()); std::vector<SBPrefix> prefixes; for (std::vector<SBFullHash>::iterator it = check->full_hashes.begin(); @@ -1040,7 +1051,7 @@ void SafeBrowsingDatabaseManager::StartSafeBrowsingCheck( safe_browsing_thread_->message_loop()->PostTask(FROM_HERE, task); - MessageLoop::current()->PostDelayedTask(FROM_HERE, + base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&SafeBrowsingDatabaseManager::TimeoutCallback, check->timeout_factory_->GetWeakPtr(), check), check_timeout_); diff --git a/chrome/browser/safe_browsing/download_protection_service_unittest.cc b/chrome/browser/safe_browsing/download_protection_service_unittest.cc index 99bccc2..c497c2b 100644 --- a/chrome/browser/safe_browsing/download_protection_service_unittest.cc +++ b/chrome/browser/safe_browsing/download_protection_service_unittest.cc @@ -246,7 +246,7 @@ class DownloadProtectionServiceTest : public testing::Test { private: // Helper functions for FlushThreadMessageLoops. void RunAllPendingAndQuitUI() { - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); BrowserThread::PostTask( BrowserThread::UI, FROM_HERE, @@ -255,7 +255,7 @@ class DownloadProtectionServiceTest : public testing::Test { } void QuitMessageLoop() { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void PostRunMessageLoopTask(BrowserThread::ID thread) { @@ -308,7 +308,7 @@ class DownloadProtectionServiceTest : public testing::Test { scoped_refptr<FakeSafeBrowsingService> sb_service_; scoped_refptr<MockSignatureUtil> signature_util_; DownloadProtectionService* download_service_; - MessageLoop msg_loop_; + base::MessageLoop msg_loop_; DownloadProtectionService::DownloadCheckResult result_; bool has_result_; scoped_ptr<content::TestBrowserThread> io_thread_; @@ -827,7 +827,7 @@ TEST_F(DownloadProtectionServiceTest, CheckClientDownloadValidateRequest) { EXPECT_EQ("dummy cert data", chain.element(0).certificate()); // Simulate the request finishing. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&DownloadProtectionServiceTest::SendURLFetchComplete, base::Unretained(this), fetcher)); @@ -898,7 +898,7 @@ TEST_F(DownloadProtectionServiceTest, EXPECT_EQ(0, request.signature().certificate_chain_size()); // Simulate the request finishing. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&DownloadProtectionServiceTest::SendURLFetchComplete, base::Unretained(this), fetcher)); diff --git a/chrome/browser/safe_browsing/malware_details_unittest.cc b/chrome/browser/safe_browsing/malware_details_unittest.cc index cf54beb..10daca1 100644 --- a/chrome/browser/safe_browsing/malware_details_unittest.cc +++ b/chrome/browser/safe_browsing/malware_details_unittest.cc @@ -126,7 +126,7 @@ void QuitUIMessageLoop() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); } // Lets us provide a MockURLRequestContext with an HTTP Cache we pre-populate. @@ -214,7 +214,7 @@ class MalwareDetailsTest : public ChromeRenderViewHostTestHarness { base::Bind(&MalwareDetails::FinishCollection, report)); // Wait for the callback (SendSerializedMalwareDetails). DVLOG(1) << "Waiting for SendSerializedMalwareDetails"; - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); return ui_manager_->GetSerialized(); } @@ -421,7 +421,7 @@ TEST_F(MalwareDetailsTest, MalwareDOMDetails) { params.push_back(parent_node); report->OnReceivedMalwareDOMDetails(params); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); std::string serialized = WaitForSerializedReport(report); ClientMalwareReportRequest actual; @@ -553,7 +553,7 @@ TEST_F(MalwareDetailsTest, HTTPCache) { report->OnReceivedMalwareDOMDetails(params); // Let the cache callbacks complete - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); DVLOG(1) << "Getting serialized report"; std::string serialized = WaitForSerializedReport(report); @@ -624,7 +624,7 @@ TEST_F(MalwareDetailsTest, HTTPCacheNoEntries) { report->OnReceivedMalwareDOMDetails(params); // Let the cache callbacks complete - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); DVLOG(1) << "Getting serialized report"; std::string serialized = WaitForSerializedReport(report); @@ -673,7 +673,7 @@ TEST_F(MalwareDetailsTest, HistoryServiceUrls) { report->OnReceivedMalwareDOMDetails(params); // Let the redirects callbacks complete. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); std::string serialized = WaitForSerializedReport(report); ClientMalwareReportRequest actual; diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc index 6eb42fe..0ba350d 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc @@ -133,7 +133,7 @@ class FakeSafeBrowsingUIManager : public SafeBrowsingUIManager { void OnMalwareDetailsDone() { EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI)); - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } std::string GetReport() { @@ -247,7 +247,7 @@ class FakeMalwareDetails : public MalwareDetails { void OnDOMDetailsDone() { got_dom_ = true; if (waiting_) { - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } @@ -296,7 +296,7 @@ class TestSafeBrowsingBlockingPage : public SafeBrowsingBlockingPageV2 { return; // Notify that we are gone - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); wait_for_delete_ = false; } diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc index 4200984..21ed753 100644 --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_unittest.cc @@ -120,10 +120,10 @@ class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness { }; SafeBrowsingBlockingPageTest() - : ui_thread_(BrowserThread::UI, MessageLoop::current()), + : ui_thread_(BrowserThread::UI, base::MessageLoop::current()), file_user_blocking_thread_( - BrowserThread::FILE_USER_BLOCKING, MessageLoop::current()), - io_thread_(BrowserThread::IO, MessageLoop::current()) { + BrowserThread::FILE_USER_BLOCKING, base::MessageLoop::current()), + io_thread_(BrowserThread::IO, base::MessageLoop::current()) { ResetUserResponse(); // The safe browsing UI manager does not need a service for this test. ui_manager_ = new TestSafeBrowsingUIManager(NULL); @@ -196,14 +196,14 @@ class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness { SafeBrowsingBlockingPage* sb_interstitial) { sb_interstitial->interstitial_page_->Proceed(); // Proceed() posts a task to update the SafeBrowsingService::Client. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } static void DontProceedThroughInterstitial( SafeBrowsingBlockingPage* sb_interstitial) { sb_interstitial->interstitial_page_->DontProceed(); // DontProceed() posts a task to update the SafeBrowsingService::Client. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } void DontProceedThroughSubresourceInterstitial( @@ -212,7 +212,7 @@ class SafeBrowsingBlockingPageTest : public ChromeRenderViewHostTestHarness { // subresource interstitials. GoBack(false); // DontProceed() posts a task to update the SafeBrowsingService::Client. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } scoped_refptr<TestSafeBrowsingUIManager> ui_manager_; @@ -257,7 +257,7 @@ TEST_F(SafeBrowsingBlockingPageTest, MalwarePageDontProceed) { SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Simulate the user clicking "don't proceed". DontProceedThroughInterstitial(sb_interstitial); @@ -586,7 +586,7 @@ TEST_F(SafeBrowsingBlockingPageTest, ProceedThenDontProceed) { SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Simulate the user clicking "proceed" then "don't proceed" (before the // interstitial is shown). @@ -594,7 +594,7 @@ TEST_F(SafeBrowsingBlockingPageTest, ProceedThenDontProceed) { sb_interstitial->interstitial_page_->DontProceed(); // Proceed() and DontProceed() post a task to update the // SafeBrowsingService::Client. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // The interstitial should be gone. EXPECT_EQ(OK, user_response()); @@ -621,7 +621,7 @@ TEST_F(SafeBrowsingBlockingPageTest, MalwareReportsDisabled) { SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Simulate the user clicking "don't proceed". DontProceedThroughInterstitial(sb_interstitial); @@ -654,7 +654,7 @@ TEST_F(SafeBrowsingBlockingPageTest, MalwareReports) { SafeBrowsingBlockingPage* sb_interstitial = GetSafeBrowsingBlockingPage(); ASSERT_TRUE(sb_interstitial); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(profile->GetPrefs()->GetBoolean( prefs::kSafeBrowsingReportingEnabled)); diff --git a/chrome/browser/safe_browsing/safe_browsing_database.cc b/chrome/browser/safe_browsing/safe_browsing_database.cc index 3ed33ed..db81dc9 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database.cc @@ -438,7 +438,7 @@ void SafeBrowsingDatabase::RecordFailure(FailureType failure_type) { } SafeBrowsingDatabaseNew::SafeBrowsingDatabaseNew() - : creation_loop_(MessageLoop::current()), + : creation_loop_(base::MessageLoop::current()), browse_store_(new SafeBrowsingStoreFile), download_store_(NULL), csd_whitelist_store_(NULL), @@ -461,7 +461,7 @@ SafeBrowsingDatabaseNew::SafeBrowsingDatabaseNew( SafeBrowsingStore* download_whitelist_store, SafeBrowsingStore* extension_blacklist_store, SafeBrowsingStore* side_effect_free_whitelist_store) - : creation_loop_(MessageLoop::current()), + : creation_loop_(base::MessageLoop::current()), browse_store_(browse_store), download_store_(download_store), csd_whitelist_store_(csd_whitelist_store), @@ -474,11 +474,11 @@ SafeBrowsingDatabaseNew::SafeBrowsingDatabaseNew( } SafeBrowsingDatabaseNew::~SafeBrowsingDatabaseNew() { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); } void SafeBrowsingDatabaseNew::Init(const base::FilePath& filename_base) { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); // Ensure we haven't been run before. DCHECK(browse_filename_.empty()); DCHECK(download_filename_.empty()); @@ -598,7 +598,7 @@ void SafeBrowsingDatabaseNew::Init(const base::FilePath& filename_base) { } bool SafeBrowsingDatabaseNew::ResetDatabase() { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); // Delete files on disk. // TODO(shess): Hard to see where one might want to delete without a @@ -678,7 +678,7 @@ bool SafeBrowsingDatabaseNew::ContainsBrowseUrl( bool SafeBrowsingDatabaseNew::ContainsDownloadUrl( const std::vector<GURL>& urls, std::vector<SBPrefix>* prefix_hits) { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); // Ignore this check when download checking is not enabled. if (!download_store_.get()) @@ -694,7 +694,7 @@ bool SafeBrowsingDatabaseNew::ContainsDownloadUrl( bool SafeBrowsingDatabaseNew::ContainsDownloadHashPrefix( const SBPrefix& prefix) { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); // Ignore this check when download store is not available. if (!download_store_.get()) @@ -725,7 +725,7 @@ bool SafeBrowsingDatabaseNew::ContainsDownloadWhitelistedUrl(const GURL& url) { bool SafeBrowsingDatabaseNew::ContainsExtensionPrefixes( const std::vector<SBPrefix>& prefixes, std::vector<SBPrefix>* prefix_hits) { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); if (!extension_blacklist_store_) return false; @@ -786,7 +786,7 @@ bool SafeBrowsingDatabaseNew::ContainsWhitelistedHashes( // |entry| into the store. void SafeBrowsingDatabaseNew::InsertAdd(int chunk_id, SBPrefix host, const SBEntry* entry, int list_id) { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); SafeBrowsingStore* store = GetStore(list_id); if (!store) return; @@ -828,7 +828,7 @@ void SafeBrowsingDatabaseNew::InsertAdd(int chunk_id, SBPrefix host, void SafeBrowsingDatabaseNew::InsertAddChunks( const safe_browsing_util::ListType list_id, const SBChunkList& chunks) { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); SafeBrowsingStore* store = GetStore(list_id); if (!store) return; @@ -857,7 +857,7 @@ void SafeBrowsingDatabaseNew::InsertAddChunks( // |entry| into the store. void SafeBrowsingDatabaseNew::InsertSub(int chunk_id, SBPrefix host, const SBEntry* entry, int list_id) { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); SafeBrowsingStore* store = GetStore(list_id); if (!store) return; @@ -903,7 +903,7 @@ void SafeBrowsingDatabaseNew::InsertSub(int chunk_id, SBPrefix host, void SafeBrowsingDatabaseNew::InsertSubChunks( safe_browsing_util::ListType list_id, const SBChunkList& chunks) { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); SafeBrowsingStore* store = GetStore(list_id); if (!store) return; @@ -928,7 +928,7 @@ void SafeBrowsingDatabaseNew::InsertSubChunks( void SafeBrowsingDatabaseNew::InsertChunks(const std::string& list_name, const SBChunkList& chunks) { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); if (corruption_detected_ || chunks.empty()) return; @@ -957,7 +957,7 @@ void SafeBrowsingDatabaseNew::InsertChunks(const std::string& list_name, void SafeBrowsingDatabaseNew::DeleteChunks( const std::vector<SBChunkDelete>& chunk_deletes) { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); if (corruption_detected_ || chunk_deletes.empty()) return; @@ -1021,7 +1021,7 @@ void SafeBrowsingDatabaseNew::CacheHashResults( bool SafeBrowsingDatabaseNew::UpdateStarted( std::vector<SBListChunkRanges>* lists) { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); DCHECK(lists); // If |BeginUpdate()| fails, reset the database. @@ -1133,7 +1133,7 @@ bool SafeBrowsingDatabaseNew::UpdateStarted( } void SafeBrowsingDatabaseNew::UpdateFinished(bool update_succeeded) { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); // The update may have failed due to corrupt storage (for instance, // an excessive number of invalid add_chunks and sub_chunks). @@ -1461,7 +1461,7 @@ void SafeBrowsingDatabaseNew::HandleCorruptDatabase() { // reset once within the scope of a given task). if (!reset_factory_.HasWeakPtrs()) { RecordFailure(FAILURE_DATABASE_CORRUPT); - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&SafeBrowsingDatabaseNew::OnHandleCorruptDatabase, reset_factory_.GetWeakPtr())); } @@ -1477,7 +1477,7 @@ void SafeBrowsingDatabaseNew::OnHandleCorruptDatabase() { // TODO(shess): I'm not clear why this code doesn't have any // real error-handling. void SafeBrowsingDatabaseNew::LoadPrefixSet() { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); DCHECK(!browse_prefix_set_filename_.empty()); // If there is no database, the filter cannot be used. @@ -1503,7 +1503,7 @@ void SafeBrowsingDatabaseNew::LoadPrefixSet() { } bool SafeBrowsingDatabaseNew::Delete() { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); const bool r1 = browse_store_->Delete(); if (!r1) @@ -1552,7 +1552,7 @@ bool SafeBrowsingDatabaseNew::Delete() { } void SafeBrowsingDatabaseNew::WritePrefixSet() { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); if (!browse_prefix_set_.get()) return; @@ -1581,7 +1581,7 @@ void SafeBrowsingDatabaseNew::WhitelistEverything(SBWhitelist* whitelist) { void SafeBrowsingDatabaseNew::LoadWhitelist( const std::vector<SBAddFullHash>& full_hashes, SBWhitelist* whitelist) { - DCHECK_EQ(creation_loop_, MessageLoop::current()); + DCHECK_EQ(creation_loop_, base::MessageLoop::current()); if (full_hashes.size() > kMaxWhitelistSize) { WhitelistEverything(whitelist); return; diff --git a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc index dbe83b4..ca61644 100644 --- a/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_database_unittest.cc @@ -363,7 +363,7 @@ TEST_F(SafeBrowsingDatabaseTest, ListNameForBrowse) { TEST_F(SafeBrowsingDatabaseTest, ListNameForBrowseAndDownload) { database_.reset(); - MessageLoop loop(MessageLoop::TYPE_DEFAULT); + base::MessageLoop loop(base::MessageLoop::TYPE_DEFAULT); SafeBrowsingStoreFile* browse_store = new SafeBrowsingStoreFile(); SafeBrowsingStoreFile* download_store = new SafeBrowsingStoreFile(); SafeBrowsingStoreFile* csd_whitelist_store = new SafeBrowsingStoreFile(); @@ -1079,7 +1079,7 @@ TEST_F(SafeBrowsingDatabaseTest, DISABLED_FileCorruptionHandling) { // influence task-posting. Database specifically needs to the // file-backed. database_.reset(); - MessageLoop loop(MessageLoop::TYPE_DEFAULT); + base::MessageLoop loop(base::MessageLoop::TYPE_DEFAULT); SafeBrowsingStoreFile* store = new SafeBrowsingStoreFile(); database_.reset(new SafeBrowsingDatabaseNew(store, NULL, NULL, NULL, NULL, NULL)); @@ -1130,7 +1130,7 @@ TEST_F(SafeBrowsingDatabaseTest, DISABLED_FileCorruptionHandling) { // Flush through the corruption-handler task. VLOG(1) << "Expect failed check on: SafeBrowsing database reset"; - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } // Database file should not exist. @@ -1148,7 +1148,7 @@ TEST_F(SafeBrowsingDatabaseTest, DISABLED_FileCorruptionHandling) { // Checks database reading and writing. TEST_F(SafeBrowsingDatabaseTest, ContainsDownloadUrl) { database_.reset(); - MessageLoop loop(MessageLoop::TYPE_DEFAULT); + base::MessageLoop loop(base::MessageLoop::TYPE_DEFAULT); SafeBrowsingStoreFile* browse_store = new SafeBrowsingStoreFile(); SafeBrowsingStoreFile* download_store = new SafeBrowsingStoreFile(); SafeBrowsingStoreFile* csd_whitelist_store = new SafeBrowsingStoreFile(); @@ -1252,7 +1252,7 @@ TEST_F(SafeBrowsingDatabaseTest, ContainsDownloadUrl) { // Checks that the whitelists are handled properly. TEST_F(SafeBrowsingDatabaseTest, Whitelists) { database_.reset(); - MessageLoop loop(MessageLoop::TYPE_DEFAULT); + base::MessageLoop loop(base::MessageLoop::TYPE_DEFAULT); // We expect all calls to ContainsCsdWhitelistedUrl in particular to be made // from the IO thread. In general the whitelist lookups are thread-safe. content::TestBrowserThread io_thread(BrowserThread::IO, &loop); diff --git a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc index d4e5594..f043d7b 100644 --- a/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc +++ b/chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc @@ -597,7 +597,7 @@ class TestSBClient } void DownloadCheckDone() { - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } SBThreatType threat_type_; @@ -818,7 +818,7 @@ class SafeBrowsingServiceShutdownTest : public SafeBrowsingServiceTest { Profile::CreateStatus status) { if (status == Profile::CREATE_STATUS_INITIALIZED) { profile2_ = profile; - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } diff --git a/chrome/browser/safe_browsing/safe_browsing_test.cc b/chrome/browser/safe_browsing/safe_browsing_test.cc index 7fe39eb..78a225c 100644 --- a/chrome/browser/safe_browsing/safe_browsing_test.cc +++ b/chrome/browser/safe_browsing/safe_browsing_test.cc @@ -203,7 +203,7 @@ class SafeBrowsingServerTest : public InProcessBrowserTest { return is_update_scheduled_; } - MessageLoop* SafeBrowsingMessageLoop() { + base::MessageLoop* SafeBrowsingMessageLoop() { return database_manager()->safe_browsing_thread_->message_loop(); } @@ -350,7 +350,7 @@ class SafeBrowsingServerTestHelper // Checks status in SafeBrowsing Thread. void CheckIsDatabaseReady() { - EXPECT_EQ(MessageLoop::current(), + EXPECT_EQ(base::MessageLoop::current(), safe_browsing_test_->SafeBrowsingMessageLoop()); safe_browsing_test_->CheckIsDatabaseReady(); BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, @@ -422,7 +422,7 @@ class SafeBrowsingServerTestHelper // Stops UI loop after desired status is updated. void StopUILoop() { EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI)); - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } // Fetch a URL. If message_loop_started is true, starts the message loop diff --git a/chrome/browser/safe_browsing/two_phase_uploader_unittest.cc b/chrome/browser/safe_browsing/two_phase_uploader_unittest.cc index 596f95f4..8a58e2f 100644 --- a/chrome/browser/safe_browsing/two_phase_uploader_unittest.cc +++ b/chrome/browser/safe_browsing/two_phase_uploader_unittest.cc @@ -70,7 +70,7 @@ class TwoPhaseUploaderTest : public testing::Test { } protected: - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; content::TestBrowserThread db_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/search/iframe_source_unittest.cc b/chrome/browser/search/iframe_source_unittest.cc index 3e007ac..0091531 100644 --- a/chrome/browser/search/iframe_source_unittest.cc +++ b/chrome/browser/search/iframe_source_unittest.cc @@ -140,7 +140,7 @@ class IframeSourceTest : public testing::Test { response_ = data; } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; diff --git a/chrome/browser/search_engines/search_provider_install_data_unittest.cc b/chrome/browser/search_engines/search_provider_install_data_unittest.cc index 4911e95..c0ca6c4 100644 --- a/chrome/browser/search_engines/search_provider_install_data_unittest.cc +++ b/chrome/browser/search_engines/search_provider_install_data_unittest.cc @@ -64,7 +64,7 @@ class TestGetInstallState : const std::string& url); SearchProviderInstallData* install_data_; - MessageLoop* main_loop_; + base::MessageLoop* main_loop_; // A host which should be a search provider but not the default. std::string search_provider_host_; @@ -88,14 +88,14 @@ TestGetInstallState::TestGetInstallState( bool TestGetInstallState::RunTests() { passed_ = true; - main_loop_ = MessageLoop::current(); + main_loop_ = base::MessageLoop::current(); BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)->PostTask( FROM_HERE, base::Bind(&TestGetInstallState::StartTestOnIOThread, this)); // Run the current message loop. When the test is finished on the I/O thread, // it invokes Quit, which unblocks this. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); main_loop_ = NULL; // Let the testing code know what the result is. @@ -136,7 +136,7 @@ void TestGetInstallState::DoInstallStateTests() { } // All done. - main_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + main_loop_->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } void TestGetInstallState::VerifyInstallState( diff --git a/chrome/browser/search_engines/template_url_fetcher_unittest.cc b/chrome/browser/search_engines/template_url_fetcher_unittest.cc index 765660b..bfb6cdf 100644 --- a/chrome/browser/search_engines/template_url_fetcher_unittest.cc +++ b/chrome/browser/search_engines/template_url_fetcher_unittest.cc @@ -120,7 +120,7 @@ void TemplateURLFetcherTest::DestroyedCallback( TemplateURLFetcherTestCallbacks* callbacks) { callbacks_destroyed_++; if (waiting_for_download_) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void TemplateURLFetcherTest::ConfirmAddSearchProvider( @@ -156,7 +156,7 @@ void TemplateURLFetcherTest::StartDownload( void TemplateURLFetcherTest::WaitForDownloadToFinish() { ASSERT_FALSE(waiting_for_download_); waiting_for_download_ = true; - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); waiting_for_download_ = false; } diff --git a/chrome/browser/search_engines/template_url_scraper_unittest.cc b/chrome/browser/search_engines/template_url_scraper_unittest.cc index 999c525..6d9b011 100644 --- a/chrome/browser/search_engines/template_url_scraper_unittest.cc +++ b/chrome/browser/search_engines/template_url_scraper_unittest.cc @@ -39,7 +39,7 @@ class TemplateURLServiceLoader : public content::NotificationObserver { const content::NotificationDetails& details) { if (type == chrome::NOTIFICATION_TEMPLATE_URL_SERVICE_LOADED && content::Source<TemplateURLService>(source).ptr() == model_) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } diff --git a/chrome/browser/search_engines/template_url_service_test_util.cc b/chrome/browser/search_engines/template_url_service_test_util.cc index 5336300..34894ab 100644 --- a/chrome/browser/search_engines/template_url_service_test_util.cc +++ b/chrome/browser/search_engines/template_url_service_test_util.cc @@ -36,8 +36,8 @@ namespace { // requests. See note in BlockTillServiceProcessesRequests for details. // // Schedules a QuitClosure on the message loop it was created with. -void QuitCallback(MessageLoop* message_loop) { - message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); +void QuitCallback(base::MessageLoop* message_loop) { + message_loop->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } // Blocks the caller until thread has finished servicing all pending @@ -45,9 +45,11 @@ void QuitCallback(MessageLoop* message_loop) { static void WaitForThreadToProcessRequests(BrowserThread::ID identifier) { // Schedule a task on the thread that is processed after all // pending requests on the thread. - BrowserThread::PostTask(identifier, FROM_HERE, - base::Bind(&QuitCallback, MessageLoop::current())); - MessageLoop::current()->Run(); + BrowserThread::PostTask( + identifier, + FROM_HERE, + base::Bind(&QuitCallback, base::MessageLoop::current())); + base::MessageLoop::current()->Run(); } } // namespace @@ -135,8 +137,9 @@ void TemplateURLServiceTestUtil::TearDown() { BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); done.Wait(); - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); db_thread_.Stop(); UIThreadSearchTermsData::SetGoogleBaseURL(std::string()); diff --git a/chrome/browser/search_engines/template_url_service_test_util.h b/chrome/browser/search_engines/template_url_service_test_util.h index 80c3fe3..3b546e1 100644 --- a/chrome/browser/search_engines/template_url_service_test_util.h +++ b/chrome/browser/search_engines/template_url_service_test_util.h @@ -109,7 +109,7 @@ class TemplateURLServiceTestUtil : public TemplateURLServiceObserver { void PumpLoop(); private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; // Needed to make the DeleteOnUIThread trait of WebDataService work // properly. content::TestBrowserThread ui_thread_; diff --git a/chrome/browser/service/service_process_control.cc b/chrome/browser/service/service_process_control.cc index 72f61cd..70b0157 100644 --- a/chrome/browser/service/service_process_control.cc +++ b/chrome/browser/service/service_process_control.cc @@ -290,7 +290,7 @@ void ServiceProcessControl::Launcher::DoDetectLaunched() { // If the service process is not launched yet then check again in 2 seconds. const base::TimeDelta kDetectLaunchRetry = base::TimeDelta::FromSeconds(2); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&Launcher::DoDetectLaunched, this), kDetectLaunchRetry); } diff --git a/chrome/browser/service/service_process_control_browsertest.cc b/chrome/browser/service/service_process_control_browsertest.cc index 4c5bb8d..5922b46 100644 --- a/chrome/browser/service/service_process_control_browsertest.cc +++ b/chrome/browser/service/service_process_control_browsertest.cc @@ -55,7 +55,7 @@ class ServiceProcessControlBrowserTest void CloudPrintInfoCallback( const cloud_print::CloudPrintProxyInfo& proxy_info) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void Disconnect() { @@ -82,13 +82,15 @@ class ServiceProcessControlBrowserTest // Quit the current message. Post a QuitTask instead of just calling Quit() // because this can get invoked in the context of a Launch() call and we // may not be in Run() yet. - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); } void ProcessControlLaunchFailed() { ADD_FAILURE(); // Quit the current message. - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); } private: @@ -132,7 +134,8 @@ IN_PROC_BROWSER_TEST_F(ServiceProcessControlBrowserTest, LaunchTwice) { static void DecrementUntilZero(int* count) { (*count)--; if (!(*count)) - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); } // Invoke multiple Launch calls in succession and ensure that all the tasks @@ -144,7 +147,7 @@ IN_PROC_BROWSER_TEST_F(ServiceProcessControlBrowserTest, for (int i = 0; i < launch_count; i++) { // Launch the process asynchronously. process->Launch(base::Bind(&DecrementUntilZero, &launch_count), - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); } // Then run the message loop to keep things running. content::RunMessageLoop(); diff --git a/chrome/browser/sessions/base_session_service.cc b/chrome/browser/sessions/base_session_service.cc index 64c094c..afc75d0 100644 --- a/chrome/browser/sessions/base_session_service.cc +++ b/chrome/browser/sessions/base_session_service.cc @@ -116,8 +116,9 @@ void BaseSessionService::ScheduleCommand(SessionCommand* command) { void BaseSessionService::StartSaveTimer() { // Don't start a timer when testing (profile == NULL or // MessageLoop::current() is NULL). - if (MessageLoop::current() && profile() && !weak_factory_.HasWeakPtrs()) { - MessageLoop::current()->PostDelayedTask( + if (base::MessageLoop::current() && profile() && + !weak_factory_.HasWeakPtrs()) { + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&BaseSessionService::Save, weak_factory_.GetWeakPtr()), base::TimeDelta::FromMilliseconds(kSaveDelayMS)); diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc index 479338b..ee6c5e1 100644 --- a/chrome/browser/sessions/session_restore.cc +++ b/chrome/browser/sessions/session_restore.cc @@ -538,8 +538,9 @@ class SessionRestoreImpl : public content::NotificationObserver { if (synchronous_) { { - MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current()); - MessageLoop::current()->Run(); + base::MessageLoop::ScopedNestableTaskAllower allow( + base::MessageLoop::current()); + base::MessageLoop::current()->Run(); } Browser* browser = ProcessSessionWindows(&windows_, active_window_id_); delete this; @@ -716,7 +717,7 @@ class SessionRestoreImpl : public content::NotificationObserver { // NOTE: we must use DeleteLater here as most likely we're in a callback // from the history service which doesn't deal well with deleting the // object it is notifying. - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); // The delete may take a while and at this point we no longer care about // if the browser is deleted. Don't listen to anything. This avoid a @@ -750,7 +751,7 @@ class SessionRestoreImpl : public content::NotificationObserver { // See comment above windows_ as to why we don't process immediately. windows_.swap(windows.get()); active_window_id_ = active_window_id; - MessageLoop::current()->QuitNow(); + base::MessageLoop::current()->QuitNow(); return; } diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc index 274537f..bb28274 100644 --- a/chrome/browser/shell_integration_unittest.cc +++ b/chrome/browser/shell_integration_unittest.cc @@ -78,7 +78,7 @@ TEST(ShellIntegrationTest, GetExistingShortcutLocations) { base::FilePath kTemplateFilepath(kTemplateFilename); const char kNoDisplayDesktopFile[] = "[Desktop Entry]\nNoDisplay=true"; - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread file_thread(BrowserThread::FILE, &message_loop); // No existing shortcuts. @@ -192,7 +192,7 @@ TEST(ShellIntegrationTest, GetExistingShortcutContents) { const char kTestData1[] = "a magical testing string"; const char kTestData2[] = "a different testing string"; - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread file_thread(BrowserThread::FILE, &message_loop); // Test that it searches $XDG_DATA_HOME/applications. diff --git a/chrome/browser/signin/oauth2_token_service.cc b/chrome/browser/signin/oauth2_token_service.cc index abddb4e..aeacd41 100644 --- a/chrome/browser/signin/oauth2_token_service.cc +++ b/chrome/browser/signin/oauth2_token_service.cc @@ -213,7 +213,7 @@ void OAuth2TokenService::Fetcher::OnGetTokenSuccess( // be added when it calls back the waiting requests. oauth2_token_service_->OnFetchComplete(this); InformWaitingRequests(); - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } void OAuth2TokenService::Fetcher::OnGetTokenFailure( @@ -238,7 +238,7 @@ void OAuth2TokenService::Fetcher::OnGetTokenFailure( // added when it calls back the waiting requests. oauth2_token_service_->OnFetchComplete(this); InformWaitingRequests(); - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } // static @@ -324,7 +324,7 @@ scoped_ptr<OAuth2TokenService::Request> OAuth2TokenService::StartRequest( std::string refresh_token = GetRefreshToken(); if (refresh_token.empty()) { - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( &OAuth2TokenService::InformConsumer, request->AsWeakPtr(), GoogleServiceAuthError( @@ -360,7 +360,7 @@ scoped_ptr<OAuth2TokenService::Request> CHECK(HasCacheEntry(scopes)); const CacheEntry* cache_entry = GetCacheEntry(scopes); scoped_ptr<RequestImpl> request(new RequestImpl(consumer)); - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( &OAuth2TokenService::InformConsumer, request->AsWeakPtr(), GoogleServiceAuthError(GoogleServiceAuthError::NONE), diff --git a/chrome/browser/signin/profile_oauth2_token_service_request_unittest.cc b/chrome/browser/signin/profile_oauth2_token_service_request_unittest.cc index 3cbb7ea..fb3b07d 100644 --- a/chrome/browser/signin/profile_oauth2_token_service_request_unittest.cc +++ b/chrome/browser/signin/profile_oauth2_token_service_request_unittest.cc @@ -152,7 +152,7 @@ scoped_ptr<OAuth2TokenService::Request> GoogleServiceAuthError(GoogleServiceAuthError::SERVICE_UNAVAILABLE), std::string())); } - MessageLoop::current()->PostTask(FROM_HERE, base::Bind( + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( &MockProfileOAuth2TokenService::InformConsumer, request->AsWeakPtr())); return request.PassAs<OAuth2TokenService::Request>(); } @@ -167,7 +167,7 @@ class ProfileOAuth2TokenServiceRequestTest : public testing::Test { virtual void SetUp() OVERRIDE; protected: - MessageLoop ui_loop_; + base::MessageLoop ui_loop_; scoped_ptr<content::TestBrowserThread> ui_thread_; scoped_ptr<Profile> profile_; diff --git a/chrome/browser/signin/signin_manager_unittest.cc b/chrome/browser/signin/signin_manager_unittest.cc index b1b655a..83a360d 100644 --- a/chrome/browser/signin/signin_manager_unittest.cc +++ b/chrome/browser/signin/signin_manager_unittest.cc @@ -176,7 +176,7 @@ class SigninManagerTest : public TokenServiceTestHarness { BrowserThread::IO, FROM_HERE, base::Bind(&SigninManagerTest::NotifyUIOnComplete, base::Unretained(this))); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } void NotifyUIOnComplete () { @@ -187,7 +187,7 @@ class SigninManagerTest : public TokenServiceTestHarness { base::Unretained(this))); return; } - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void ExpectSignInWithCredentialsSuccess() { diff --git a/chrome/browser/signin/signin_names_io_thread_unittest.cc b/chrome/browser/signin/signin_names_io_thread_unittest.cc index 699b244..dfecc28 100644 --- a/chrome/browser/signin/signin_names_io_thread_unittest.cc +++ b/chrome/browser/signin/signin_names_io_thread_unittest.cc @@ -29,7 +29,7 @@ class SigninNamesOnIOThreadTest : public testing::Test { void SimulateSignout(const string16& email); void AddNewProfile(const string16& name, const string16& email); - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; TestingProfileManager testing_profile_manager_; diff --git a/chrome/browser/signin/token_service_unittest.cc b/chrome/browser/signin/token_service_unittest.cc index 528d7d1..bfe08ea 100644 --- a/chrome/browser/signin/token_service_unittest.cc +++ b/chrome/browser/signin/token_service_unittest.cc @@ -97,8 +97,9 @@ void TokenServiceTestHarness::TearDown() { BrowserThread::PostTask(BrowserThread::DB, FROM_HERE, base::Bind(&base::WaitableEvent::Signal, base::Unretained(&done))); done.Wait(); - MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::QuitClosure()); + base::MessageLoop::current()->Run(); db_thread_.Stop(); } diff --git a/chrome/browser/signin/token_service_unittest.h b/chrome/browser/signin/token_service_unittest.h index bc0d307..9730b2a 100644 --- a/chrome/browser/signin/token_service_unittest.h +++ b/chrome/browser/signin/token_service_unittest.h @@ -66,7 +66,7 @@ class TokenServiceTestHarness : public testing::Test { void WaitForDBLoadCompletion(); - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; // Mostly so DCHECKS pass. content::TestBrowserThread db_thread_; // WDS on here diff --git a/chrome/browser/speech/extension_api/tts_extension_apitest.cc b/chrome/browser/speech/extension_api/tts_extension_apitest.cc index e704f5d..dc4dc90 100644 --- a/chrome/browser/speech/extension_api/tts_extension_apitest.cc +++ b/chrome/browser/speech/extension_api/tts_extension_apitest.cc @@ -58,7 +58,7 @@ class MockTtsPlatformImpl : public TtsPlatformImpl { const std::string& lang, const VoiceData& voice, const UtteranceContinuousParameters& params) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind( &MockTtsPlatformImpl::SendEvent, ptr_factory_.GetWeakPtr(), @@ -73,7 +73,7 @@ class MockTtsPlatformImpl : public TtsPlatformImpl { const std::string& lang, const VoiceData& voice, const UtteranceContinuousParameters& params) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind( &MockTtsPlatformImpl::SendEvent, ptr_factory_.GetWeakPtr(), @@ -88,7 +88,7 @@ class MockTtsPlatformImpl : public TtsPlatformImpl { const UtteranceContinuousParameters& params) { for (int i = 0; i < static_cast<int>(utterance.size()); i++) { if (i == 0 || utterance[i - 1] == ' ') { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind( &MockTtsPlatformImpl::SendEvent, ptr_factory_.GetWeakPtr(), @@ -106,7 +106,7 @@ class MockTtsPlatformImpl : public TtsPlatformImpl { const std::string& message) { TtsController* controller = TtsController::GetInstance(); if (wait_for_non_empty_queue && controller->QueueSize() == 0) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind( &MockTtsPlatformImpl::SendEvent, ptr_factory_.GetWeakPtr(), diff --git a/chrome/browser/speech/speech_recognition_bubble.cc b/chrome/browser/speech/speech_recognition_bubble.cc index 2ab8657..d1f1546 100644 --- a/chrome/browser/speech/speech_recognition_bubble.cc +++ b/chrome/browser/speech/speech_recognition_bubble.cc @@ -177,7 +177,7 @@ void SpeechRecognitionBubbleBase::SetWarmUpMode() { void SpeechRecognitionBubbleBase::DoWarmingUpAnimationStep() { SetImage(g_images.Get().warm_up()[animation_step_]); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&SpeechRecognitionBubbleBase::DoWarmingUpAnimationStep, weak_factory_.GetWeakPtr()), @@ -206,7 +206,7 @@ void SpeechRecognitionBubbleBase::DoRecognizingAnimationStep() { SetImage(g_images.Get().spinner()[animation_step_]); if (++animation_step_ >= static_cast<int>(g_images.Get().spinner().size())) animation_step_ = 0; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&SpeechRecognitionBubbleBase::DoRecognizingAnimationStep, weak_factory_.GetWeakPtr()), diff --git a/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc b/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc index 2026cda..658fb94 100644 --- a/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc +++ b/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc @@ -34,7 +34,7 @@ class MockSpeechRecognitionBubble : public SpeechRecognitionBubbleBase { const gfx::Rect&) : SpeechRecognitionBubbleBase(web_contents) { VLOG(1) << "MockSpeechRecognitionBubble created"; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&InvokeDelegate, delegate)); } @@ -103,14 +103,14 @@ class SpeechRecognitionBubbleControllerTest } else if (button == SpeechRecognitionBubble::BUTTON_TRY_AGAIN) { try_again_clicked_ = true; } - message_loop()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + message_loop()->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } virtual void InfoBubbleFocusChanged(int session_id) OVERRIDE { VLOG(1) << "Received InfoBubbleFocusChanged"; EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::IO)); focus_changed_ = true; - message_loop()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + message_loop()->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } // testing::Test methods. @@ -142,8 +142,8 @@ class SpeechRecognitionBubbleControllerTest // Set up to activate the bubble soon after it gets created, since we test // events sent by the bubble and those are handled only when the bubble is // active. - MessageLoop::current()->PostTask(FROM_HERE, - base::Bind(&ActivateBubble)); + base::MessageLoop::current()->PostTask(FROM_HERE, + base::Bind(&ActivateBubble)); // The |web_contents| parameter would be NULL since the dummy session id // passed to CreateBubble would not have matched any active tab. So get a @@ -184,7 +184,7 @@ TEST_F(SpeechRecognitionBubbleControllerTest, TestFocusChanged) { MockSpeechRecognitionBubble::BUBBLE_TEST_FOCUS_CHANGED); controller_->CreateBubble(kBubbleSessionId, 1, 1, gfx::Rect(1, 1)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(focus_changed_); EXPECT_FALSE(cancel_clicked_); EXPECT_FALSE(try_again_clicked_); @@ -198,7 +198,7 @@ TEST_F(SpeechRecognitionBubbleControllerTest, TestRecognitionCancelled) { MockSpeechRecognitionBubble::BUBBLE_TEST_CLICK_CANCEL); controller_->CreateBubble(kBubbleSessionId, 1, 1, gfx::Rect(1, 1)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(cancel_clicked_); EXPECT_FALSE(try_again_clicked_); EXPECT_FALSE(focus_changed_); @@ -212,7 +212,7 @@ TEST_F(SpeechRecognitionBubbleControllerTest, TestTryAgainClicked) { MockSpeechRecognitionBubble::BUBBLE_TEST_CLICK_TRY_AGAIN); controller_->CreateBubble(kBubbleSessionId, 1, 1, gfx::Rect(1, 1)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_FALSE(cancel_clicked_); EXPECT_TRUE(try_again_clicked_); EXPECT_FALSE(focus_changed_); diff --git a/chrome/browser/spellchecker/feedback_sender.cc b/chrome/browser/spellchecker/feedback_sender.cc index c7cbdb8..a2673b9 100644 --- a/chrome/browser/spellchecker/feedback_sender.cc +++ b/chrome/browser/spellchecker/feedback_sender.cc @@ -257,7 +257,7 @@ void FeedbackSender::RequestDocumentMarkers() { for (std::vector<int>::const_iterator it = dead_renderers.begin(); it != dead_renderers.end(); ++it) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&FeedbackSender::OnReceiveDocumentMarkers, AsWeakPtr(), diff --git a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc index 59c6116..1d5b7cb 100644 --- a/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_custom_dictionary_unittest.cc @@ -75,7 +75,7 @@ class SpellcheckCustomDictionaryTest : public testing::Test { } virtual void TearDown() OVERRIDE { - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } // A wrapper around SpellcheckCustomDictionary::LoadDictionaryFile private @@ -112,7 +112,7 @@ class SpellcheckCustomDictionaryTest : public testing::Test { return dictionary.Apply(change); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc b/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc index c6eb968..e81b1c8 100644 --- a/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_host_metrics_unittest.cc @@ -19,7 +19,7 @@ using base::StatisticsRecorder; class SpellcheckHostMetricsTest : public testing::Test { public: - SpellcheckHostMetricsTest() : loop_(MessageLoop::TYPE_DEFAULT) { + SpellcheckHostMetricsTest() : loop_(base::MessageLoop::TYPE_DEFAULT) { } virtual void SetUp() OVERRIDE { @@ -31,8 +31,8 @@ class SpellcheckHostMetricsTest : public testing::Test { void RecordWordCountsForTesting() { metrics_->RecordWordCounts(); } private: - MessageLoop loop_; - scoped_ptr<SpellCheckHostMetrics> metrics_; + base::MessageLoop loop_; + scoped_ptr<SpellCheckHostMetrics> metrics_; }; TEST_F(SpellcheckHostMetricsTest, RecordEnabledStats) { diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc index 3e12941..0693b96 100644 --- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc +++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc @@ -182,7 +182,7 @@ void SpellcheckHunspellDictionary::Load() { spellcheck_mac::PlatformSupportsLanguage(language_)) { use_platform_spellchecker_ = true; spellcheck_mac::SetLanguage(language_); - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( &SpellcheckHunspellDictionary::InformListenersOfInitialization, weak_ptr_factory_.GetWeakPtr())); diff --git a/chrome/browser/spellchecker/spellcheck_message_filter_mac_browsertest.cc b/chrome/browser/spellchecker/spellcheck_message_filter_mac_browsertest.cc index 0a25eeb..28c71dd 100644 --- a/chrome/browser/spellchecker/spellcheck_message_filter_mac_browsertest.cc +++ b/chrome/browser/spellchecker/spellcheck_message_filter_mac_browsertest.cc @@ -18,18 +18,18 @@ // allows verification by the test case. class TestingSpellCheckMessageFilter : public SpellCheckMessageFilterMac { public: - explicit TestingSpellCheckMessageFilter(MessageLoopForUI* loop) + explicit TestingSpellCheckMessageFilter(base::MessageLoopForUI* loop) : SpellCheckMessageFilterMac(0), loop_(loop) { } virtual bool Send(IPC::Message* message) OVERRIDE { sent_messages_.push_back(message); - loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + loop_->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); return true; } ScopedVector<IPC::Message> sent_messages_; - MessageLoopForUI* loop_; + base::MessageLoopForUI* loop_; private: virtual ~TestingSpellCheckMessageFilter() {} @@ -41,7 +41,7 @@ typedef InProcessBrowserTest SpellCheckMessageFilterMacBrowserTest; IN_PROC_BROWSER_TEST_F(SpellCheckMessageFilterMacBrowserTest, SpellCheckReturnMessage) { scoped_refptr<TestingSpellCheckMessageFilter> target( - new TestingSpellCheckMessageFilter(MessageLoopForUI::current())); + new TestingSpellCheckMessageFilter(base::MessageLoopForUI::current())); SpellCheckHostMsg_RequestTextCheck to_be_received( 123, 456, UTF8ToUTF16("zz.")); @@ -49,7 +49,7 @@ IN_PROC_BROWSER_TEST_F(SpellCheckMessageFilterMacBrowserTest, target->OnMessageReceived(to_be_received, &handled); EXPECT_TRUE(handled); - MessageLoopForUI::current()->Run(); + base::MessageLoopForUI::current()->Run(); EXPECT_EQ(1U, target->sent_messages_.size()); int sent_identifier; diff --git a/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc b/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc index ec59957..ee7490a 100644 --- a/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_platform_mac_unittest.cc @@ -19,7 +19,7 @@ class SpellcheckMacTest: public testing::Test { : callback_(base::Bind(&SpellcheckMacTest::CompletionCallback, base::Unretained(this))), callback_finished_(false), - message_loop_(MessageLoop::TYPE_UI) {} + message_loop_(base::MessageLoop::TYPE_UI) {} void WaitForCallback() { content::RunMessageLoop(); @@ -31,8 +31,8 @@ class SpellcheckMacTest: public testing::Test { private: void QuitMessageLoop() { - CHECK(MessageLoop::current() == &message_loop_); - MessageLoop::current()->Quit(); + CHECK(base::MessageLoop::current() == &message_loop_); + base::MessageLoop::current()->Quit(); } void CompletionCallback(const std::vector<SpellCheckResult>& results) { @@ -43,7 +43,7 @@ class SpellcheckMacTest: public testing::Test { base::Unretained(this))); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; spellcheck_mac::ScopedEnglishLanguageForTest scoped_language_; }; diff --git a/chrome/browser/spellchecker/spellcheck_service_unittest.cc b/chrome/browser/spellchecker/spellcheck_service_unittest.cc index 9be0fe5..3189a0e 100644 --- a/chrome/browser/spellchecker/spellcheck_service_unittest.cc +++ b/chrome/browser/spellchecker/spellcheck_service_unittest.cc @@ -38,10 +38,10 @@ class SpellcheckServiceTest : public testing::Test { } virtual void TearDown() OVERRIDE { - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc index 9e5a17a..ea62264 100644 --- a/chrome/browser/ssl/ssl_browser_tests.cc +++ b/chrome/browser/ssl/ssl_browser_tests.cc @@ -82,7 +82,7 @@ class ProvisionalLoadWaiter : public content::WebContentsObserver { content::RenderViewHost* render_view_host) OVERRIDE { seen_ = true; if (waiting_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } private: @@ -191,9 +191,9 @@ class SSLUITest : public InProcessBrowserTest { break; // Wait a bit. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, - MessageLoop::QuitClosure(), + base::MessageLoop::QuitClosure(), base::TimeDelta::FromMilliseconds(timeout_ms)); content::RunMessageLoop(); } @@ -1157,8 +1157,10 @@ IN_PROC_BROWSER_TEST_F(SSLUITest, DISABLED_TestCloseTabWithUnsafePopup) { for (int i = 0; i < 10; i++) { if (IsShowingWebContentsModalDialog()) break; - MessageLoop::current()->PostDelayedTask( - FROM_HERE, MessageLoop::QuitClosure(), base::TimeDelta::FromSeconds(1)); + base::MessageLoop::current()->PostDelayedTask( + FROM_HERE, + base::MessageLoop::QuitClosure(), + base::TimeDelta::FromSeconds(1)); content::RunMessageLoop(); } ASSERT_TRUE(IsShowingWebContentsModalDialog()); diff --git a/chrome/browser/status_icons/desktop_notification_balloon.cc b/chrome/browser/status_icons/desktop_notification_balloon.cc index e5c8caa..5946418 100644 --- a/chrome/browser/status_icons/desktop_notification_balloon.cc +++ b/chrome/browser/status_icons/desktop_notification_balloon.cc @@ -39,7 +39,7 @@ class DummyNotificationDelegate : public NotificationDelegate { : id_(kNotificationPrefix + id) {} virtual void Display() OVERRIDE { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&CloseBalloon, id()), base::TimeDelta::FromSeconds(kTimeoutSeconds)); diff --git a/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm b/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm index 5add140..cd7f18f 100644 --- a/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm +++ b/chrome/browser/storage_monitor/image_capture_device_manager_unittest.mm @@ -276,7 +276,7 @@ class ImageCaptureDeviceManagerTest : public testing::Test { } protected: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; scoped_ptr<content::TestBrowserThread> ui_thread_; chrome::test::TestStorageMonitor monitor_; TestCameraListener listener_; diff --git a/chrome/browser/storage_monitor/media_storage_util_unittest.cc b/chrome/browser/storage_monitor/media_storage_util_unittest.cc index a378df1..90d2da0 100644 --- a/chrome/browser/storage_monitor/media_storage_util_unittest.cc +++ b/chrome/browser/storage_monitor/media_storage_util_unittest.cc @@ -73,17 +73,17 @@ class MediaStorageUtilTest : public testing::Test { static void PostQuitToUIThread() { BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); } static void WaitForFileThread() { BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, base::Bind(&PostQuitToUIThread)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; private: chrome::test::TestStorageMonitor monitor_; diff --git a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc b/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc index 2b60d5b..408fded 100644 --- a/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc +++ b/chrome/browser/storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc @@ -84,7 +84,7 @@ class TestMediaTransferProtocolDeviceObserverLinux class MediaTransferProtocolDeviceObserverLinuxTest : public testing::Test { public: MediaTransferProtocolDeviceObserverLinuxTest() - : message_loop_(MessageLoop::TYPE_IO), + : message_loop_(base::MessageLoop::TYPE_IO), file_thread_(content::BrowserThread::FILE, &message_loop_) {} virtual ~MediaTransferProtocolDeviceObserverLinuxTest() {} @@ -112,7 +112,7 @@ class MediaTransferProtocolDeviceObserverLinuxTest : public testing::Test { } private: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread file_thread_; chrome::test::TestStorageMonitor monitor_; diff --git a/chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc index 3b1372d..039cc52 100644 --- a/chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc +++ b/chrome/browser/storage_monitor/storage_monitor_chromeos_unittest.cc @@ -133,7 +133,7 @@ class StorageMonitorCrosTest : public testing::Test { return *mock_storage_observer_; } - MessageLoop ui_loop_; + base::MessageLoop ui_loop_; scoped_ptr<TestStorageMonitorCros> monitor_; @@ -243,14 +243,14 @@ base::FilePath StorageMonitorCrosTest::CreateMountPoint( // static void StorageMonitorCrosTest::PostQuitToUIThread() { BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, - MessageLoop::QuitClosure()); + base::MessageLoop::QuitClosure()); } // static void StorageMonitorCrosTest::WaitForFileThread() { BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, base::Bind(&PostQuitToUIThread)); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } void StorageMonitorCrosTest::EjectNotify( diff --git a/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc index 46a4aad..0287ade 100644 --- a/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc +++ b/chrome/browser/storage_monitor/storage_monitor_linux_unittest.cc @@ -122,7 +122,8 @@ std::string GetDeviceId(const std::string& device) { class TestStorageMonitorLinux : public StorageMonitorLinux { public: - TestStorageMonitorLinux(const base::FilePath& path, MessageLoop* message_loop) + TestStorageMonitorLinux(const base::FilePath& path, + base::MessageLoop* message_loop) : StorageMonitorLinux(path), message_loop_(message_loop) { SetMediaTransferProtocolManagerForTest( @@ -135,10 +136,10 @@ class TestStorageMonitorLinux : public StorageMonitorLinux { virtual void UpdateMtab( const MtabWatcherLinux::MountPointDeviceMap& new_mtab) OVERRIDE { StorageMonitorLinux::UpdateMtab(new_mtab); - message_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + message_loop_->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; DISALLOW_COPY_AND_ASSIGN(TestStorageMonitorLinux); }; @@ -160,7 +161,7 @@ class StorageMonitorLinuxTest : public testing::Test { }; StorageMonitorLinuxTest() - : message_loop_(MessageLoop::TYPE_IO), + : message_loop_(base::MessageLoop::TYPE_IO), ui_thread_(content::BrowserThread::UI, &message_loop_), file_thread_(content::BrowserThread::FILE, &message_loop_) { } @@ -304,7 +305,7 @@ class StorageMonitorLinuxTest : public testing::Test { } // The message loop and file thread to run tests on. - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm b/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm index 2427a93..45e549a 100644 --- a/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm +++ b/chrome/browser/storage_monitor/storage_monitor_mac_unittest.mm @@ -67,7 +67,7 @@ class StorageMonitorMacTest : public testing::Test { protected: // The message loop and file thread to run tests on. - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/storage_monitor/storage_monitor_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_unittest.cc index 1190960..63234b4 100644 --- a/chrome/browser/storage_monitor/storage_monitor_unittest.cc +++ b/chrome/browser/storage_monitor/storage_monitor_unittest.cc @@ -26,7 +26,7 @@ TEST(StorageMonitorTest, TestInitialize) { } TEST(StorageMonitorTest, DeviceAttachDetachNotifications) { - MessageLoop message_loop; + base::MessageLoop message_loop; const string16 kDeviceName = ASCIIToUTF16("media device"); const std::string kDeviceId1 = "1"; const std::string kDeviceId2 = "2"; @@ -73,14 +73,14 @@ TEST(StorageMonitorTest, DeviceAttachDetachNotifications) { } TEST(StorageMonitorTest, GetAttachedStorageEmpty) { - MessageLoop message_loop; + base::MessageLoop message_loop; test::TestStorageMonitor monitor; std::vector<StorageInfo> devices = monitor.GetAttachedStorage(); EXPECT_EQ(0U, devices.size()); } TEST(StorageMonitorTest, GetRemovableStorageAttachDetach) { - MessageLoop message_loop; + base::MessageLoop message_loop; test::TestStorageMonitor monitor; const std::string kDeviceId1 = "42"; const string16 kDeviceName1 = ASCIIToUTF16("test"); diff --git a/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc b/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc index 578f43e..a90dc44 100644 --- a/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc +++ b/chrome/browser/storage_monitor/storage_monitor_win_unittest.cc @@ -71,7 +71,7 @@ class StorageMonitorWinTest : public testing::Test { MockRemovableStorageObserver observer_; private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; }; diff --git a/chrome/browser/sync/about_sync_util_unittest.cc b/chrome/browser/sync/about_sync_util_unittest.cc index 02ca59b..342a1f2 100644 --- a/chrome/browser/sync/about_sync_util_unittest.cc +++ b/chrome/browser/sync/about_sync_util_unittest.cc @@ -19,7 +19,7 @@ namespace sync_ui_util { namespace { TEST(SyncUIUtilTest, ConstructAboutInformationWithUnrecoverableErrorTest) { - MessageLoopForUI message_loop; + base::MessageLoopForUI message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); scoped_ptr<Profile> profile( ProfileSyncServiceMock::MakeSignedInTestingProfile()); diff --git a/chrome/browser/sync/abstract_profile_sync_service_test.h b/chrome/browser/sync/abstract_profile_sync_service_test.h index 491e084..bf01250 100644 --- a/chrome/browser/sync/abstract_profile_sync_service_test.h +++ b/chrome/browser/sync/abstract_profile_sync_service_test.h @@ -52,7 +52,7 @@ class AbstractProfileSyncServiceTest : public testing::Test { content::BrowserContext* profile); protected: - MessageLoopForUI ui_loop_; + base::MessageLoopForUI ui_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/sync/backend_migrator.cc b/chrome/browser/sync/backend_migrator.cc index 2c0472a..5a0967f 100644 --- a/chrome/browser/sync/backend_migrator.cc +++ b/chrome/browser/sync/backend_migrator.cc @@ -115,7 +115,7 @@ void BackendMigrator::OnConfigureDone( // |manager_|'s methods aren't re-entrant, and we're notified from // them, so post a task to avoid problems. SDVLOG(1) << "Posting OnConfigureDoneImpl"; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&BackendMigrator::OnConfigureDoneImpl, weak_ptr_factory_.GetWeakPtr(), result)); diff --git a/chrome/browser/sync/backend_migrator_unittest.cc b/chrome/browser/sync/backend_migrator_unittest.cc index eea2589..9605154 100644 --- a/chrome/browser/sync/backend_migrator_unittest.cc +++ b/chrome/browser/sync/backend_migrator_unittest.cc @@ -101,7 +101,7 @@ class SyncBackendMigratorTest : public testing::Test { private: scoped_ptr<SyncSessionSnapshot> snap_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; syncer::ModelTypeSet preferred_types_; NiceMock<ProfileSyncServiceMock> service_; NiceMock<DataTypeManagerMock> manager_; diff --git a/chrome/browser/sync/glue/android_invalidator_bridge_proxy_unittest.cc b/chrome/browser/sync/glue/android_invalidator_bridge_proxy_unittest.cc index 5fc8ec2..d3b9011 100644 --- a/chrome/browser/sync/glue/android_invalidator_bridge_proxy_unittest.cc +++ b/chrome/browser/sync/glue/android_invalidator_bridge_proxy_unittest.cc @@ -58,7 +58,7 @@ class AndroidInvalidatorBridgeProxyTest : public testing::Test { ui_loop_.RunUntilIdle(); } - MessageLoop ui_loop_; + base::MessageLoop ui_loop_; content::TestBrowserThread ui_thread_; ::testing::NiceMock<ProfileMock> mock_profile_; AndroidInvalidatorBridge bridge_; diff --git a/chrome/browser/sync/glue/android_invalidator_bridge_unittest.cc b/chrome/browser/sync/glue/android_invalidator_bridge_unittest.cc index b1c1fc3..8298c2a 100644 --- a/chrome/browser/sync/glue/android_invalidator_bridge_unittest.cc +++ b/chrome/browser/sync/glue/android_invalidator_bridge_unittest.cc @@ -149,7 +149,7 @@ class AndroidInvalidatorBridgeTest : public testing::Test { run_loop.Run(); } - MessageLoop ui_loop_; + base::MessageLoop ui_loop_; content::TestBrowserThread ui_thread_; base::Thread sync_thread_; NiceMock<ProfileMock> mock_profile_; diff --git a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc index 6183101..d5b827e 100644 --- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc @@ -220,7 +220,7 @@ class SyncAutofillDataTypeControllerTest : public testing::Test { protected: base::WeakPtrFactory<SyncAutofillDataTypeControllerTest> weak_ptr_factory_; - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; diff --git a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc index 8504801..2703dbc0 100644 --- a/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc @@ -144,7 +144,7 @@ class SyncBookmarkDataTypeControllerTest : public testing::Test { base::Unretained(&start_callback_))); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_refptr<BookmarkDataTypeController> bookmark_dtc_; scoped_ptr<ProfileSyncComponentsFactoryMock> profile_sync_factory_; diff --git a/chrome/browser/sync/glue/bookmark_model_associator.cc b/chrome/browser/sync/glue/bookmark_model_associator.cc index fe443fe..febc8b4 100644 --- a/chrome/browser/sync/glue/bookmark_model_associator.cc +++ b/chrome/browser/sync/glue/bookmark_model_associator.cc @@ -645,7 +645,7 @@ void BookmarkModelAssociator::PostPersistAssociationsTask() { // No need to post a task if a task is already pending. if (weak_factory_.HasWeakPtrs()) return; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind( &BookmarkModelAssociator::PersistAssociations, diff --git a/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc b/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc index 895302db..e2174d1 100644 --- a/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc +++ b/chrome/browser/sync/glue/browser_thread_model_worker_unittest.cc @@ -58,7 +58,7 @@ class SyncBrowserThreadModelWorkerTest : public testing::Test { EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); timer_.Stop(); // Stop the failure timer so the test succeeds. BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, MessageLoop::QuitClosure()); + BrowserThread::IO, FROM_HERE, base::MessageLoop::QuitClosure()); did_do_work_ = true; return syncer::SYNCER_OK; } @@ -68,7 +68,7 @@ class SyncBrowserThreadModelWorkerTest : public testing::Test { void Timeout() { ADD_FAILURE() << "Timed out waiting for work to be done on the DB thread."; BrowserThread::PostTask( - BrowserThread::IO, FROM_HERE, MessageLoop::QuitClosure()); + BrowserThread::IO, FROM_HERE, base::MessageLoop::QuitClosure()); } protected: @@ -88,17 +88,17 @@ class SyncBrowserThreadModelWorkerTest : public testing::Test { OneShotTimer<SyncBrowserThreadModelWorkerTest> timer_; content::TestBrowserThread db_thread_; - MessageLoopForIO io_loop_; + base::MessageLoopForIO io_loop_; content::TestBrowserThread io_thread_; base::WeakPtrFactory<SyncBrowserThreadModelWorkerTest> weak_factory_; }; TEST_F(SyncBrowserThreadModelWorkerTest, DoesWorkOnDatabaseThread) { - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&SyncBrowserThreadModelWorkerTest::ScheduleWork, factory()->GetWeakPtr())); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_TRUE(did_do_work()); } diff --git a/chrome/browser/sync/glue/chrome_extensions_activity_monitor_unittest.cc b/chrome/browser/sync/glue/chrome_extensions_activity_monitor_unittest.cc index 27b3e91..799ff7d 100644 --- a/chrome/browser/sync/glue/chrome_extensions_activity_monitor_unittest.cc +++ b/chrome/browser/sync/glue/chrome_extensions_activity_monitor_unittest.cc @@ -70,7 +70,7 @@ class SyncChromeExtensionsActivityMonitorTest : public testing::Test { virtual ~SyncChromeExtensionsActivityMonitorTest() {} private: - MessageLoop ui_loop_; + base::MessageLoop ui_loop_; content::TestBrowserThread ui_thread_; protected: diff --git a/chrome/browser/sync/glue/data_type_manager_impl.cc b/chrome/browser/sync/glue/data_type_manager_impl.cc index a487866..5675c01 100644 --- a/chrome/browser/sync/glue/data_type_manager_impl.cc +++ b/chrome/browser/sync/glue/data_type_manager_impl.cc @@ -167,7 +167,7 @@ bool DataTypeManagerImpl::ProcessReconfigure() { // Unwind the stack before executing configure. The method configure and its // callees are not re-entrant. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&DataTypeManagerImpl::ConfigureImpl, weak_ptr_factory_.GetWeakPtr(), diff --git a/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc b/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc index 44b80cb..7477b08 100644 --- a/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc +++ b/chrome/browser/sync/glue/data_type_manager_impl_unittest.cc @@ -144,7 +144,7 @@ class SyncDataTypeManagerImplTest : public testing::Test { static_cast<FakeDataTypeController*>(it->second.get())); } - MessageLoopForUI ui_loop_; + base::MessageLoopForUI ui_loop_; content::TestBrowserThread ui_thread_; DataTypeController::TypeMap controllers_; FakeBackendDataTypeConfigurer configurer_; diff --git a/chrome/browser/sync/glue/favicon_cache.cc b/chrome/browser/sync/glue/favicon_cache.cc index c94528e..3193791 100644 --- a/chrome/browser/sync/glue/favicon_cache.cc +++ b/chrome/browser/sync/glue/favicon_cache.cc @@ -538,7 +538,7 @@ void FaviconCache::OnReceivedSyncFavicon(const GURL& page_url, // Post a task to do the actual association because this method may have been // called while in a transaction. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&FaviconCache::OnReceivedSyncFaviconImpl, weak_ptr_factory_.GetWeakPtr(), diff --git a/chrome/browser/sync/glue/favicon_cache_unittest.cc b/chrome/browser/sync/glue/favicon_cache_unittest.cc index ad3a91a..bf1d26c 100644 --- a/chrome/browser/sync/glue/favicon_cache_unittest.cc +++ b/chrome/browser/sync/glue/favicon_cache_unittest.cc @@ -295,7 +295,7 @@ class SyncFaviconCacheTest : public testing::Test { int64 last_visit_time_ms); private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; FaviconCache cache_; // Our dummy ChangeProcessor used to inspect changes pushed to Sync. diff --git a/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc b/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc index f78d5e4..981e848 100644 --- a/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc @@ -151,7 +151,7 @@ class SyncFrontendDataTypeControllerTest : public testing::Test { message_loop_.RunUntilIdle(); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; scoped_refptr<FrontendDataTypeControllerFake> frontend_dtc_; scoped_ptr<ProfileSyncComponentsFactoryMock> profile_sync_factory_; diff --git a/chrome/browser/sync/glue/model_association_manager_unittest.cc b/chrome/browser/sync/glue/model_association_manager_unittest.cc index 8d38176..4f5a43f 100644 --- a/chrome/browser/sync/glue/model_association_manager_unittest.cc +++ b/chrome/browser/sync/glue/model_association_manager_unittest.cc @@ -60,7 +60,7 @@ class SyncModelAssociationManagerTest : public testing::Test { } protected: - MessageLoopForUI ui_loop_; + base::MessageLoopForUI ui_loop_; content::TestBrowserThread ui_thread_; MockModelAssociationResultProcessor result_processor_; DataTypeController::TypeMap controllers_; diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc b/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc index f9a8d50..91cd8bb 100644 --- a/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc @@ -190,7 +190,7 @@ class SyncNonFrontendDataTypeControllerTest : public testing::Test { if (!done.IsSignaled()) { ADD_FAILURE() << "Timed out waiting for DB thread to finish."; } - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } void Start() { @@ -202,7 +202,7 @@ class SyncNonFrontendDataTypeControllerTest : public testing::Test { base::Unretained(&start_callback_))); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; scoped_refptr<NonFrontendDataTypeControllerFake> non_frontend_dtc_; diff --git a/chrome/browser/sync/glue/non_ui_data_type_controller_unittest.cc b/chrome/browser/sync/glue/non_ui_data_type_controller_unittest.cc index fa68314..4be7a1b 100644 --- a/chrome/browser/sync/glue/non_ui_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/non_ui_data_type_controller_unittest.cc @@ -184,7 +184,7 @@ class SyncNonUIDataTypeControllerTest : public testing::Test { if (!done.IsSignaled()) { ADD_FAILURE() << "Timed out waiting for DB thread to finish."; } - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } protected: @@ -241,7 +241,7 @@ class SyncNonUIDataTypeControllerTest : public testing::Test { done->Signal(); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; ProfileMock profile_; diff --git a/chrome/browser/sync/glue/password_change_processor.cc b/chrome/browser/sync/glue/password_change_processor.cc index 2ebe5c1..23c7452 100644 --- a/chrome/browser/sync/glue/password_change_processor.cc +++ b/chrome/browser/sync/glue/password_change_processor.cc @@ -36,7 +36,7 @@ PasswordChangeProcessor::PasswordChangeProcessor( : ChangeProcessor(error_handler), model_associator_(model_associator), password_store_(password_store), - expected_loop_(MessageLoop::current()) { + expected_loop_(base::MessageLoop::current()) { DCHECK(model_associator); DCHECK(error_handler); #if defined(OS_MACOSX) @@ -47,14 +47,14 @@ PasswordChangeProcessor::PasswordChangeProcessor( } PasswordChangeProcessor::~PasswordChangeProcessor() { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); } void PasswordChangeProcessor::Observe( int type, const content::NotificationSource& source, const content::NotificationDetails& details) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); DCHECK(chrome::NOTIFICATION_LOGINS_CHANGED == type); syncer::WriteTransaction trans(FROM_HERE, share_handle()); @@ -162,7 +162,7 @@ void PasswordChangeProcessor::ApplyChangesFromSyncModel( const syncer::BaseTransaction* trans, int64 model_version, const syncer::ImmutableChangeRecordList& changes) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); syncer::ReadNode password_root(trans); if (password_root.InitByTagLookup(kPasswordTag) != @@ -220,7 +220,7 @@ void PasswordChangeProcessor::ApplyChangesFromSyncModel( } void PasswordChangeProcessor::CommitChangesFromSyncModel() { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); ScopedStopObserving<PasswordChangeProcessor> stop_observing(this); syncer::SyncError error = model_associator_->WriteToPasswordStore( @@ -239,19 +239,19 @@ void PasswordChangeProcessor::CommitChangesFromSyncModel() { } void PasswordChangeProcessor::StartImpl(Profile* profile) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); StartObserving(); } void PasswordChangeProcessor::StartObserving() { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); notification_registrar_.Add(this, chrome::NOTIFICATION_LOGINS_CHANGED, content::Source<PasswordStore>(password_store_)); } void PasswordChangeProcessor::StopObserving() { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); notification_registrar_.Remove( this, chrome::NOTIFICATION_LOGINS_CHANGED, diff --git a/chrome/browser/sync/glue/password_model_associator.cc b/chrome/browser/sync/glue/password_model_associator.cc index 33e0e2f..99bc3ec 100644 --- a/chrome/browser/sync/glue/password_model_associator.cc +++ b/chrome/browser/sync/glue/password_model_associator.cc @@ -34,7 +34,7 @@ PasswordModelAssociator::PasswordModelAssociator( password_store_(password_store), password_node_id_(syncer::kInvalidId), abort_association_pending_(false), - expected_loop_(MessageLoop::current()), + expected_loop_(base::MessageLoop::current()), error_handler_(error_handler) { DCHECK(sync_service_); #if defined(OS_MACOSX) @@ -50,7 +50,7 @@ syncer::SyncError PasswordModelAssociator::AssociateModels( syncer::SyncMergeResult* local_merge_result, syncer::SyncMergeResult* syncer_merge_result) { syncer::SyncError error; - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); { base::AutoLock lock(abort_association_pending_lock_); abort_association_pending_ = false; @@ -181,7 +181,7 @@ syncer::SyncError PasswordModelAssociator::AssociateModels( bool PasswordModelAssociator::DeleteAllNodes( syncer::WriteTransaction* trans) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); for (PasswordToSyncIdMap::iterator node_id = id_map_.begin(); node_id != id_map_.end(); ++node_id) { syncer::WriteNode sync_node(trans); @@ -266,7 +266,7 @@ int64 PasswordModelAssociator::GetSyncIdFromChromeId( void PasswordModelAssociator::Associate( const std::string* password, int64 sync_id) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); DCHECK_NE(syncer::kInvalidId, sync_id); DCHECK(id_map_.find(*password) == id_map_.end()); DCHECK(id_map_inverse_.find(sync_id) == id_map_inverse_.end()); @@ -275,7 +275,7 @@ void PasswordModelAssociator::Associate( } void PasswordModelAssociator::Disassociate(int64 sync_id) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); SyncIdToPasswordMap::iterator iter = id_map_inverse_.find(sync_id); if (iter == id_map_inverse_.end()) return; diff --git a/chrome/browser/sync/glue/session_model_associator.cc b/chrome/browser/sync/glue/session_model_associator.cc index 2bed2ae..e65c4bd 100644 --- a/chrome/browser/sync/glue/session_model_associator.cc +++ b/chrome/browser/sync/glue/session_model_associator.cc @@ -1120,10 +1120,10 @@ bool SessionModelAssociator::ShouldSyncTab(const SyncedTabDelegate& tab) const { void SessionModelAssociator::QuitLoopForSubtleTesting() { if (waiting_for_change_) { - DVLOG(1) << "Quitting MessageLoop for test."; + DVLOG(1) << "Quitting base::MessageLoop for test."; waiting_for_change_ = false; test_weak_factory_.InvalidateWeakPtrs(); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } @@ -1136,7 +1136,7 @@ void SessionModelAssociator::BlockUntilLocalChangeForTest( if (test_weak_factory_.HasWeakPtrs()) return; waiting_for_change_ = true; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&SessionModelAssociator::QuitLoopForSubtleTesting, test_weak_factory_.GetWeakPtr()), diff --git a/chrome/browser/sync/glue/session_model_associator_unittest.cc b/chrome/browser/sync/glue/session_model_associator_unittest.cc index c272480..12ccd3c 100644 --- a/chrome/browser/sync/glue/session_model_associator_unittest.cc +++ b/chrome/browser/sync/glue/session_model_associator_unittest.cc @@ -79,7 +79,7 @@ class SyncSessionModelAssociatorTest : public testing::Test { } private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; NiceMock<ProfileMock> profile_; NiceMock<ProfileSyncServiceMock> sync_service_; diff --git a/chrome/browser/sync/glue/shared_change_processor_unittest.cc b/chrome/browser/sync/glue/shared_change_processor_unittest.cc index 755990c..795d738 100644 --- a/chrome/browser/sync/glue/shared_change_processor_unittest.cc +++ b/chrome/browser/sync/glue/shared_change_processor_unittest.cc @@ -112,7 +112,7 @@ class SyncSharedChangeProcessorTest : public testing::Test { base::WeakPtr<syncer::SyncMergeResult>())); } - MessageLoopForUI ui_loop_; + base::MessageLoopForUI ui_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; diff --git a/chrome/browser/sync/glue/sync_backend_host.cc b/chrome/browser/sync/glue/sync_backend_host.cc index 8820876..15e7967 100644 --- a/chrome/browser/sync/glue/sync_backend_host.cc +++ b/chrome/browser/sync/glue/sync_backend_host.cc @@ -272,7 +272,7 @@ class SyncBackendHost::Core // The loop where all the sync backend operations happen. // Non-NULL only between calls to DoInitialize() and DoShutdown(). - MessageLoop* sync_loop_; + base::MessageLoop* sync_loop_; // Our parent's registrar (not owned). Non-NULL only between // calls to DoInitialize() and DoShutdown(). @@ -353,7 +353,7 @@ SyncBackendHost::SyncBackendHost( const base::WeakPtr<invalidation::InvalidatorStorage>& invalidator_storage) : weak_ptr_factory_(this), sync_thread_("Chrome_SyncThread"), - frontend_loop_(MessageLoop::current()), + frontend_loop_(base::MessageLoop::current()), profile_(profile), name_(name), core_(new Core(name, profile_->GetPath().Append(kSyncDataFolderName), @@ -372,7 +372,7 @@ SyncBackendHost::SyncBackendHost( SyncBackendHost::SyncBackendHost(Profile* profile) : weak_ptr_factory_(this), sync_thread_("Chrome_SyncThread"), - frontend_loop_(MessageLoop::current()), + frontend_loop_(base::MessageLoop::current()), profile_(profile), name_("Unknown"), initialization_state_(NOT_ATTEMPTED), @@ -478,7 +478,7 @@ void SyncBackendHost::UpdateCredentials(const SyncCredentials& credentials) { void SyncBackendHost::UpdateRegisteredInvalidationIds( const syncer::ObjectIdSet& ids) { - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); DCHECK(sync_thread_.IsRunning()); sync_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(&SyncBackendHost::Core::DoUpdateRegisteredInvalidationIds, @@ -487,7 +487,7 @@ void SyncBackendHost::UpdateRegisteredInvalidationIds( void SyncBackendHost::AcknowledgeInvalidation( const invalidation::ObjectId& id, const syncer::AckHandle& ack_handle) { - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); DCHECK(sync_thread_.IsRunning()); sync_thread_.message_loop()->PostTask(FROM_HERE, base::Bind(&SyncBackendHost::Core::DoAcknowledgeInvalidation, @@ -518,7 +518,7 @@ void SyncBackendHost::SetEncryptionPassphrase(const std::string& passphrase, DCHECK(!passphrase.empty()); // This should only be called by the frontend. - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); // SetEncryptionPassphrase should never be called if we are currently // encrypted with an explicit passphrase. @@ -542,7 +542,7 @@ bool SyncBackendHost::SetDecryptionPassphrase(const std::string& passphrase) { DCHECK(!passphrase.empty()); // This should only be called by the frontend. - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); // This should only be called when we have cached pending keys. DCHECK(cached_pending_keys_.has_blob()); @@ -591,7 +591,7 @@ void SyncBackendHost::StopSyncManagerForShutdown( } void SyncBackendHost::StopSyncingForShutdown() { - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); // Immediately stop sending messages to the frontend. frontend_ = NULL; @@ -848,7 +848,7 @@ void SyncBackendHost::FinishConfigureDataTypesOnFrontendLoop( syncer::ModelTypeSet)>& ready_task) { if (!frontend_) return; - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); if (!ready_task.is_null()) ready_task.Run(succeeded_configuration_types, failed_configuration_types); } @@ -906,7 +906,7 @@ void SyncBackendHost::Observe( } SyncBackendHost::DoInitializeOptions::DoInitializeOptions( - MessageLoop* sync_loop, + base::MessageLoop* sync_loop, SyncBackendRegistrar* registrar, const syncer::ModelSafeRoutingInfo& routing_info, const std::vector<syncer::ModelSafeWorker*>& workers, @@ -970,7 +970,7 @@ void SyncBackendHost::Core::OnSyncCycleCompleted( const SyncSessionSnapshot& snapshot) { if (!sync_loop_) return; - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); host_.Call( FROM_HERE, @@ -1000,7 +1000,7 @@ void SyncBackendHost::Core::DoDownloadControlTypes( } void SyncBackendHost::Core::DoRefreshTypes(syncer::ModelTypeSet types) { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); sync_manager_->RefreshTypes(types); } @@ -1015,7 +1015,7 @@ void SyncBackendHost::Core::OnInitializationComplete( debug_info_listener, bool success, const syncer::ModelTypeSet restored_types) { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); if (!success) { DoDestroySyncManager(); @@ -1047,7 +1047,7 @@ void SyncBackendHost::Core::OnConnectionStatusChange( syncer::ConnectionStatus status) { if (!sync_loop_) return; - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); host_.Call( FROM_HERE, &SyncBackendHost::HandleConnectionStatusChangeOnFrontendLoop, status); @@ -1058,7 +1058,7 @@ void SyncBackendHost::Core::OnPassphraseRequired( const sync_pb::EncryptedData& pending_keys) { if (!sync_loop_) return; - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); host_.Call( FROM_HERE, &SyncBackendHost::NotifyPassphraseRequired, reason, pending_keys); @@ -1067,7 +1067,7 @@ void SyncBackendHost::Core::OnPassphraseRequired( void SyncBackendHost::Core::OnPassphraseAccepted() { if (!sync_loop_) return; - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); host_.Call( FROM_HERE, &SyncBackendHost::NotifyPassphraseAccepted); @@ -1078,7 +1078,7 @@ void SyncBackendHost::Core::OnBootstrapTokenUpdated( syncer::BootstrapTokenType type) { if (!sync_loop_) return; - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); host_.Call(FROM_HERE, &SyncBackendHost::PersistEncryptionBootstrapToken, bootstrap_token, @@ -1088,7 +1088,7 @@ void SyncBackendHost::Core::OnBootstrapTokenUpdated( void SyncBackendHost::Core::OnStopSyncingPermanently() { if (!sync_loop_) return; - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); host_.Call( FROM_HERE, &SyncBackendHost::HandleStopSyncingPermanentlyOnFrontendLoop); @@ -1097,7 +1097,7 @@ void SyncBackendHost::Core::OnStopSyncingPermanently() { void SyncBackendHost::Core::OnUpdatedToken(const std::string& token) { if (!sync_loop_) return; - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); host_.Call( FROM_HERE, &SyncBackendHost::NotifyUpdatedToken, token); @@ -1108,7 +1108,7 @@ void SyncBackendHost::Core::OnEncryptedTypesChanged( bool encrypt_everything) { if (!sync_loop_) return; - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); // NOTE: We're in a transaction. host_.Call( FROM_HERE, @@ -1119,7 +1119,7 @@ void SyncBackendHost::Core::OnEncryptedTypesChanged( void SyncBackendHost::Core::OnEncryptionComplete() { if (!sync_loop_) return; - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); // NOTE: We're in a transaction. host_.Call( FROM_HERE, @@ -1143,7 +1143,7 @@ void SyncBackendHost::Core::OnActionableError( const syncer::SyncProtocolError& sync_error) { if (!sync_loop_) return; - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); host_.Call( FROM_HERE, &SyncBackendHost::HandleActionableErrorEventOnFrontendLoop, @@ -1154,7 +1154,7 @@ void SyncBackendHost::Core::OnInvalidatorStateChange( syncer::InvalidatorState state) { if (!sync_loop_) return; - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); host_.Call(FROM_HERE, &SyncBackendHost::HandleInvalidatorStateChangeOnFrontendLoop, state); @@ -1164,7 +1164,7 @@ void SyncBackendHost::Core::OnIncomingInvalidation( const syncer::ObjectIdInvalidationMap& invalidation_map) { if (!sync_loop_) return; - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); host_.Call(FROM_HERE, &SyncBackendHost::HandleIncomingInvalidationOnFrontendLoop, invalidation_map); @@ -1244,7 +1244,7 @@ void SyncBackendHost::Core::DoInitialize(const DoInitializeOptions& options) { void SyncBackendHost::Core::DoUpdateCredentials( const SyncCredentials& credentials) { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); // UpdateCredentials can be called during backend initialization, possibly // when backend initialization has failed but hasn't notified the UI thread // yet. In that case, the sync manager may have been destroyed on the sync @@ -1256,7 +1256,7 @@ void SyncBackendHost::Core::DoUpdateCredentials( void SyncBackendHost::Core::DoUpdateRegisteredInvalidationIds( const syncer::ObjectIdSet& ids) { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); // |sync_manager_| may end up being NULL here in tests (in // synchronous initialization mode) since this is called during // shutdown. @@ -1269,7 +1269,7 @@ void SyncBackendHost::Core::DoUpdateRegisteredInvalidationIds( void SyncBackendHost::Core::DoAcknowledgeInvalidation( const invalidation::ObjectId& id, const syncer::AckHandle& ack_handle) { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); // |sync_manager_| may end up being NULL here in tests (in // synchronous initialization mode). // @@ -1281,20 +1281,20 @@ void SyncBackendHost::Core::DoAcknowledgeInvalidation( void SyncBackendHost::Core::DoStartSyncing( const syncer::ModelSafeRoutingInfo& routing_info) { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); sync_manager_->StartSyncingNormally(routing_info); } void SyncBackendHost::Core::DoSetEncryptionPassphrase( const std::string& passphrase, bool is_explicit) { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); sync_manager_->GetEncryptionHandler()->SetEncryptionPassphrase( passphrase, is_explicit); } void SyncBackendHost::Core::DoInitialProcessControlTypes() { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); DVLOG(1) << "Initilalizing Control Types"; @@ -1347,13 +1347,13 @@ void SyncBackendHost::Core::DoFinishInitialProcessControlTypes() { void SyncBackendHost::Core::DoSetDecryptionPassphrase( const std::string& passphrase) { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); sync_manager_->GetEncryptionHandler()->SetDecryptionPassphrase( passphrase); } void SyncBackendHost::Core::DoEnableEncryptEverything() { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); sync_manager_->GetEncryptionHandler()->EnableEncryptEverything(); } @@ -1367,7 +1367,7 @@ void SyncBackendHost::Core::DoStopSyncManagerForShutdown( } void SyncBackendHost::Core::DoShutdown(bool sync_disabled) { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); // It's safe to do this even if the type was never activated. registrar_->DeactivateDataType(syncer::DEVICE_INFO); synced_device_tracker_.reset(); @@ -1385,7 +1385,7 @@ void SyncBackendHost::Core::DoShutdown(bool sync_disabled) { } void SyncBackendHost::Core::DoDestroySyncManager() { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); if (sync_manager_) { save_changes_timer_.reset(); if (registered_as_invalidation_handler_) { @@ -1406,7 +1406,7 @@ void SyncBackendHost::Core::DoConfigureSyncer( const base::Callback<void(syncer::ModelTypeSet, syncer::ModelTypeSet)>& ready_task, const base::Closure& retry_callback) { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); sync_manager_->ConfigureSyncer( reason, types_to_config, @@ -1425,7 +1425,7 @@ void SyncBackendHost::Core::DoFinishConfigureDataTypes( syncer::ModelTypeSet types_to_config, const base::Callback<void(syncer::ModelTypeSet, syncer::ModelTypeSet)>& ready_task) { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); // Update the enabled types for the bridge and sync manager. syncer::ModelSafeRoutingInfo routing_info; @@ -1446,14 +1446,14 @@ void SyncBackendHost::Core::DoFinishConfigureDataTypes( void SyncBackendHost::Core::DoRetryConfiguration( const base::Closure& retry_callback) { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); host_.Call(FROM_HERE, &SyncBackendHost::RetryConfigurationOnFrontendLoop, retry_callback); } void SyncBackendHost::Core::DeleteSyncDataFolder() { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); if (file_util::DirectoryExists(sync_data_folder_path_)) { if (!file_util::Delete(sync_data_folder_path_, true)) SLOG(DFATAL) << "Could not delete the Sync Data folder."; @@ -1464,7 +1464,7 @@ void SyncBackendHost::Core::StartSavingChanges() { // We may already be shut down. if (!sync_loop_) return; - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); DCHECK(!save_changes_timer_.get()); save_changes_timer_.reset(new base::RepeatingTimer<Core>()); save_changes_timer_->Start(FROM_HERE, @@ -1473,7 +1473,7 @@ void SyncBackendHost::Core::StartSavingChanges() { } void SyncBackendHost::Core::SaveChanges() { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); sync_manager_->SaveChanges(); } @@ -1485,7 +1485,7 @@ void SyncBackendHost::AddExperimentalTypes() { } void SyncBackendHost::HandleControlTypesDownloadRetry() { - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); if (!frontend_) return; @@ -1498,7 +1498,7 @@ void SyncBackendHost::HandleInitializationCompletedOnFrontendLoop( if (!frontend_) return; - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); if (!success) { js_backend_.Reset(); initialization_state_ = NOT_INITIALIZED; @@ -1525,7 +1525,7 @@ void SyncBackendHost::HandleSyncCycleCompletedOnFrontendLoop( const SyncSessionSnapshot& snapshot) { if (!frontend_) return; - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); last_snapshot_ = snapshot; @@ -1566,7 +1566,7 @@ void SyncBackendHost::HandleActionableErrorEventOnFrontendLoop( const syncer::SyncProtocolError& sync_error) { if (!frontend_) return; - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); frontend_->OnActionableError(sync_error); } @@ -1574,7 +1574,7 @@ void SyncBackendHost::HandleInvalidatorStateChangeOnFrontendLoop( syncer::InvalidatorState state) { if (!frontend_) return; - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); frontend_->OnInvalidatorStateChange(state); } @@ -1582,7 +1582,7 @@ void SyncBackendHost::HandleIncomingInvalidationOnFrontendLoop( const syncer::ObjectIdInvalidationMap& invalidation_map) { if (!frontend_) return; - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); frontend_->OnIncomingInvalidation(invalidation_map); } @@ -1604,7 +1604,7 @@ void SyncBackendHost::NotifyPassphraseRequired( if (!frontend_) return; - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); // Update our cache of the cryptographer's pending keys. cached_pending_keys_ = pending_keys; @@ -1616,7 +1616,7 @@ void SyncBackendHost::NotifyPassphraseAccepted() { if (!frontend_) return; - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); // Clear our cache of the cryptographer's pending keys. cached_pending_keys_.clear_blob(); @@ -1638,7 +1638,7 @@ void SyncBackendHost::NotifyEncryptedTypesChanged( if (!frontend_) return; - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); frontend_->OnEncryptedTypesChanged( encrypted_types, encrypt_everything); } @@ -1647,14 +1647,14 @@ void SyncBackendHost::NotifyEncryptionComplete() { if (!frontend_) return; - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); frontend_->OnEncryptionComplete(); } void SyncBackendHost::HandlePassphraseTypeChangedOnFrontendLoop( syncer::PassphraseType type, base::Time explicit_passphrase_time) { - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); DVLOG(1) << "Passphrase type changed to " << syncer::PassphraseTypeToString(type); cached_passphrase_type_ = type; @@ -1672,7 +1672,7 @@ void SyncBackendHost::HandleConnectionStatusChangeOnFrontendLoop( if (!frontend_) return; - DCHECK_EQ(MessageLoop::current(), frontend_loop_); + DCHECK_EQ(base::MessageLoop::current(), frontend_loop_); DVLOG(1) << "Connection status changed: " << syncer::ConnectionStatusToString(status); diff --git a/chrome/browser/sync/glue/sync_backend_host_unittest.cc b/chrome/browser/sync/glue/sync_backend_host_unittest.cc index 1379825..4474035 100644 --- a/chrome/browser/sync/glue/sync_backend_host_unittest.cc +++ b/chrome/browser/sync/glue/sync_backend_host_unittest.cc @@ -53,7 +53,7 @@ ACTION_P(Signal, event) { } void QuitMessageLoop() { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } class MockSyncFrontend : public SyncFrontend { @@ -249,14 +249,14 @@ class SyncBackendHostTest : public testing::Test { protected: void DownloadReady(syncer::ModelTypeSet succeeded_types, syncer::ModelTypeSet failed_types) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void OnDownloadRetry() { NOTIMPLEMENTED(); } - MessageLoop ui_loop_; + base::MessageLoop ui_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread io_thread_; StrictMock<MockSyncFrontend> mock_frontend_; diff --git a/chrome/browser/sync/glue/sync_backend_registrar.cc b/chrome/browser/sync/glue/sync_backend_registrar.cc index 47ee4a4..cebd473 100644 --- a/chrome/browser/sync/glue/sync_backend_registrar.cc +++ b/chrome/browser/sync/glue/sync_backend_registrar.cc @@ -55,7 +55,7 @@ bool IsOnThreadForGroup(syncer::ModelType type, syncer::ModelSafeGroup group) { SyncBackendRegistrar::SyncBackendRegistrar( const std::string& name, Profile* profile, - MessageLoop* sync_loop) : + base::MessageLoop* sync_loop) : name_(name), profile_(profile), sync_loop_(sync_loop), @@ -175,7 +175,7 @@ void SyncBackendRegistrar::StopOnUIThread() { } void SyncBackendRegistrar::OnSyncerShutdownComplete() { - DCHECK_EQ(MessageLoop::current(), sync_loop_); + DCHECK_EQ(base::MessageLoop::current(), sync_loop_); ui_worker_->OnSyncerShutdownComplete(); } diff --git a/chrome/browser/sync/glue/sync_backend_registrar_unittest.cc b/chrome/browser/sync/glue/sync_backend_registrar_unittest.cc index a628f77..3761067 100644 --- a/chrome/browser/sync/glue/sync_backend_registrar_unittest.cc +++ b/chrome/browser/sync/glue/sync_backend_registrar_unittest.cc @@ -65,7 +65,7 @@ class SyncBackendRegistrarTest : public testing::Test { } } - MessageLoop loop_; + base::MessageLoop loop_; syncer::TestUserShare test_user_share_; private: diff --git a/chrome/browser/sync/glue/synced_device_tracker_unittest.cc b/chrome/browser/sync/glue/synced_device_tracker_unittest.cc index ee89fd7..2af2780 100644 --- a/chrome/browser/sync/glue/synced_device_tracker_unittest.cc +++ b/chrome/browser/sync/glue/synced_device_tracker_unittest.cc @@ -70,7 +70,7 @@ class SyncedDeviceTrackerTest : public ::testing::Test { return test_user_share_.transaction_observer()->transactions_observed(); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; syncer::TestUserShare test_user_share_; int transaction_count_baseline_; }; diff --git a/chrome/browser/sync/glue/typed_url_change_processor.cc b/chrome/browser/sync/glue/typed_url_change_processor.cc index 6281bbb..5ac4df5 100644 --- a/chrome/browser/sync/glue/typed_url_change_processor.cc +++ b/chrome/browser/sync/glue/typed_url_change_processor.cc @@ -43,7 +43,7 @@ TypedUrlChangeProcessor::TypedUrlChangeProcessor( profile_(profile), model_associator_(model_associator), history_backend_(history_backend), - expected_loop_(MessageLoop::current()) { + expected_loop_(base::MessageLoop::current()) { DCHECK(model_associator); DCHECK(history_backend); DCHECK(error_handler); @@ -55,14 +55,14 @@ TypedUrlChangeProcessor::TypedUrlChangeProcessor( } TypedUrlChangeProcessor::~TypedUrlChangeProcessor() { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); } void TypedUrlChangeProcessor::Observe( int type, const content::NotificationSource& source, const content::NotificationDetails& details) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); DVLOG(1) << "Observed typed_url change."; if (type == chrome::NOTIFICATION_HISTORY_URLS_MODIFIED) { @@ -239,7 +239,7 @@ void TypedUrlChangeProcessor::ApplyChangesFromSyncModel( const syncer::BaseTransaction* trans, int64 model_version, const syncer::ImmutableChangeRecordList& changes) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); syncer::ReadNode typed_url_root(trans); if (typed_url_root.InitByTagLookup(kTypedUrlTag) != @@ -295,7 +295,7 @@ void TypedUrlChangeProcessor::ApplyChangesFromSyncModel( } void TypedUrlChangeProcessor::CommitChangesFromSyncModel() { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); // Make sure we stop listening for changes while we're modifying the backend, // so we don't try to re-apply these changes to the sync DB. @@ -318,13 +318,13 @@ void TypedUrlChangeProcessor::CommitChangesFromSyncModel() { } void TypedUrlChangeProcessor::StartImpl(Profile* profile) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); DCHECK_EQ(profile, profile_); StartObserving(); } void TypedUrlChangeProcessor::StartObserving() { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); DCHECK(profile_); notification_registrar_.Add( this, chrome::NOTIFICATION_HISTORY_URLS_MODIFIED, @@ -338,7 +338,7 @@ void TypedUrlChangeProcessor::StartObserving() { } void TypedUrlChangeProcessor::StopObserving() { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); DCHECK(profile_); notification_registrar_.Remove( this, chrome::NOTIFICATION_HISTORY_URLS_MODIFIED, diff --git a/chrome/browser/sync/glue/typed_url_model_associator.cc b/chrome/browser/sync/glue/typed_url_model_associator.cc index 4ad83a4..afa4a99 100644 --- a/chrome/browser/sync/glue/typed_url_model_associator.cc +++ b/chrome/browser/sync/glue/typed_url_model_associator.cc @@ -64,7 +64,7 @@ TypedUrlModelAssociator::TypedUrlModelAssociator( DataTypeErrorHandler* error_handler) : sync_service_(sync_service), history_backend_(history_backend), - expected_loop_(MessageLoop::current()), + expected_loop_(base::MessageLoop::current()), pending_abort_(false), error_handler_(error_handler), num_db_accesses_(0), @@ -174,7 +174,7 @@ int TypedUrlModelAssociator::GetErrorPercentage() const { syncer::SyncError TypedUrlModelAssociator::DoAssociateModels() { DVLOG(1) << "Associating TypedUrl Models"; syncer::SyncError error; - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); if (IsAbortPending()) return syncer::SyncError(); history::URLRows typed_urls; @@ -452,7 +452,7 @@ sync_pb::TypedUrlSpecifics TypedUrlModelAssociator::FilterExpiredVisits( bool TypedUrlModelAssociator::DeleteAllNodes( syncer::WriteTransaction* trans) { - DCHECK(expected_loop_ == MessageLoop::current()); + DCHECK(expected_loop_ == base::MessageLoop::current()); // Just walk through all our child nodes and delete them. syncer::ReadNode typed_url_root(trans); diff --git a/chrome/browser/sync/glue/ui_data_type_controller_unittest.cc b/chrome/browser/sync/glue/ui_data_type_controller_unittest.cc index 911007d..ce64106 100644 --- a/chrome/browser/sync/glue/ui_data_type_controller_unittest.cc +++ b/chrome/browser/sync/glue/ui_data_type_controller_unittest.cc @@ -96,7 +96,7 @@ class SyncUIDataTypeControllerTest : public testing::Test { message_loop_.RunUntilIdle(); } - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; ProfileMock profile_; scoped_ptr<ProfileSyncComponentsFactoryMock> profile_sync_factory_; diff --git a/chrome/browser/sync/glue/ui_model_worker_unittest.cc b/chrome/browser/sync/glue/ui_model_worker_unittest.cc index e4de282..dd76963 100644 --- a/chrome/browser/sync/glue/ui_model_worker_unittest.cc +++ b/chrome/browser/sync/glue/ui_model_worker_unittest.cc @@ -32,7 +32,7 @@ class UIModelWorkerVisitor { EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::UI)); was_run_->Signal(); if (quit_loop_when_run_) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); return syncer::SYNCER_OK; } @@ -98,7 +98,7 @@ class SyncUIModelWorkerTest : public testing::Test { base::Thread* core_thread() { return &faux_core_thread_; } base::Thread* syncer_thread() { return &faux_syncer_thread_; } private: - MessageLoop faux_ui_loop_; + base::MessageLoop faux_ui_loop_; scoped_ptr<content::TestBrowserThread> ui_thread_; base::Thread faux_syncer_thread_; base::Thread faux_core_thread_; @@ -116,7 +116,7 @@ TEST_F(SyncUIModelWorkerTest, ScheduledWorkRunsOnUILoop) { // We are on the UI thread, so run our loop to process the // (hopefully) scheduled task from a SyncShare invocation. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); bmw()->OnSyncerShutdownComplete(); bmw()->Stop(); diff --git a/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc b/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc index 16f9db0..a32eb8af 100644 --- a/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc +++ b/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc @@ -97,7 +97,7 @@ class ProfileSyncComponentsFactoryImplTest : public testing::Test { CheckDefaultDatatypesInMapExcept(&controller_states, type); } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; scoped_ptr<Profile> profile_; scoped_ptr<CommandLine> command_line_; diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc index 40ee817..bfea304 100644 --- a/chrome/browser/sync/profile_sync_service.cc +++ b/chrome/browser/sync/profile_sync_service.cc @@ -841,7 +841,7 @@ void ProfileSyncService::OnUnrecoverableErrorImpl( << " -- ProfileSyncService unusable: " << message; // Shut all data types down. - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&ProfileSyncService::ShutdownImpl, weak_factory_.GetWeakPtr(), delete_sync_database)); } @@ -864,7 +864,7 @@ void ProfileSyncService::DisableBrokenDatatype( failed_datatypes_handler_.UpdateFailedDatatypes(errors, FailedDatatypesHandler::RUNTIME); - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&ProfileSyncService::ReconfigureDatatypeManager, weak_factory_.GetWeakPtr())); } @@ -967,7 +967,7 @@ void ProfileSyncService::OnSyncCycleCompleted() { // model associator listens too. Also consider somehow plumbing the current // server time as last reported by CheckServerReachable, so we don't have to // rely on the local clock, which may be off significantly. - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&browser_sync::SessionModelAssociator::DeleteStaleSessions, GetSessionModelAssociator()->AsWeakPtr())); } @@ -1302,7 +1302,7 @@ void ProfileSyncService::OnConfigureDone( } // Now handle partial success and full success. - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind(&ProfileSyncService::OnSyncConfigureDone, weak_factory_.GetWeakPtr(), result)); diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc index b2d88c2..8ffcbb0 100644 --- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc @@ -592,7 +592,7 @@ class ProfileSyncServiceAutofillTest sync_service_->RegisterDataTypeController(data_type_controller); sync_service_->Initialize(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // It's possible this test triggered an unrecoverable error, in which case // we can't get the sync count. diff --git a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc index 193f167..1f98c7b 100644 --- a/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_bookmark_unittest.cc @@ -468,7 +468,7 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { EXPECT_EQ(GetSyncBookmarkCount(), syncer_merge_result_.num_items_after_association()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Set up change processor. change_processor_.reset( @@ -655,7 +655,7 @@ class ProfileSyncServiceBookmarkTest : public testing::Test { private: // Used by both |ui_thread_| and |file_thread_|. - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; // Needed by |model_|. content::TestBrowserThread file_thread_; @@ -1867,7 +1867,7 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, UpdateTransactionVersion) { LoadBookmarkModel(DELETE_EXISTING_STORAGE, DONT_SAVE_TO_STORAGE); StartSync(); WriteTestDataToBookmarkModel(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); BookmarkNodeVersionMap initial_versions; @@ -1892,7 +1892,7 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, UpdateTransactionVersion) { // the same. const BookmarkNode* bookmark_bar = model_->bookmark_bar_node(); model_->Remove(bookmark_bar, 0); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); BookmarkNodeVersionMap new_versions; GetTransactionVersions(model_->root_node(), &new_versions); EXPECT_EQ(initial_versions[model_->root_node()->id()] + 1, @@ -1906,7 +1906,7 @@ TEST_F(ProfileSyncServiceBookmarkTestWithData, UpdateTransactionVersion) { const BookmarkNode* changed_bookmark = model_->bookmark_bar_node()->GetChild(0); model_->SetTitle(changed_bookmark, WideToUTF16Hack(L"test")); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); GetTransactionVersions(model_->root_node(), &new_versions); EXPECT_EQ(initial_versions[model_->root_node()->id()] + 2, new_versions[model_->root_node()->id()]); diff --git a/chrome/browser/sync/profile_sync_service_harness.cc b/chrome/browser/sync/profile_sync_service_harness.cc index 90dc180..3d42e91 100644 --- a/chrome/browser/sync/profile_sync_service_harness.cc +++ b/chrome/browser/sync/profile_sync_service_harness.cc @@ -292,7 +292,7 @@ void ProfileSyncServiceHarness::SignalStateCompleteWithNextState( void ProfileSyncServiceHarness::SignalStateComplete() { if (waiting_for_status_change_) - MessageLoop::current()->QuitWhenIdle(); + base::MessageLoop::current()->QuitWhenIdle(); } bool ProfileSyncServiceHarness::RunStateChangeMachine() { @@ -754,8 +754,8 @@ bool ProfileSyncServiceHarness::AwaitStatusChangeWithTimeout( // Set the flag to tell SignalStateComplete() that it's OK to quit out of // the MessageLoop if we hit a state transition. waiting_for_status_change_ = true; - MessageLoop* loop = MessageLoop::current(); - MessageLoop::ScopedNestableTaskAllower allow(loop); + base::MessageLoop* loop = base::MessageLoop::current(); + base::MessageLoop::ScopedNestableTaskAllower allow(loop); loop->PostDelayedTask( FROM_HERE, base::Bind(&StateChangeTimeoutEvent::Callback, diff --git a/chrome/browser/sync/profile_sync_service_password_unittest.cc b/chrome/browser/sync/profile_sync_service_password_unittest.cc index fa0e680..a5fd446 100644 --- a/chrome/browser/sync/profile_sync_service_password_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_password_unittest.cc @@ -78,7 +78,7 @@ ACTION_P(AcquireSyncTransaction, password_test_service) { } static void QuitMessageLoop() { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } class NullPasswordStore : public MockPasswordStore { @@ -248,12 +248,12 @@ class ProfileSyncServicePasswordTest : public AbstractProfileSyncServiceTest { sync_service_->RegisterDataTypeController(data_type_controller); sync_service_->Initialize(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); FlushLastDBTask(); sync_service_->SetEncryptionPassphrase("foo", ProfileSyncService::IMPLICIT); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } } diff --git a/chrome/browser/sync/profile_sync_service_preference_unittest.cc b/chrome/browser/sync/profile_sync_service_preference_unittest.cc index e7d56f0..ce02d29 100644 --- a/chrome/browser/sync/profile_sync_service_preference_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_preference_unittest.cc @@ -182,7 +182,7 @@ class ProfileSyncServicePreferenceTest GaiaConstants::kSyncService, "token"); sync_service_->Initialize(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // It's possible this test triggered an unrecoverable error, in which case // we can't get the preference count. diff --git a/chrome/browser/sync/profile_sync_service_session_unittest.cc b/chrome/browser/sync/profile_sync_service_session_unittest.cc index 44d1dfb..91cef4b 100644 --- a/chrome/browser/sync/profile_sync_service_session_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_session_unittest.cc @@ -249,9 +249,9 @@ class ProfileSyncServiceSessionTest // Pump messages posted by the sync core thread (which may end up // posting on the IO thread). - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); io_thread_.Stop(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); BrowserWithTestWindowTest::TearDown(); } @@ -293,7 +293,7 @@ class ProfileSyncServiceSessionTest TokenServiceFactory::GetForProfile(profile())->IssueAuthTokenForTest( GaiaConstants::kSyncService, "token"); sync_service_->Initialize(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); return true; } @@ -1200,7 +1200,7 @@ TEST_F(ProfileSyncServiceSessionTest, Favicons) { // Update associator. model_associator_->AssociateForeignSpecifics(meta, base::Time()); model_associator_->AssociateForeignSpecifics(tab, base::Time()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_FALSE(model_associator_->GetSyncedFaviconForPageURL(url, &favicon)); // Now add a favicon. @@ -1208,7 +1208,7 @@ TEST_F(ProfileSyncServiceSessionTest, Favicons) { tab.mutable_tab()->set_favicon_type(sync_pb::SessionTab::TYPE_WEB_FAVICON); tab.mutable_tab()->set_favicon("data"); model_associator_->AssociateForeignSpecifics(tab, base::Time()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_TRUE(model_associator_->GetSyncedFaviconForPageURL(url, &favicon)); ASSERT_TRUE(CompareMemoryToString("data", favicon)); @@ -1219,7 +1219,7 @@ TEST_F(ProfileSyncServiceSessionTest, Favicons) { tab.mutable_tab()->clear_favicon_type(); tab.mutable_tab()->clear_favicon(); model_associator_->AssociateForeignSpecifics(tab, base::Time()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); ASSERT_TRUE(model_associator_->GetSyncedFaviconForPageURL(url, &favicon)); } diff --git a/chrome/browser/sync/profile_sync_service_startup_unittest.cc b/chrome/browser/sync/profile_sync_service_startup_unittest.cc index b2fc564..168667a 100644 --- a/chrome/browser/sync/profile_sync_service_startup_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_startup_unittest.cc @@ -132,7 +132,7 @@ class ProfileSyncServiceStartupTest : public testing::Test { return data_type_manager; } - MessageLoop ui_loop_; + base::MessageLoop ui_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; content::TestBrowserThread file_thread_; @@ -318,7 +318,7 @@ TEST_F(ProfileSyncServiceStartupTest, StartInvalidCredentials) { token_service->IssueAuthTokenForTest( GaiaConstants::kSyncService, "sync_token"); sync_->SetSetupInProgress(false); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); // Verify we successfully finish startup and configuration. EXPECT_TRUE(sync_->ShouldPushChanges()); diff --git a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc index 0dd8d0f..15b88f1 100644 --- a/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_typed_url_unittest.cc @@ -230,7 +230,7 @@ class ProfileSyncServiceTypedUrlTest : public AbstractProfileSyncServiceTest { sync_service_->RegisterDataTypeController(data_type_controller); sync_service_->Initialize(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } return model_associator; } diff --git a/chrome/browser/sync/profile_sync_service_unittest.cc b/chrome/browser/sync/profile_sync_service_unittest.cc index 0c8d0b9..00afd97 100644 --- a/chrome/browser/sync/profile_sync_service_unittest.cc +++ b/chrome/browser/sync/profile_sync_service_unittest.cc @@ -139,7 +139,7 @@ class ProfileSyncServiceTestHarness { scoped_ptr<TestingProfile> profile; private: - MessageLoop ui_loop_; + base::MessageLoop ui_loop_; // Needed by |service|. content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; diff --git a/chrome/browser/sync/profile_sync_test_util.h b/chrome/browser/sync/profile_sync_test_util.h index 509bcf5..aedc4c5 100644 --- a/chrome/browser/sync/profile_sync_test_util.h +++ b/chrome/browser/sync/profile_sync_test_util.h @@ -30,7 +30,7 @@ ACTION_P(Notify, type) { ACTION(QuitUIMessageLoop) { DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } class ProfileSyncServiceObserverMock : public ProfileSyncServiceObserver { diff --git a/chrome/browser/sync/sync_prefs_unittest.cc b/chrome/browser/sync/sync_prefs_unittest.cc index 1b78842..042df83 100644 --- a/chrome/browser/sync/sync_prefs_unittest.cc +++ b/chrome/browser/sync/sync_prefs_unittest.cc @@ -30,7 +30,7 @@ class SyncPrefsTest : public testing::Test { TestingPrefServiceSyncable pref_service_; private: - MessageLoop loop_; + base::MessageLoop loop_; }; TEST_F(SyncPrefsTest, Basic) { diff --git a/chrome/browser/sync/sync_ui_util_unittest.cc b/chrome/browser/sync/sync_ui_util_unittest.cc index 275dcc9..7b8dd84 100644 --- a/chrome/browser/sync/sync_ui_util_unittest.cc +++ b/chrome/browser/sync/sync_ui_util_unittest.cc @@ -69,7 +69,7 @@ void VerifySyncGlobalErrorResult(NiceMock<ProfileSyncServiceMock>* service, // Test that GetStatusLabelsForSyncGlobalError returns an error if a // passphrase is required. TEST(SyncUIUtilTest, PassphraseGlobalError) { - MessageLoopForUI message_loop; + base::MessageLoopForUI message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); scoped_ptr<Profile> profile( ProfileSyncServiceMock::MakeSignedInTestingProfile()); @@ -89,7 +89,7 @@ TEST(SyncUIUtilTest, PassphraseGlobalError) { // Test that GetStatusLabelsForSyncGlobalError returns an error if a // passphrase is required and not for auth errors. TEST(SyncUIUtilTest, AuthAndPassphraseGlobalError) { - MessageLoopForUI message_loop; + base::MessageLoopForUI message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); scoped_ptr<Profile> profile( ProfileSyncServiceMock::MakeSignedInTestingProfile()); @@ -121,7 +121,7 @@ TEST(SyncUIUtilTest, AuthAndPassphraseGlobalError) { // Test that GetStatusLabelsForSyncGlobalError does not indicate errors for // auth errors (these are reported through SigninGlobalError). TEST(SyncUIUtilTest, AuthStateGlobalError) { - MessageLoopForUI message_loop; + base::MessageLoopForUI message_loop; content::TestBrowserThread ui_thread(BrowserThread::UI, &message_loop); scoped_ptr<Profile> profile( ProfileSyncServiceMock::MakeSignedInTestingProfile()); diff --git a/chrome/browser/sync/test/integration/autofill_helper.cc b/chrome/browser/sync/test/integration/autofill_helper.cc index ed4adfd..e848a17 100644 --- a/chrome/browser/sync/test/integration/autofill_helper.cc +++ b/chrome/browser/sync/test/integration/autofill_helper.cc @@ -241,7 +241,7 @@ void SetProfiles(int profile, std::vector<AutofillProfile>* autofill_profiles) { PersonalDataManager* pdm = GetPersonalDataManager(profile); pdm->AddObserver(&observer); pdm->SetProfiles(autofill_profiles); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); pdm->RemoveObserver(&observer); } @@ -252,7 +252,7 @@ void SetCreditCards(int profile, std::vector<CreditCard>* credit_cards) { PersonalDataManager* pdm = GetPersonalDataManager(profile); pdm->AddObserver(&observer); pdm->SetCreditCards(credit_cards); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); pdm->RemoveObserver(&observer); } @@ -297,7 +297,7 @@ const std::vector<AutofillProfile*>& GetAllProfiles( PersonalDataManager* pdm = GetPersonalDataManager(profile); pdm->AddObserver(&observer); pdm->Refresh(); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); pdm->RemoveObserver(&observer); return pdm->web_profiles(); } diff --git a/chrome/browser/sync/test/integration/bookmarks_helper.cc b/chrome/browser/sync/test/integration/bookmarks_helper.cc index dc4a341..57f0931 100644 --- a/chrome/browser/sync/test/integration/bookmarks_helper.cc +++ b/chrome/browser/sync/test/integration/bookmarks_helper.cc @@ -110,7 +110,7 @@ class FaviconChangeObserver : public BookmarkModelObserver { const BookmarkNode* node) OVERRIDE { if (model == model_ && node == node_) { if (!wait_for_load_ || (wait_for_load_ && node->is_favicon_loaded())) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } } diff --git a/chrome/browser/sync/test/integration/passwords_helper.cc b/chrome/browser/sync/test/integration/passwords_helper.cc index f06f261..dfc4e1a 100644 --- a/chrome/browser/sync/test/integration/passwords_helper.cc +++ b/chrome/browser/sync/test/integration/passwords_helper.cc @@ -59,7 +59,7 @@ class PasswordStoreConsumerHelper : public PasswordStoreConsumer { } // Quit the message loop to wake up passwords_helper::GetLogins. - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } private: diff --git a/chrome/browser/sync/test/integration/sync_test.cc b/chrome/browser/sync/test/integration/sync_test.cc index aa599a6..2b61276 100644 --- a/chrome/browser/sync/test/integration/sync_test.cc +++ b/chrome/browser/sync/test/integration/sync_test.cc @@ -79,7 +79,7 @@ class SyncServerStatusChecker : public net::URLFetcherDelegate { running_ = (source->GetStatus().status() == net::URLRequestStatus::SUCCESS && source->GetResponseCode() == 200 && data.find("ok") == 0); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } bool running() const { return running_; } diff --git a/chrome/browser/sync/test_profile_sync_service.cc b/chrome/browser/sync/test_profile_sync_service.cc index 73415c06..06d586a 100644 --- a/chrome/browser/sync/test_profile_sync_service.cc +++ b/chrome/browser/sync/test_profile_sync_service.cc @@ -88,7 +88,7 @@ void SyncBackendHostForProfileSyncTest::InitCore( if (synchronous_init_) { // The SyncBackend posts a task to the current loop when // initialization completes. - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); } } @@ -169,7 +169,7 @@ void SyncBackendHostForProfileSyncTest if (fail_initial_download_) { frontend()->OnSyncConfigureRetry(); if (synchronous_init_) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } else { initial_download_closure_.Run(); initial_download_closure_.Reset(); @@ -258,7 +258,7 @@ void TestProfileSyncService::OnBackendInitialized( // TODO(akalin): Figure out a better way to do this. if (synchronous_backend_initialization_) { - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } } @@ -266,7 +266,7 @@ void TestProfileSyncService::OnConfigureDone( const browser_sync::DataTypeManager::ConfigureResult& result) { ProfileSyncService::OnConfigureDone(result); if (!synchronous_sync_configuration_) - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } UserShare* TestProfileSyncService::GetUserShare() const { diff --git a/chrome/browser/sync_file_system/drive/api_util_unittest.cc b/chrome/browser/sync_file_system/drive/api_util_unittest.cc index e698684..aa24407 100644 --- a/chrome/browser/sync_file_system/drive/api_util_unittest.cc +++ b/chrome/browser/sync_file_system/drive/api_util_unittest.cc @@ -144,10 +144,10 @@ class APIUtilTest : public testing::Test { return mock_drive_service_; } - MessageLoop* message_loop() { return &message_loop_; } + base::MessageLoop* message_loop() { return &message_loop_; } private: - MessageLoop message_loop_; + base::MessageLoop message_loop_; TestingProfile profile_; scoped_ptr<APIUtil> api_util_; diff --git a/chrome/browser/sync_file_system/drive/fake_api_util_unittest.cc b/chrome/browser/sync_file_system/drive/fake_api_util_unittest.cc index aff971e..ba146a2 100644 --- a/chrome/browser/sync_file_system/drive/fake_api_util_unittest.cc +++ b/chrome/browser/sync_file_system/drive/fake_api_util_unittest.cc @@ -43,7 +43,7 @@ void DidDeleteFile(google_apis::GDataErrorCode* error_out, } // namespace TEST(FakeAPIUtilTest, ChangeSquashTest) { - MessageLoop message_loop; + base::MessageLoop message_loop; FakeAPIUtil api_util; std::string kParentResourceId("parent resource id"); std::string kParentTitle("app-id"); @@ -117,7 +117,7 @@ TEST(FakeAPIUtilTest, ChangeSquashTest) { } TEST(FakeAPIUtilTest, DeleteFile) { - MessageLoop message_loop; + base::MessageLoop message_loop; FakeAPIUtil api_util; std::string resource_id = "resource_id_to_be_deleted"; api_util.PushRemoteChange("parent_id", diff --git a/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc b/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc index 785115b..e22b505 100644 --- a/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc +++ b/chrome/browser/sync_file_system/drive_file_sync_service_mock_unittest.cc @@ -386,7 +386,7 @@ class DriveFileSyncServiceMockTest : public testing::Test { return &mock_remote_processor_; } - MessageLoop* message_loop() { return &message_loop_; } + base::MessageLoop* message_loop() { return &message_loop_; } DriveFileSyncService* sync_service() { return sync_service_.get(); } std::map<GURL, std::string>* pending_batch_sync_origins() { return &(sync_service()->pending_batch_sync_origins_); @@ -570,7 +570,7 @@ class DriveFileSyncServiceMockTest : public testing::Test { // End of mock setup helpers ----------------------------------------------- private: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/sync_file_system/drive_file_sync_service_sync_unittest.cc b/chrome/browser/sync_file_system/drive_file_sync_service_sync_unittest.cc index 16c161c..005b085 100644 --- a/chrome/browser/sync_file_system/drive_file_sync_service_sync_unittest.cc +++ b/chrome/browser/sync_file_system/drive_file_sync_service_sync_unittest.cc @@ -326,7 +326,7 @@ class DriveFileSyncServiceSyncTest : public testing::Test { } } - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/sync_file_system/drive_file_sync_service_unittest.cc b/chrome/browser/sync_file_system/drive_file_sync_service_unittest.cc index 4ace28d..3c44599 100644 --- a/chrome/browser/sync_file_system/drive_file_sync_service_unittest.cc +++ b/chrome/browser/sync_file_system/drive_file_sync_service_unittest.cc @@ -80,14 +80,14 @@ class DriveFileSyncServiceTest : public testing::Test { } protected: - MessageLoop* message_loop() { return &message_loop_; } + base::MessageLoop* message_loop() { return &message_loop_; } drive::FakeAPIUtil* fake_api_util() { return fake_api_util_; } DriveMetadataStore* metadata_store() { return metadata_store_; } DriveFileSyncService* sync_service() { return sync_service_.get(); } private: base::ScopedTempDir scoped_base_dir_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/sync_file_system/drive_metadata_store_unittest.cc b/chrome/browser/sync_file_system/drive_metadata_store_unittest.cc index 1f459cf..6ded310 100644 --- a/chrome/browser/sync_file_system/drive_metadata_store_unittest.cc +++ b/chrome/browser/sync_file_system/drive_metadata_store_unittest.cc @@ -305,7 +305,7 @@ class DriveMetadataStoreTest : public testing::Test { base::ScopedTempDir base_dir_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; scoped_ptr<base::Thread> file_thread_; scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_; diff --git a/chrome/browser/sync_file_system/sync_file_system_test_util.cc b/chrome/browser/sync_file_system/sync_file_system_test_util.cc index c6cd2cb..37e0e1d 100644 --- a/chrome/browser/sync_file_system/sync_file_system_test_util.cc +++ b/chrome/browser/sync_file_system/sync_file_system_test_util.cc @@ -43,11 +43,11 @@ MultiThreadTestHelper::~MultiThreadTestHelper() {} void MultiThreadTestHelper::SetUp() { file_thread_->Start(); io_thread_->StartWithOptions( - base::Thread::Options(MessageLoop::TYPE_IO, 0)); + base::Thread::Options(base::MessageLoop::TYPE_IO, 0)); browser_ui_thread_.reset( new TestBrowserThread(BrowserThread::UI, - MessageLoop::current())); + base::MessageLoop::current())); browser_file_thread_.reset( new TestBrowserThread(BrowserThread::FILE, file_thread_->message_loop())); diff --git a/chrome/browser/sync_file_system/sync_file_system_test_util.h b/chrome/browser/sync_file_system/sync_file_system_test_util.h index 7c87896..fadd5ec 100644 --- a/chrome/browser/sync_file_system/sync_file_system_test_util.h +++ b/chrome/browser/sync_file_system/sync_file_system_test_util.h @@ -37,7 +37,7 @@ class MultiThreadTestHelper { void SetUp(); void TearDown(); - MessageLoop* message_loop() { return &message_loop_; } + base::MessageLoop* message_loop() { return &message_loop_; } base::SingleThreadTaskRunner* ui_task_runner() { return ui_task_runner_.get(); @@ -52,7 +52,7 @@ class MultiThreadTestHelper { } private: - MessageLoop message_loop_; + base::MessageLoop message_loop_; scoped_ptr<base::Thread> file_thread_; scoped_ptr<base::Thread> io_thread_; diff --git a/chrome/browser/tab_contents/render_view_context_menu_browsertest_util.cc b/chrome/browser/tab_contents/render_view_context_menu_browsertest_util.cc index 8a7d371..864e589 100644 --- a/chrome/browser/tab_contents/render_view_context_menu_browsertest_util.cc +++ b/chrome/browser/tab_contents/render_view_context_menu_browsertest_util.cc @@ -29,7 +29,7 @@ void ContextMenuNotificationObserver::Observe( case chrome::NOTIFICATION_RENDER_VIEW_CONTEXT_MENU_SHOWN: { RenderViewContextMenu* context_menu = content::Source<RenderViewContextMenu>(source).ptr(); - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ContextMenuNotificationObserver::ExecuteCommand, base::Unretained(this), context_menu)); diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc index 86d08e4..1f525ce 100644 --- a/chrome/browser/task_manager/task_manager.cc +++ b/chrome/browser/task_manager/task_manager.cc @@ -1077,7 +1077,7 @@ void TaskManagerModel::StartUpdating() { // If update_state_ is STOPPING, it means a task is still pending. Setting // it to TASK_PENDING ensures the tasks keep being posted (by Refresh()). if (update_state_ == IDLE) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&TaskManagerModel::RefreshCallback, this)); } @@ -1233,7 +1233,7 @@ void TaskManagerModel::NotifyBytesRead(const net::URLRequest& request, origin_pid = info->GetOriginPID(); if (bytes_read_buffer_.empty()) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&TaskManagerModel::NotifyMultipleBytesRead, this), base::TimeDelta::FromSeconds(1)); @@ -1259,7 +1259,7 @@ void TaskManagerModel::RefreshCallback() { Refresh(); // Schedule the next update. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&TaskManagerModel::RefreshCallback, this), base::TimeDelta::FromMilliseconds(kUpdateTimeMs)); diff --git a/chrome/browser/task_manager/task_manager_browsertest_util.cc b/chrome/browser/task_manager/task_manager_browsertest_util.cc index 362aac0..e812b3d 100644 --- a/chrome/browser/task_manager/task_manager_browsertest_util.cc +++ b/chrome/browser/task_manager/task_manager_browsertest_util.cc @@ -67,7 +67,7 @@ class ResourceChangeObserver : public TaskManagerModelObserver { private: void OnResourceChange() { if (GetWebResourceCount(model_) == target_resource_count_) - MessageLoopForUI::current()->Quit(); + base::MessageLoopForUI::current()->Quit(); } const TaskManagerModel* model_; diff --git a/chrome/browser/task_manager/task_manager_unittest.cc b/chrome/browser/task_manager/task_manager_unittest.cc index 17c33b0..1e85db2 100644 --- a/chrome/browser/task_manager/task_manager_unittest.cc +++ b/chrome/browser/task_manager/task_manager_unittest.cc @@ -111,7 +111,7 @@ TEST_F(TaskManagerTest, Resources) { // Tests that the model is calling Refresh() on its resources. TEST_F(TaskManagerTest, RefreshCalled) { - MessageLoop loop; + base::MessageLoop loop; TaskManager task_manager; TaskManagerModel* model = task_manager.model_; TestResource resource; diff --git a/chrome/browser/themes/browser_theme_pack_unittest.cc b/chrome/browser/themes/browser_theme_pack_unittest.cc index 68f4f13..39fedaf 100644 --- a/chrome/browser/themes/browser_theme_pack_unittest.cc +++ b/chrome/browser/themes/browser_theme_pack_unittest.cc @@ -194,7 +194,7 @@ class BrowserThemePackTest : public ::testing::Test { EXPECT_FALSE(pack->GetTint(ThemeProperties::TINT_FRAME, &actual)); } - MessageLoop message_loop; + base::MessageLoop message_loop; content::TestBrowserThread fake_ui_thread; content::TestBrowserThread fake_file_thread; diff --git a/chrome/browser/themes/theme_service_unittest.cc b/chrome/browser/themes/theme_service_unittest.cc index e107679..e6bcf15 100644 --- a/chrome/browser/themes/theme_service_unittest.cc +++ b/chrome/browser/themes/theme_service_unittest.cc @@ -53,7 +53,7 @@ TEST_F(ThemeServiceTest, ThemeInstallUninstall) { MakeThemeExtension(temp_dir.path()); service_->FinishInstallationForTest(extension); // Let ThemeService finish creating the theme pack. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(theme_service->UsingDefaultTheme()); EXPECT_EQ(extension->id(), theme_service->GetThemeID()); @@ -75,7 +75,7 @@ TEST_F(ThemeServiceTest, ThemeUpgrade) { MakeThemeExtension(temp_dir.path()); service_->FinishInstallationForTest(extension); // Let ThemeService finish creating the theme pack. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(theme_service->UsingDefaultTheme()); EXPECT_EQ(extension->id(), theme_service->GetThemeID()); diff --git a/chrome/browser/themes/theme_syncable_service_unittest.cc b/chrome/browser/themes/theme_syncable_service_unittest.cc index c445a23..be32f67 100644 --- a/chrome/browser/themes/theme_syncable_service_unittest.cc +++ b/chrome/browser/themes/theme_syncable_service_unittest.cc @@ -162,7 +162,7 @@ scoped_refptr<extensions::Extension> MakeThemeExtension( class ThemeSyncableServiceTest : public testing::Test { protected: ThemeSyncableServiceTest() - : loop_(MessageLoop::TYPE_DEFAULT), + : loop_(base::MessageLoop::TYPE_DEFAULT), ui_thread_(BrowserThread::UI, &loop_), file_thread_(BrowserThread::FILE, &loop_), fake_theme_service_(NULL) {} @@ -234,7 +234,7 @@ class ThemeSyncableServiceTest : public testing::Test { } // Needed for setting up extension service. - MessageLoop loop_; + base::MessageLoop loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; diff --git a/chrome/browser/translate/translate_manager.cc b/chrome/browser/translate/translate_manager.cc index 34ce89f..ed130e3 100644 --- a/chrome/browser/translate/translate_manager.cc +++ b/chrome/browser/translate/translate_manager.cc @@ -204,7 +204,7 @@ void TranslateManager::Observe(int type, // before the WebContents and the WebContents processing might remove the // current infobars. Since InitTranslation might add an infobar, it must // be done after that. - MessageLoop::current()->PostTask(FROM_HERE, + base::MessageLoop::current()->PostTask(FROM_HERE, base::Bind( &TranslateManager::InitiateTranslationPosted, weak_method_factory_.GetWeakPtr(), @@ -298,7 +298,7 @@ void TranslateManager::OnURLFetchComplete(const net::URLFetcher* source) { // We'll expire the cached script after some time, to make sure long // running browsers still get fixes that might get pushed with newer // scripts. - MessageLoop::current()->PostDelayedTask(FROM_HERE, + base::MessageLoop::current()->PostDelayedTask(FROM_HERE, base::Bind(&TranslateManager::ClearTranslateScript, weak_method_factory_.GetWeakPtr()), translate_script_expiration_delay_); @@ -496,7 +496,7 @@ void TranslateManager::InitiateTranslationPosted( // has finished. if ((web_contents->IsLoading()) && attempt < kMaxTranslateLoadCheckAttempts) { int backoff = attempt * max_reload_check_attempts_; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&TranslateManager::InitiateTranslationPosted, weak_method_factory_.GetWeakPtr(), process_id, render_id, page_lang, ++attempt), diff --git a/chrome/browser/translate/translate_manager_browsertest.cc b/chrome/browser/translate/translate_manager_browsertest.cc index 205d9f6..1267e2a 100644 --- a/chrome/browser/translate/translate_manager_browsertest.cc +++ b/chrome/browser/translate/translate_manager_browsertest.cc @@ -212,7 +212,7 @@ class TranslateManagerBrowserTest : public ChromeRenderViewHostTestHarness, // The TranslateManager class processes the navigation entry committed // notification in a posted task; process that task. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } virtual void Observe(int type, @@ -808,7 +808,7 @@ TEST_F(TranslateManagerBrowserTest, ReloadFromLocationBar) { // The TranslateManager class processes the navigation entry committed // notification in a posted task; process that task. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_TRUE(GetTranslateInfoBar() != NULL); } @@ -1454,7 +1454,7 @@ TEST_F(TranslateManagerBrowserTest, ScriptExpires) { 0, 0, "fr", "en", TranslateErrors::NONE)); // A task should have been posted to clear the script, run it. - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Do another navigation and translation. SimulateNavigation(GURL("http://www.google.es"), "es", true); diff --git a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc index eeddc6f..7844a38 100644 --- a/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc +++ b/chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app_browsertest.cc @@ -1367,7 +1367,7 @@ IN_PROC_BROWSER_TEST_F(LauncherPerAppAppBrowserTest, DragAndDrop) { test.launcher_view()->GetAppListButtonView()->GetBoundsInScreen(); generator.MoveMouseTo(app_list_bounds.CenterPoint().x(), app_list_bounds.CenterPoint().y()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); generator.ClickLeftButton(); EXPECT_TRUE(service->IsAppListVisible()); @@ -1389,7 +1389,7 @@ IN_PROC_BROWSER_TEST_F(LauncherPerAppAppBrowserTest, DragAndDrop) { gfx::Rect bounds_grid_1 = item1->GetBoundsInScreen(); generator.MoveMouseTo(bounds_grid_1.CenterPoint().x(), bounds_grid_1.CenterPoint().y()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); generator.PressLeftButton(); EXPECT_FALSE(grid_view->forward_events_to_drag_and_drop_host_for_test()); @@ -1401,7 +1401,7 @@ IN_PROC_BROWSER_TEST_F(LauncherPerAppAppBrowserTest, DragAndDrop) { gfx::Rect bounds_launcher_1 = launcher1->GetBoundsInScreen(); generator.MoveMouseTo(bounds_launcher_1.CenterPoint().x(), bounds_launcher_1.CenterPoint().y()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); // Check that a new item got created. EXPECT_EQ(3, model_->item_count()); @@ -1410,13 +1410,13 @@ IN_PROC_BROWSER_TEST_F(LauncherPerAppAppBrowserTest, DragAndDrop) { // Move it where the item originally was and check that it disappears again. generator.MoveMouseTo(bounds_grid_1.CenterPoint().x(), bounds_grid_1.CenterPoint().y()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(2, model_->item_count()); EXPECT_FALSE(grid_view->forward_events_to_drag_and_drop_host_for_test()); // Dropping it should keep the launcher as it originally was. generator.ReleaseLeftButton(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(2, model_->item_count()); // There are a few animations which need finishing before we can continue. test.RunMessageLoopUntilAnimationsDone(); @@ -1430,11 +1430,11 @@ IN_PROC_BROWSER_TEST_F(LauncherPerAppAppBrowserTest, DragAndDrop) { generator.PressLeftButton(); generator.MoveMouseTo(bounds_launcher_1.CenterPoint().x(), bounds_launcher_1.CenterPoint().y()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(3, model_->item_count()); EXPECT_TRUE(grid_view->forward_events_to_drag_and_drop_host_for_test()); generator.ReleaseLeftButton(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(grid_view->forward_events_to_drag_and_drop_host_for_test()); EXPECT_EQ(3, model_->item_count()); // It should be still there. test.RunMessageLoopUntilAnimationsDone(); @@ -1446,11 +1446,11 @@ IN_PROC_BROWSER_TEST_F(LauncherPerAppAppBrowserTest, DragAndDrop) { generator.PressLeftButton(); generator.MoveMouseTo(bounds_launcher_1.CenterPoint().x(), bounds_launcher_1.CenterPoint().y()); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_EQ(3, model_->item_count()); // No new item got added. EXPECT_TRUE(grid_view->forward_events_to_drag_and_drop_host_for_test()); generator.ReleaseLeftButton(); - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); EXPECT_FALSE(grid_view->forward_events_to_drag_and_drop_host_for_test()); EXPECT_EQ(3, model_->item_count()); // And it remains that way. } diff --git a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model_unittest.cc b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model_unittest.cc index 73f5b51..60e4a66 100644 --- a/chrome/browser/ui/bookmarks/recently_used_folders_combo_model_unittest.cc +++ b/chrome/browser/ui/bookmarks/recently_used_folders_combo_model_unittest.cc @@ -26,7 +26,7 @@ class RecentlyUsedFoldersComboModelTest : public testing::Test { BookmarkModel* GetModel(); private: - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; scoped_ptr<TestingProfile> profile_; diff --git a/chrome/browser/ui/search/instant_controller_unittest.cc b/chrome/browser/ui/search/instant_controller_unittest.cc index cf70d141..fb2ddea 100644 --- a/chrome/browser/ui/search/instant_controller_unittest.cc +++ b/chrome/browser/ui/search/instant_controller_unittest.cc @@ -88,7 +88,7 @@ private: class InstantControllerTest : public testing::Test { public: InstantControllerTest() - : loop_(MessageLoop::TYPE_DEFAULT), + : loop_(base::MessageLoop::TYPE_DEFAULT), instant_controller_(new TestableInstantController()) { } @@ -101,8 +101,8 @@ class InstantControllerTest : public testing::Test { } private: - MessageLoop loop_; - scoped_ptr<TestableInstantController> instant_controller_; + base::MessageLoop loop_; + scoped_ptr<TestableInstantController> instant_controller_; }; TEST_F(InstantControllerTest, ShouldSwitchToLocalOverlayReturn) { diff --git a/chrome/browser/ui/views/app_list/app_list_controller_win.cc b/chrome/browser/ui/views/app_list/app_list_controller_win.cc index 96a9470..b1e5e64 100644 --- a/chrome/browser/ui/views/app_list/app_list_controller_win.cc +++ b/chrome/browser/ui/views/app_list/app_list_controller_win.cc @@ -919,7 +919,7 @@ void AppListController::ScheduleWarmup() { // Send app list usage stats after a delay. const int kSendUsageStatsDelay = 5; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&AppListController::SendAppListStats), base::TimeDelta::FromSeconds(kSendUsageStatsDelay)); diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc index b7d6917..e7df985 100644 --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc @@ -558,7 +558,7 @@ void SigninScreenHandler::UpdateStateInternal( base::Bind( &SigninScreenHandler::UpdateStateInternal, weak_factory_.GetWeakPtr(), state, reason, force_update)); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, update_state_closure_.callback(), base::TimeDelta::FromSeconds(kOfflineTimeoutSec)); @@ -573,7 +573,7 @@ void SigninScreenHandler::UpdateStateInternal( connecting_closure_.Reset( base::Bind(&SigninScreenHandler::UpdateStateInternal, weak_factory_.GetWeakPtr(), state, reason, true)); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, connecting_closure_.callback(), base::TimeDelta::FromSeconds(kConnectingTimeoutSec)); diff --git a/chrome/browser/ui/webui/sync_setup_handler.cc b/chrome/browser/ui/webui/sync_setup_handler.cc index d2a0e8f..ec7e461 100644 --- a/chrome/browser/ui/webui/sync_setup_handler.cc +++ b/chrome/browser/ui/webui/sync_setup_handler.cc @@ -1357,7 +1357,7 @@ void SyncSetupHandler::CloseGaiaSigninPage() { // if the user clicks 'cancel' in the enterprise signin dialog), so // closing this tab in mid-handler can cause crashes. Instead, close it // via a task so we know we aren't in the middle of any webui code. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&CloseTab, base::Unretained(active_gaia_signin_tab_))); diff --git a/chrome/browser/user_style_sheet_watcher_unittest.cc b/chrome/browser/user_style_sheet_watcher_unittest.cc index 004e271..3f1e614 100644 --- a/chrome/browser/user_style_sheet_watcher_unittest.cc +++ b/chrome/browser/user_style_sheet_watcher_unittest.cc @@ -28,9 +28,9 @@ TEST(UserStyleSheetWatcherTest, StyleLoad) { ASSERT_TRUE(file_util::WriteFile(style_sheet_file, css_file_contents.data(), css_file_contents.length())); - MessageLoop loop(MessageLoop::TYPE_UI); + base::MessageLoop loop(base::MessageLoop::TYPE_UI); base::Thread io_thread("UserStyleSheetWatcherTestIOThread"); - base::Thread::Options options(MessageLoop::TYPE_IO, 0); + base::Thread::Options options(base::MessageLoop::TYPE_IO, 0); ASSERT_TRUE(io_thread.StartWithOptions(options)); content::TestBrowserThread browser_ui_thread(BrowserThread::UI, &loop); content::TestBrowserThread browser_file_thread(BrowserThread::FILE, diff --git a/chrome/browser/value_store/value_store_frontend_unittest.cc b/chrome/browser/value_store/value_store_frontend_unittest.cc index 6cd7b4b..cc3ca1f 100644 --- a/chrome/browser/value_store/value_store_frontend_unittest.cc +++ b/chrome/browser/value_store/value_store_frontend_unittest.cc @@ -19,8 +19,8 @@ using content::BrowserThread; class ValueStoreFrontendTest : public testing::Test { public: ValueStoreFrontendTest() - : ui_thread_(BrowserThread::UI, MessageLoop::current()), - file_thread_(BrowserThread::FILE, MessageLoop::current()) { + : ui_thread_(BrowserThread::UI, base::MessageLoop::current()), + file_thread_(BrowserThread::FILE, base::MessageLoop::current()) { } virtual void SetUp() { @@ -36,7 +36,7 @@ class ValueStoreFrontendTest : public testing::Test { } virtual void TearDown() { - MessageLoop::current()->RunUntilIdle(); // wait for storage to delete + base::MessageLoop::current()->RunUntilIdle(); // wait for storage to delete storage_.reset(); } @@ -48,7 +48,7 @@ class ValueStoreFrontendTest : public testing::Test { bool Get(const std::string& key, scoped_ptr<base::Value>* output) { storage_->Get(key, base::Bind(&ValueStoreFrontendTest::GetAndWait, base::Unretained(this), output)); - MessageLoop::current()->Run(); // wait for GetAndWait + base::MessageLoop::current()->Run(); // wait for GetAndWait return !!output->get(); } @@ -56,13 +56,13 @@ class ValueStoreFrontendTest : public testing::Test { void GetAndWait(scoped_ptr<base::Value>* output, scoped_ptr<base::Value> result) { *output = result.Pass(); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } scoped_ptr<ValueStoreFrontend> storage_; base::ScopedTempDir temp_dir_; base::FilePath db_path_; - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; }; diff --git a/chrome/browser/value_store/value_store_unittest.cc b/chrome/browser/value_store/value_store_unittest.cc index 9759fff..d45f647 100644 --- a/chrome/browser/value_store/value_store_unittest.cc +++ b/chrome/browser/value_store/value_store_unittest.cc @@ -131,8 +131,8 @@ ValueStoreTest::ValueStoreTest() dict3_(new DictionaryValue()), dict12_(new DictionaryValue()), dict123_(new DictionaryValue()), - ui_thread_(BrowserThread::UI, MessageLoop::current()), - file_thread_(BrowserThread::FILE, MessageLoop::current()) { + ui_thread_(BrowserThread::UI, base::MessageLoop::current()), + file_thread_(BrowserThread::FILE, base::MessageLoop::current()) { val1_.reset(Value::CreateStringValue(key1_ + "Value")); val2_.reset(Value::CreateStringValue(key2_ + "Value")); val3_.reset(Value::CreateStringValue(key3_ + "Value")); diff --git a/chrome/browser/value_store/value_store_unittest.h b/chrome/browser/value_store/value_store_unittest.h index 513963a..ec372a0 100644 --- a/chrome/browser/value_store/value_store_unittest.h +++ b/chrome/browser/value_store/value_store_unittest.h @@ -66,7 +66,7 @@ class ValueStoreTest : public testing::TestWithParam<ValueStoreTestParam> { base::ScopedTempDir temp_dir_; // Need these so that the DCHECKs for running on FILE or UI threads pass. - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread file_thread_; }; diff --git a/chrome/browser/web_resource/promo_resource_service.cc b/chrome/browser/web_resource/promo_resource_service.cc index 605c3ac..02c1655 100644 --- a/chrome/browser/web_resource/promo_resource_service.cc +++ b/chrome/browser/web_resource/promo_resource_service.cc @@ -149,7 +149,7 @@ void PromoResourceService::PostNotification(int64 delay_ms) { // TODO(achuith): This crashes if we post delay_ms = 0 to the message loop. // during startup. if (delay_ms > 0) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&PromoResourceService::PromoResourceStateChange, weak_ptr_factory_.GetWeakPtr()), diff --git a/chrome/browser/web_resource/promo_resource_service_mobile_ntp_unittest.cc b/chrome/browser/web_resource/promo_resource_service_mobile_ntp_unittest.cc index a0a9a5f..dc72b92 100644 --- a/chrome/browser/web_resource/promo_resource_service_mobile_ntp_unittest.cc +++ b/chrome/browser/web_resource/promo_resource_service_mobile_ntp_unittest.cc @@ -33,7 +33,7 @@ class PromoResourceServiceMobileNtpTest : public testing::Test { protected: ScopedTestingLocalState local_state_; scoped_refptr<PromoResourceService> promo_resource_service_; - MessageLoop loop_; + base::MessageLoop loop_; }; class NotificationPromoMobileNtpTest { diff --git a/chrome/browser/web_resource/promo_resource_service_unittest.cc b/chrome/browser/web_resource/promo_resource_service_unittest.cc index c903c38..30c7662 100644 --- a/chrome/browser/web_resource/promo_resource_service_unittest.cc +++ b/chrome/browser/web_resource/promo_resource_service_unittest.cc @@ -67,7 +67,7 @@ class PromoResourceServiceTest : public testing::Test { protected: ScopedTestingLocalState local_state_; scoped_refptr<PromoResourceService> promo_resource_service_; - MessageLoop loop_; + base::MessageLoop loop_; }; class NotificationPromoTest { diff --git a/chrome/browser/web_resource/web_resource_service.cc b/chrome/browser/web_resource/web_resource_service.cc index f9af253..f4fd3db 100644 --- a/chrome/browser/web_resource/web_resource_service.cc +++ b/chrome/browser/web_resource/web_resource_service.cc @@ -93,7 +93,7 @@ void WebResourceService::OnResourceRequestsAllowed() { // Delay initial load of resource data into cache so as not to interfere // with startup time. void WebResourceService::ScheduleFetch(int64 delay_ms) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&WebResourceService::StartFetch, weak_ptr_factory_.GetWeakPtr()), diff --git a/chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc b/chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc index 5c1a069..75709e7 100644 --- a/chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc +++ b/chrome/browser/webdata/autofill_profile_syncable_service_unittest.cc @@ -112,7 +112,7 @@ class AutofillProfileSyncableServiceTest : public testing::Test { } protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; content::TestBrowserThread ui_thread_; content::TestBrowserThread db_thread_; MockAutofillProfileSyncableService autofill_syncable_service_; diff --git a/chrome/test/chromedriver/chrome/device_manager.cc b/chrome/test/chromedriver/chrome/device_manager.cc index 305c69f..69e3343 100644 --- a/chrome/test/chromedriver/chrome/device_manager.cc +++ b/chrome/test/chromedriver/chrome/device_manager.cc @@ -182,7 +182,7 @@ Status DeviceManager::ExecuteHostShellCommand( void DeviceManager::ExecuteCommandOnIOThread( const std::string& command, std::string* response, bool* success, base::WaitableEvent* event) { - CHECK(MessageLoop::current()->IsType(MessageLoop::TYPE_IO)); + CHECK(base::MessageLoop::current()->IsType(base::MessageLoop::TYPE_IO)); AdbClientSocket::AdbQuery(kAdbPort, command, base::Bind(&ReceiveAdbResponse, response, success, event)); } diff --git a/chrome/test/perf/perf_ui_test_suite.cc b/chrome/test/perf/perf_ui_test_suite.cc index 05ebde4..1f15015 100644 --- a/chrome/test/perf/perf_ui_test_suite.cc +++ b/chrome/test/perf/perf_ui_test_suite.cc @@ -160,7 +160,7 @@ void PerfUITestSuite::BuildCachedThemePakIn( // both because committing large binary files is bad in a git world and // because people don't remember to update it anyway, meaning we usually // have the theme rebuild penalty in our data.) - MessageLoopForUI message_loop_; + base::MessageLoopForUI message_loop_; content::TestBrowserThread ui_thread_(BrowserThread::UI, &message_loop_); content::TestBrowserThread file_thread_(BrowserThread::FILE, &message_loop_); |