diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-04 14:28:28 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-04 14:28:28 +0000 |
commit | a3b041c9461bafc70e1b5de429a40fb6a6bc300b (patch) | |
tree | fc3884b6768e4f875e2018217207bde834415b4f | |
parent | 2e8f4677c5a2885ba9af9c322827c5a487b7ad60 (diff) | |
download | chromium_src-a3b041c9461bafc70e1b5de429a40fb6a6bc300b.zip chromium_src-a3b041c9461bafc70e1b5de429a40fb6a6bc300b.tar.gz chromium_src-a3b041c9461bafc70e1b5de429a40fb6a6bc300b.tar.bz2 |
win8: Use base::MessageLoop.
BUG=236029
R=ananta@chromium.org
Review URL: https://chromiumcodereview.appspot.com/14520027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198323 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | win8/metro_driver/chrome_app_view.cc | 11 | ||||
-rw-r--r-- | win8/metro_driver/chrome_app_view_ash.cc | 14 | ||||
-rw-r--r-- | win8/metro_driver/print_handler.cc | 12 | ||||
-rw-r--r-- | win8/test/open_with_dialog_controller.cc | 5 |
4 files changed, 20 insertions, 22 deletions
diff --git a/win8/metro_driver/chrome_app_view.cc b/win8/metro_driver/chrome_app_view.cc index ef2baf7..15c48d6 100644 --- a/win8/metro_driver/chrome_app_view.cc +++ b/win8/metro_driver/chrome_app_view.cc @@ -753,7 +753,7 @@ ChromeAppView::Load(HSTRING entryPoint) { void RunMessageLoop(winui::Core::ICoreDispatcher* dispatcher) { // We're entering a nested message loop, let's allow dispatching // tasks while we're in there. - MessageLoop::current()->SetNestableTasksAllowed(true); + base::MessageLoop::current()->SetNestableTasksAllowed(true); // Enter main core message loop. There are several ways to exit it // Nicely: @@ -765,7 +765,7 @@ void RunMessageLoop(winui::Core::ICoreDispatcher* dispatcher) { ::CoreProcessEventsOption_ProcessUntilQuit); // Wind down the thread's chrome message loop. - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } void ChromeAppView::CheckForOSKActivation() { @@ -798,10 +798,9 @@ void ChromeAppView::CheckForOSKActivation() { } } } - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, - base::Bind(&ChromeAppView::CheckForOSKActivation, - base::Unretained(this)), + base::Bind(&ChromeAppView::CheckForOSKActivation, base::Unretained(this)), base::TimeDelta::FromMilliseconds(kCheckOSKDelayMs)); } @@ -820,7 +819,7 @@ ChromeAppView::Run() { } // Create a message loop to allow message passing into this thread. - MessageLoop msg_loop(MessageLoop::TYPE_UI); + base::MessageLoop msg_loop(base::MessageLoop::TYPE_UI); // Announce our message loop to the world. globals.appview_msg_loop = msg_loop.message_loop_proxy(); diff --git a/win8/metro_driver/chrome_app_view_ash.cc b/win8/metro_driver/chrome_app_view_ash.cc index d007a86..8c296cc 100644 --- a/win8/metro_driver/chrome_app_view_ash.cc +++ b/win8/metro_driver/chrome_app_view_ash.cc @@ -73,10 +73,8 @@ void MetroExit() { class ChromeChannelListener : public IPC::Listener { public: - ChromeChannelListener(MessageLoop* ui_loop, ChromeAppViewAsh* app_view) - : ui_proxy_(ui_loop->message_loop_proxy()), - app_view_(app_view) { - } + ChromeChannelListener(base::MessageLoop* ui_loop, ChromeAppViewAsh* app_view) + : ui_proxy_(ui_loop->message_loop_proxy()), app_view_(app_view) {} virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE { IPC_BEGIN_MESSAGE_MAP(ChromeChannelListener, message) @@ -253,7 +251,7 @@ class PointerInfoHandler { void RunMessageLoop(winui::Core::ICoreDispatcher* dispatcher) { // We're entering a nested message loop, let's allow dispatching // tasks while we're in there. - MessageLoop::current()->SetNestableTasksAllowed(true); + base::MessageLoop::current()->SetNestableTasksAllowed(true); // Enter main core message loop. There are several ways to exit it // Nicely: @@ -265,7 +263,7 @@ void RunMessageLoop(winui::Core::ICoreDispatcher* dispatcher) { ::CoreProcessEventsOption_ProcessUntilQuit); // Wind down the thread's chrome message loop. - MessageLoop::current()->Quit(); + base::MessageLoop::current()->Quit(); } // Helper to return the state of the shift/control/alt keys. @@ -406,12 +404,12 @@ ChromeAppViewAsh::Run() { } // Create a message loop to allow message passing into this thread. - MessageLoop msg_loop(MessageLoop::TYPE_UI); + base::MessageLoop msg_loop(base::MessageLoop::TYPE_UI); // Create the IPC channel IO thread. It needs to out-live the ChannelProxy. base::Thread io_thread("metro_IO_thread"); base::Thread::Options options; - options.message_loop_type = MessageLoop::TYPE_IO; + options.message_loop_type = base::MessageLoop::TYPE_IO; io_thread.StartWithOptions(options); std::string ipc_channel_name("viewer"); diff --git a/win8/metro_driver/print_handler.cc b/win8/metro_driver/print_handler.cc index 43563b2f..3539c9e 100644 --- a/win8/metro_driver/print_handler.cc +++ b/win8/metro_driver/print_handler.cc @@ -365,7 +365,7 @@ HRESULT PrintHandler::LogicalDpiChanged(IInspectable *sender) { } void PrintHandler::OnLogicalDpiChanged(float dpi) { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); // No need to protect the access to the static variable, // since it's set/released in this same thread. if (current_document_source_.Get() != NULL) @@ -374,7 +374,7 @@ void PrintHandler::OnLogicalDpiChanged(float dpi) { void PrintHandler::SetPrintDocumentSource( const mswr::ComPtr<PrintDocumentSource>& print_document_source) { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); DCHECK(current_document_source_.Get() == NULL); { // Protect against the other thread which might try to access it. @@ -391,7 +391,7 @@ void PrintHandler::SetPrintDocumentSource( } void PrintHandler::ReleasePrintDocumentSource() { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); mswr::ComPtr<PrintDocumentSource> print_document_source; { // Must wait for other thread to be done with the pointer first. @@ -404,7 +404,7 @@ void PrintHandler::ReleasePrintDocumentSource() { } void PrintHandler::OnEnablePrinting(bool printing_enabled) { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); base::AutoLock lock(*lock_); printing_enabled_ = printing_enabled; // Don't abort if we are being disabled since we may be finishing a previous @@ -415,7 +415,7 @@ void PrintHandler::OnEnablePrinting(bool printing_enabled) { } void PrintHandler::OnSetPageCount(size_t page_count) { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); // No need to protect the access to the static variable, // since it's set/released in this same thread. if (current_document_source_.Get() != NULL) @@ -424,7 +424,7 @@ void PrintHandler::OnSetPageCount(size_t page_count) { void PrintHandler::OnAddPage(size_t page_number, mswr::ComPtr<IStream> metafile_stream) { - DCHECK(MessageLoop::current() == thread_->message_loop()); + DCHECK(base::MessageLoop::current() == thread_->message_loop()); // No need to protect the access to the static variable, // since it's set/released in this same thread. if (current_document_source_.Get() != NULL) diff --git a/win8/test/open_with_dialog_controller.cc b/win8/test/open_with_dialog_controller.cc index 4ae24f0..1524a0d 100644 --- a/win8/test/open_with_dialog_controller.cc +++ b/win8/test/open_with_dialog_controller.cc @@ -267,14 +267,15 @@ HRESULT OpenWithDialogController::RunSynchronously( const string16& protocol, const string16& program, std::vector<string16>* choices) { - DCHECK_EQ(MessageLoop::current(), static_cast<MessageLoop*>(NULL)); + DCHECK_EQ(base::MessageLoop::current(), + static_cast<base::MessageLoop*>(NULL)); if (base::win::GetVersion() < base::win::VERSION_WIN8) { NOTREACHED() << "Windows 8 is required."; return E_FAIL; } HRESULT result = S_OK; - MessageLoop message_loop; + base::MessageLoop message_loop; base::RunLoop run_loop; message_loop.PostTask( |