diff options
19 files changed, 59 insertions, 54 deletions
diff --git a/chrome_frame/chrome_frame_automation.cc b/chrome_frame/chrome_frame_automation.cc index 6f1e7f0..7304c28 100644 --- a/chrome_frame/chrome_frame_automation.cc +++ b/chrome_frame/chrome_frame_automation.cc @@ -225,7 +225,7 @@ AutomationProxyCacheEntry::~AutomationProxyCacheEntry() { // The AutomationProxy class uses the SyncChannel which assumes the existence // of a MessageLoop instance. // We leak the AutomationProxy pointer here to avoid a crash. - if (MessageLoop::current() == NULL) { + if (base::MessageLoop::current() == NULL) { proxy_.release(); } } diff --git a/chrome_frame/chrome_frame_automation.h b/chrome_frame/chrome_frame_automation.h index 150a778..f3c8fa3 100644 --- a/chrome_frame/chrome_frame_automation.h +++ b/chrome_frame/chrome_frame_automation.h @@ -238,7 +238,7 @@ class AutomationProxyCacheEntry return thread_.get(); } - MessageLoop* message_loop() const { + base::MessageLoop* message_loop() const { return thread_->message_loop(); } diff --git a/chrome_frame/delete_chrome_history.cc b/chrome_frame/delete_chrome_history.cc index 2749806..0d1fa38 100644 --- a/chrome_frame/delete_chrome_history.cc +++ b/chrome_frame/delete_chrome_history.cc @@ -91,8 +91,8 @@ STDMETHODIMP DeleteChromeHistory::DeleteBrowsingHistory(DWORD flags) { remove_mask_ |= BrowsingDataRemover::REMOVE_HISTORY; loop_.PostDelayedTask(FROM_HERE, - MessageLoop::QuitClosure(), base::TimeDelta::FromMinutes(10)); - loop_.MessageLoop::Run(); + base::MessageLoop::QuitClosure(), base::TimeDelta::FromMinutes(10)); + loop_.base::MessageLoop::Run(); return S_OK; } diff --git a/chrome_frame/delete_chrome_history.h b/chrome_frame/delete_chrome_history.h index 0b7ba8d..79d1f05 100644 --- a/chrome_frame/delete_chrome_history.h +++ b/chrome_frame/delete_chrome_history.h @@ -57,7 +57,7 @@ END_MSG_MAP() private: unsigned long remove_mask_; - MessageLoopForUI loop_; + base::MessageLoopForUI loop_; }; #endif // CHROME_FRAME_DELETE_CHROME_HISTORY_H_ diff --git a/chrome_frame/test/chrome_frame_automation_mock.cc b/chrome_frame/test/chrome_frame_automation_mock.cc index d307712..06c456b 100644 --- a/chrome_frame/test/chrome_frame_automation_mock.cc +++ b/chrome_frame/test/chrome_frame_automation_mock.cc @@ -9,11 +9,12 @@ const base::TimeDelta kLongWaitTimeout = base::TimeDelta::FromSeconds(25); TEST(ChromeFrame, Launch) { - MessageLoopForUI loop; + base::MessageLoopForUI loop; AutomationMockLaunch mock_launch(&loop, kLongWaitTimeout.InMilliseconds()); - loop.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), kLongWaitTimeout); + loop.PostDelayedTask( + FROM_HERE, base::MessageLoop::QuitClosure(), kLongWaitTimeout); mock_launch.Navigate("about:blank"); base::RunLoop run_loop(NULL); @@ -22,11 +23,12 @@ TEST(ChromeFrame, Launch) { } TEST(ChromeFrame, Navigate) { - MessageLoopForUI loop; + base::MessageLoopForUI loop; AutomationMockNavigate mock_navigate(&loop, kLongWaitTimeout.InMilliseconds()); - loop.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), kLongWaitTimeout); + loop.PostDelayedTask( + FROM_HERE, base::MessageLoop::QuitClosure(), kLongWaitTimeout); mock_navigate.NavigateRelativeFile(L"postmessage_basic_frame.html"); base::RunLoop run_loop(NULL); @@ -35,11 +37,12 @@ TEST(ChromeFrame, Navigate) { } TEST(ChromeFrame, PostMessage) { - MessageLoopForUI loop; + base::MessageLoopForUI loop; AutomationMockPostMessage mock_postmessage(&loop, kLongWaitTimeout.InMilliseconds()); - loop.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), kLongWaitTimeout); + loop.PostDelayedTask( + FROM_HERE, base::MessageLoop::QuitClosure(), kLongWaitTimeout); mock_postmessage.NavigateRelativeFile(L"postmessage_basic_frame.html"); base::RunLoop run_loop(NULL); @@ -48,11 +51,12 @@ TEST(ChromeFrame, PostMessage) { } TEST(ChromeFrame, RequestStart) { - MessageLoopForUI loop; + base::MessageLoopForUI loop; AutomationMockHostNetworkRequestStart mock_request_start( &loop, kLongWaitTimeout.InMilliseconds()); - loop.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), kLongWaitTimeout); + loop.PostDelayedTask( + FROM_HERE, base::MessageLoop::QuitClosure(), kLongWaitTimeout); mock_request_start.NavigateRelative(L"postmessage_basic_frame.html"); base::RunLoop run_loop(NULL); diff --git a/chrome_frame/test/chrome_frame_automation_mock.h b/chrome_frame/test/chrome_frame_automation_mock.h index 3cdaf68..b2d1ed2 100644 --- a/chrome_frame/test/chrome_frame_automation_mock.h +++ b/chrome_frame/test/chrome_frame_automation_mock.h @@ -24,7 +24,7 @@ class AutomationMockDelegate : public CWindowImpl<T>, public ChromeFramePlugin<T> { public: - AutomationMockDelegate(MessageLoop* caller_message_loop, + AutomationMockDelegate(base::MessageLoop* caller_message_loop, int launch_timeout, bool perform_version_check, const std::wstring& profile_name, const std::wstring& language, @@ -137,12 +137,12 @@ class AutomationMockDelegate void QuitMessageLoop() { // Quit on the caller message loop has to be called on the caller // thread. - caller_message_loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + caller_message_loop_->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } private: testing::StrictMock<MockWebServer> mock_server_; - MessageLoop* caller_message_loop_; + base::MessageLoop* caller_message_loop_; GURL url_; bool is_connected_; bool navigation_result_; @@ -152,7 +152,7 @@ class AutomationMockLaunch : public AutomationMockDelegate<AutomationMockLaunch> { public: typedef AutomationMockDelegate<AutomationMockLaunch> Base; - AutomationMockLaunch(MessageLoop* caller_message_loop, + AutomationMockLaunch(base::MessageLoop* caller_message_loop, int launch_timeout) : Base(caller_message_loop, launch_timeout, true, L"", L"", false, false) { @@ -170,7 +170,7 @@ class AutomationMockNavigate : public AutomationMockDelegate<AutomationMockNavigate> { public: typedef AutomationMockDelegate<AutomationMockNavigate> Base; - AutomationMockNavigate(MessageLoop* caller_message_loop, + AutomationMockNavigate(base::MessageLoop* caller_message_loop, int launch_timeout) : Base(caller_message_loop, launch_timeout, true, L"", L"", false, false) { @@ -185,7 +185,7 @@ class AutomationMockPostMessage : public AutomationMockDelegate<AutomationMockPostMessage> { public: typedef AutomationMockDelegate<AutomationMockPostMessage> Base; - AutomationMockPostMessage(MessageLoop* caller_message_loop, + AutomationMockPostMessage(base::MessageLoop* caller_message_loop, int launch_timeout) : Base(caller_message_loop, launch_timeout, true, L"", L"", false, false), @@ -213,7 +213,7 @@ class AutomationMockHostNetworkRequestStart : public AutomationMockDelegate<AutomationMockHostNetworkRequestStart> { public: typedef AutomationMockDelegate<AutomationMockHostNetworkRequestStart> Base; - AutomationMockHostNetworkRequestStart(MessageLoop* caller_message_loop, + AutomationMockHostNetworkRequestStart(base::MessageLoop* caller_message_loop, int launch_timeout) : Base(caller_message_loop, launch_timeout, true, L"", L"", false, false), diff --git a/chrome_frame/test/chrome_frame_test_utils.h b/chrome_frame/test/chrome_frame_test_utils.h index 5d2e44c..dbee52c 100644 --- a/chrome_frame/test/chrome_frame_test_utils.h +++ b/chrome_frame/test/chrome_frame_test_utils.h @@ -211,9 +211,9 @@ class TimedMsgLoop { if (snapshot_on_timeout_) timeout_closure_.Reset(base::Bind(&TimedMsgLoop::SnapshotAndQuit)); else - timeout_closure_.Reset(MessageLoop::QuitClosure()); + timeout_closure_.Reset(base::MessageLoop::QuitClosure()); loop_.PostDelayedTask(FROM_HERE, timeout_closure_.callback(), duration); - loop_.MessageLoop::Run(); + loop_.base::MessageLoop::Run(); timeout_closure_.Cancel(); } @@ -235,7 +235,7 @@ class TimedMsgLoop { void QuitAfter(base::TimeDelta delay) { timeout_closure_.Cancel(); quit_loop_invoked_ = true; - loop_.PostDelayedTask(FROM_HERE, MessageLoop::QuitClosure(), delay); + loop_.PostDelayedTask(FROM_HERE, base::MessageLoop::QuitClosure(), delay); } bool WasTimedOut() const { @@ -249,10 +249,10 @@ class TimedMsgLoop { private: static void SnapshotAndQuit() { TakeSnapshotAndLog(); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } - MessageLoopForUI loop_; + base::MessageLoopForUI loop_; base::CancelableClosure timeout_closure_; bool snapshot_on_timeout_; bool quit_loop_invoked_; diff --git a/chrome_frame/test/chrome_frame_ui_test_utils.cc b/chrome_frame/test/chrome_frame_ui_test_utils.cc index 25dd60b..1bd443d 100644 --- a/chrome_frame/test/chrome_frame_ui_test_utils.cc +++ b/chrome_frame/test/chrome_frame_ui_test_utils.cc @@ -658,8 +658,8 @@ void AccEventObserver::OnEventReceived(DWORD event, LONG object_id, LONG child_id) { // Process events in a separate task to stop reentrancy problems. - DCHECK(MessageLoop::current()); - MessageLoop::current()->PostTask( + DCHECK(base::MessageLoop::current()); + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&EventHandler::Handle, event_handler_.get(), event, hwnd, object_id, child_id)); } diff --git a/chrome_frame/test/mock_ie_event_sink_actions.h b/chrome_frame/test/mock_ie_event_sink_actions.h index 3c6b331..5c4dcab 100644 --- a/chrome_frame/test/mock_ie_event_sink_actions.h +++ b/chrome_frame/test/mock_ie_event_sink_actions.h @@ -307,8 +307,8 @@ ACTION(DoCloseWindow) { } ACTION_P(DelayDoCloseWindow, delay) { - DCHECK(MessageLoop::current()); - MessageLoop::current()->PostDelayedTask( + DCHECK(base::MessageLoop::current()); + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(DoCloseWindowNow, arg0), base::TimeDelta::FromMilliseconds(delay)); } diff --git a/chrome_frame/test/net/fake_external_tab.cc b/chrome_frame/test/net/fake_external_tab.cc index 6a1a014..012805d 100644 --- a/chrome_frame/test/net/fake_external_tab.cc +++ b/chrome_frame/test/net/fake_external_tab.cc @@ -743,7 +743,7 @@ void CFUrlRequestUnittestRunner::StartInitializationTimeout() { timeout_closure_.Reset( base::Bind(&CFUrlRequestUnittestRunner::OnInitializationTimeout, base::Unretained(this))); - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, timeout_closure_.callback(), TestTimeouts::action_max_timeout()); @@ -825,8 +825,8 @@ void CFUrlRequestUnittestRunner::PreMainMessageLoopRun() { } bool CFUrlRequestUnittestRunner::MainMessageLoopRun(int* result_code) { - DCHECK(MessageLoop::current()); - DCHECK(MessageLoop::current()->type() == MessageLoop::TYPE_UI); + DCHECK(base::MessageLoop::current()); + DCHECK(base::MessageLoop::current()->type() == base::MessageLoop::TYPE_UI); // We need to allow IO on the main thread for these tests. base::ThreadRestrictions::SetIOAllowed(true); diff --git a/chrome_frame/test/net/test_automation_resource_message_filter.cc b/chrome_frame/test/net/test_automation_resource_message_filter.cc index 1b3ae8d..d6b75b9 100644 --- a/chrome_frame/test/net/test_automation_resource_message_filter.cc +++ b/chrome_frame/test/net/test_automation_resource_message_filter.cc @@ -66,7 +66,7 @@ bool TestAutomationResourceMessageFilter::RegisterRequest( // request messages to that loop. base::AutoLock lock(requests_lock_); DCHECK(requests_.end() == requests_.find(job->id())); - RequestJob request_job = { MessageLoop::current(), job }; + RequestJob request_job = { base::MessageLoop::current(), job }; requests_[job->id()] = request_job; return true; } diff --git a/chrome_frame/test/net/test_automation_resource_message_filter.h b/chrome_frame/test/net/test_automation_resource_message_filter.h index 4630401..56fd03a 100644 --- a/chrome_frame/test/net/test_automation_resource_message_filter.h +++ b/chrome_frame/test/net/test_automation_resource_message_filter.h @@ -44,7 +44,7 @@ class TestAutomationResourceMessageFilter AutomationProvider* automation_; // declare the request map. struct RequestJob { - MessageLoop* loop_; + base::MessageLoop* loop_; scoped_refptr<URLRequestAutomationJob> job_; }; typedef std::map<int, RequestJob> RequestMap; diff --git a/chrome_frame/test/proxy_factory_mock.h b/chrome_frame/test/proxy_factory_mock.h index 609d4b6..bf385e7 100644 --- a/chrome_frame/test/proxy_factory_mock.h +++ b/chrome_frame/test/proxy_factory_mock.h @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef CHROME_FRAME_TEST_PROXY_FACTORY_MOCK_H_ @@ -39,9 +39,8 @@ class MockProxyFactory : public ProxyFactory { void** automation_server_id); base::Thread thread_; - MessageLoop* loop_; + base::MessageLoop* loop_; }; - #endif // CHROME_FRAME_TEST_PROXY_FACTORY_MOCK_H_ diff --git a/chrome_frame/test/test_server.cc b/chrome_frame/test/test_server.cc index 181209e..dd8d9bc 100644 --- a/chrome_frame/test/test_server.cc +++ b/chrome_frame/test/test_server.cc @@ -38,7 +38,8 @@ void Request::ParseHeaders(const std::string& headers) { if (pos != std::string::npos) { headers_ = headers.substr(pos + 2); - base::StringTokenizer tokenizer(headers.begin(), headers.begin() + pos, " "); + base::StringTokenizer tokenizer( + headers.begin(), headers.begin() + pos, " "); std::string* parse[] = { &method_, &path_, &version_ }; int field = 0; while (tokenizer.GetNext() && field < arraysize(parse)) { @@ -153,7 +154,8 @@ SimpleWebServer::~SimpleWebServer() { } void SimpleWebServer::Construct(const std::string& address, int port) { - CHECK(MessageLoop::current()) << "SimpleWebServer requires a message loop"; + CHECK(base::MessageLoop::current()) + << "SimpleWebServer requires a message loop"; net::EnsureWinsockInit(); AddResponse(&quit_); host_ = address; @@ -356,7 +358,7 @@ void ConfigurableConnection::SendChunk() { cur_pos_ += bytes_to_send; if (cur_pos_ < size) { - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ConfigurableConnection::SendChunk, this), base::TimeDelta::FromMilliseconds(options_.timeout_)); } else { @@ -393,7 +395,7 @@ void ConfigurableConnection::SendWithOptions(const std::string& headers, socket_->Send(content); // Post a task to close the socket since StreamListenSocket doesn't like // instances to go away from within its callbacks. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ConfigurableConnection::Close, this)); return; @@ -412,7 +414,7 @@ void ConfigurableConnection::SendWithOptions(const std::string& headers, data_.append("\r\n"); } - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&ConfigurableConnection::SendChunk, this), base::TimeDelta::FromMilliseconds(options.timeout_)); } diff --git a/chrome_frame/test/test_server.h b/chrome_frame/test/test_server.h index 3cdb88e..4762a27 100644 --- a/chrome_frame/test/test_server.h +++ b/chrome_frame/test/test_server.h @@ -328,7 +328,7 @@ class SimpleWebServer : public net::StreamListenSocket::Delegate { virtual void WriteContents(net::StreamListenSocket* socket) const { SimpleResponse::WriteContents(socket); - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } }; diff --git a/chrome_frame/test/test_server_test.cc b/chrome_frame/test/test_server_test.cc index f893e7a..783149b 100644 --- a/chrome_frame/test/test_server_test.cc +++ b/chrome_frame/test/test_server_test.cc @@ -79,14 +79,14 @@ class UrlTaskChain { void Run() { EXPECT_EQ(0, delegate_.response_started_count()); - MessageLoopForIO loop; + base::MessageLoopForIO loop; net::TestURLRequestContext context; TestURLRequest r(GURL(url_), &delegate_, &context); r.Start(); EXPECT_TRUE(r.is_pending()); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); EXPECT_EQ(1, delegate_.response_started_count()); EXPECT_FALSE(delegate_.received_data_before_response()); @@ -118,16 +118,16 @@ DWORD WINAPI FetchUrl(void* param) { } struct QuitMessageHit { - explicit QuitMessageHit(MessageLoopForUI* loop) : loop_(loop), hit_(false) { - } + explicit QuitMessageHit(base::MessageLoopForUI* loop) + : loop_(loop), hit_(false) {} - MessageLoopForUI* loop_; + base::MessageLoopForUI* loop_; bool hit_; }; void QuitMessageLoop(QuitMessageHit* msg) { msg->hit_ = true; - msg->loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); + msg->loop_->PostTask(FROM_HERE, base::MessageLoop::QuitClosure()); } } // end namespace @@ -135,7 +135,7 @@ void QuitMessageLoop(QuitMessageHit* msg) { TEST_F(TestServerTest, TestServer) { // The web server needs a loop to exist on this thread during construction // the loop must be created before we construct the server. - MessageLoopForUI loop; + base::MessageLoopForUI loop; test_server::SimpleWebServer server(1337); test_server::SimpleWebServer redirected_server(server.host(), 1338); @@ -177,7 +177,7 @@ TEST_F(TestServerTest, TestServer) { DWORD tid = 0; base::win::ScopedHandle worker(::CreateThread( NULL, 0, FetchUrl, &redir_task, 0, &tid)); - loop.MessageLoop::Run(); + loop.base::MessageLoop::Run(); EXPECT_FALSE(quit_msg.hit_); if (!quit_msg.hit_) { diff --git a/chrome_frame/test/urlmon_moniker_integration_test.cc b/chrome_frame/test/urlmon_moniker_integration_test.cc index 2937df4..c491a00 100644 --- a/chrome_frame/test/urlmon_moniker_integration_test.cc +++ b/chrome_frame/test/urlmon_moniker_integration_test.cc @@ -66,7 +66,7 @@ class RunTestServer : public base::Thread { } bool Start() { - bool ret = StartWithOptions(Options(MessageLoop::TYPE_UI, 0)); + bool ret = StartWithOptions(Options(base::MessageLoop::TYPE_UI, 0)); if (ret) { message_loop()->PostTask(FROM_HERE, base::Bind(&RunTestServer::StartServer, this)); diff --git a/chrome_frame/test/win_event_receiver.cc b/chrome_frame/test/win_event_receiver.cc index c014b64..adb7d82 100644 --- a/chrome_frame/test/win_event_receiver.cc +++ b/chrome_frame/test/win_event_receiver.cc @@ -116,7 +116,7 @@ WindowWatchdog::ProcessExitObserver::ProcessExitObserver( object_watcher_.StartWatching(process_handle_, this); } else { // Process is gone, so the window must be gone too. Notify our observer! - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&ProcessExitObserver::OnObjectSignaled, weak_factory_.GetWeakPtr(), HANDLE(NULL))); } diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc index 2b37d0e..bc21973 100644 --- a/chrome_frame/urlmon_url_request.cc +++ b/chrome_frame/urlmon_url_request.cc @@ -1408,7 +1408,7 @@ UrlmonUrlRequestManager::UrlmonUrlRequestManager() GetConfigBool(true, kUseBackgroundThreadForSubResources); if (background_worker_thread_enabled_) { base::Thread::Options options; - options.message_loop_type = MessageLoop::TYPE_UI; + options.message_loop_type = base::MessageLoop::TYPE_UI; background_thread_->StartWithOptions(options); } } |