diff options
author | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-04 14:17:11 +0000 |
---|---|---|
committer | xhwang@chromium.org <xhwang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-04 14:17:11 +0000 |
commit | dd32b127ce5deac52b24f493dac79195a30bf138 (patch) | |
tree | fe41d5b0b6fb1bcff0ccfc87a9f46cefee602723 /content/renderer | |
parent | 63b5c710324dc630a663eb76a6a4cc1372322830 (diff) | |
download | chromium_src-dd32b127ce5deac52b24f493dac79195a30bf138.zip chromium_src-dd32b127ce5deac52b24f493dac79195a30bf138.tar.gz chromium_src-dd32b127ce5deac52b24f493dac79195a30bf138.tar.bz2 |
content: Use base::MessageLoop.
BUG=236029
R=avi@chromium.org
Review URL: https://chromiumcodereview.appspot.com/14335017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198316 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/renderer')
22 files changed, 92 insertions, 86 deletions
diff --git a/content/renderer/accessibility/renderer_accessibility_complete.cc b/content/renderer/accessibility/renderer_accessibility_complete.cc index c59e0fd..9e5a97b 100644 --- a/content/renderer/accessibility/renderer_accessibility_complete.cc +++ b/content/renderer/accessibility/renderer_accessibility_complete.cc @@ -227,12 +227,11 @@ void RendererAccessibilityComplete::HandleAccessibilityNotification( // When no accessibility notifications are in-flight post a task to send // the notifications to the browser. We use PostTask so that we can queue // up additional notifications. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, - base::Bind( - &RendererAccessibilityComplete:: - SendPendingAccessibilityNotifications, - weak_factory_.GetWeakPtr())); + base::Bind(&RendererAccessibilityComplete:: + SendPendingAccessibilityNotifications, + weak_factory_.GetWeakPtr())); } } diff --git a/content/renderer/browser_plugin/browser_plugin.cc b/content/renderer/browser_plugin/browser_plugin.cc index 1681649..002d2a5 100644 --- a/content/renderer/browser_plugin/browser_plugin.cc +++ b/content/renderer/browser_plugin/browser_plugin.cc @@ -732,7 +732,7 @@ void BrowserPlugin::OnUpdateRect( // with the last seen view size. if (container_ && !size_changed_in_flight_) { size_changed_in_flight_ = true; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&BrowserPlugin::SizeChangedDueToAutoSize, base::Unretained(this), @@ -1012,10 +1012,11 @@ void BrowserPlugin::WeakCallbackForPersistObject( // Asynchronously remove item from |alive_v8_permission_request_objects_|. // Note that we are using weak pointer for the following PostTask, so we // don't need to worry about BrowserPlugin going away. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&BrowserPlugin::OnRequestObjectGarbageCollected, - plugin, request_id)); + plugin, + request_id)); } } @@ -1182,7 +1183,7 @@ void BrowserPlugin::destroy() { // Will be a no-op if the mouse is not currently locked. if (render_view_) render_view_->mouse_lock_dispatcher()->OnLockTargetDestroyed(this); - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } NPObject* BrowserPlugin::scriptableObject() { diff --git a/content/renderer/browser_plugin/mock_browser_plugin_manager.cc b/content/renderer/browser_plugin/mock_browser_plugin_manager.cc index e6da3bc..3759535 100644 --- a/content/renderer/browser_plugin/mock_browser_plugin_manager.cc +++ b/content/renderer/browser_plugin/mock_browser_plugin_manager.cc @@ -30,7 +30,7 @@ BrowserPlugin* MockBrowserPluginManager::CreateBrowserPlugin( void MockBrowserPluginManager::AllocateInstanceID( BrowserPlugin* browser_plugin) { int instance_id = ++browser_plugin_counter_; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&MockBrowserPluginManager::AllocateInstanceIDACK, this, diff --git a/content/renderer/devtools/devtools_agent.cc b/content/renderer/devtools/devtools_agent.cc index 1ab030a..674cbc5 100644 --- a/content/renderer/devtools/devtools_agent.cc +++ b/content/renderer/devtools/devtools_agent.cc @@ -47,19 +47,17 @@ namespace { class WebKitClientMessageLoopImpl : public WebDevToolsAgentClient::WebKitClientMessageLoop { public: - WebKitClientMessageLoopImpl() : message_loop_(MessageLoop::current()) { } - virtual ~WebKitClientMessageLoopImpl() { - message_loop_ = NULL; - } + WebKitClientMessageLoopImpl() : message_loop_(base::MessageLoop::current()) {} + virtual ~WebKitClientMessageLoopImpl() { message_loop_ = NULL; } virtual void run() { - MessageLoop::ScopedNestableTaskAllower allow(message_loop_); + base::MessageLoop::ScopedNestableTaskAllower allow(message_loop_); message_loop_->Run(); } virtual void quitNow() { message_loop_->QuitNow(); } private: - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; }; typedef std::map<int, DevToolsAgent*> IdToAgentMap; diff --git a/content/renderer/devtools/devtools_agent_filter.cc b/content/renderer/devtools/devtools_agent_filter.cc index 7a4e90b..76062d9 100644 --- a/content/renderer/devtools/devtools_agent_filter.cc +++ b/content/renderer/devtools/devtools_agent_filter.cc @@ -42,9 +42,8 @@ class MessageImpl : public WebDevToolsAgent::MessageDescriptor { DevToolsAgentFilter::DevToolsAgentFilter() : message_handled_(false), - render_thread_loop_(MessageLoop::current()), - current_routing_id_(0) { -} + render_thread_loop_(base::MessageLoop::current()), + current_routing_id_(0) {} bool DevToolsAgentFilter::OnMessageReceived(const IPC::Message& message) { // Dispatch debugger commands directly from IO. diff --git a/content/renderer/gpu/input_event_filter_unittest.cc b/content/renderer/gpu/input_event_filter_unittest.cc index b33c8fc..24064db 100644 --- a/content/renderer/gpu/input_event_filter_unittest.cc +++ b/content/renderer/gpu/input_event_filter_unittest.cc @@ -110,7 +110,7 @@ void AddMessagesToFilter(IPC::ChannelProxy::MessageFilter* message_filter, message_filter->OnMessageReceived(events[i]); } - MessageLoop::current()->RunUntilIdle(); + base::MessageLoop::current()->RunUntilIdle(); } void AddEventsToFilter(IPC::ChannelProxy::MessageFilter* message_filter, @@ -142,7 +142,7 @@ class InputEventFilterTest : public testing::Test { protected: - MessageLoop message_loop_; + base::MessageLoop message_loop_; // Used to record IPCs sent by the filter to the RenderWidgetHost. IPC::TestSink ipc_sink_; diff --git a/content/renderer/image_loading_helper.cc b/content/renderer/image_loading_helper.cc index c996984..ff6e2bd 100644 --- a/content/renderer/image_loading_helper.cc +++ b/content/renderer/image_loading_helper.cc @@ -95,7 +95,7 @@ void ImageLoadingHelper::DidDownloadImage( std::find(image_fetchers_.begin(), image_fetchers_.end(), fetcher); if (iter != image_fetchers_.end()) { image_fetchers_.weak_erase(iter); - MessageLoop::current()->DeleteSoon(FROM_HERE, fetcher); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, fetcher); } } diff --git a/content/renderer/load_progress_tracker.cc b/content/renderer/load_progress_tracker.cc index 79e058a..93b79ed 100644 --- a/content/renderer/load_progress_tracker.cc +++ b/content/renderer/load_progress_tracker.cc @@ -68,7 +68,7 @@ void LoadProgressTracker::DidChangeLoadProgress(WebKit::WebFrame* frame, if (weak_factory_.HasWeakPtrs()) return; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&LoadProgressTracker::SendChangeLoadProgress, weak_factory_.GetWeakPtr()), diff --git a/content/renderer/p2p/ipc_network_manager.cc b/content/renderer/p2p/ipc_network_manager.cc index 00ee114..34a65c5 100644 --- a/content/renderer/p2p/ipc_network_manager.cc +++ b/content/renderer/p2p/ipc_network_manager.cc @@ -26,9 +26,10 @@ IpcNetworkManager::~IpcNetworkManager() { void IpcNetworkManager::StartUpdating() { if (network_list_received_) { // Post a task to avoid reentrancy. - MessageLoop::current()->PostTask( - FROM_HERE, base::Bind(&IpcNetworkManager::SendNetworksChangedSignal, - weak_factory_.GetWeakPtr())); + base::MessageLoop::current()->PostTask( + FROM_HERE, + base::Bind(&IpcNetworkManager::SendNetworksChangedSignal, + weak_factory_.GetWeakPtr())); } ++start_count_; } diff --git a/content/renderer/p2p/ipc_socket_factory.cc b/content/renderer/p2p/ipc_socket_factory.cc index 3fd0556..d1f5686 100644 --- a/content/renderer/p2p/ipc_socket_factory.cc +++ b/content/renderer/p2p/ipc_socket_factory.cc @@ -73,7 +73,7 @@ class IpcPacketSocket : public talk_base::AsyncPacketSocket, P2PSocketType type_; // Message loop on which this socket was created and being used. - MessageLoop* message_loop_; + base::MessageLoop* message_loop_; // Corresponding P2P socket client. scoped_refptr<P2PSocketClient> client_; @@ -105,12 +105,11 @@ class IpcPacketSocket : public talk_base::AsyncPacketSocket, IpcPacketSocket::IpcPacketSocket() : type_(P2P_SOCKET_UDP), - message_loop_(MessageLoop::current()), + message_loop_(base::MessageLoop::current()), state_(IS_UNINITIALIZED), send_packets_pending_(0), writable_signal_expected_(false), - error_(0) { -} + error_(0) {} IpcPacketSocket::~IpcPacketSocket() { if (state_ == IS_OPENING || state_ == IS_OPEN || @@ -122,7 +121,7 @@ IpcPacketSocket::~IpcPacketSocket() { bool IpcPacketSocket::Init(P2PSocketType type, P2PSocketClient* client, const talk_base::SocketAddress& local_address, const talk_base::SocketAddress& remote_address) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); DCHECK_EQ(state_, IS_UNINITIALIZED); type_ = type; @@ -151,7 +150,7 @@ void IpcPacketSocket::InitAcceptedTcp( P2PSocketClient* client, const talk_base::SocketAddress& local_address, const talk_base::SocketAddress& remote_address) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); DCHECK_EQ(state_, IS_UNINITIALIZED); client_ = client; @@ -163,23 +162,23 @@ void IpcPacketSocket::InitAcceptedTcp( // talk_base::AsyncPacketSocket interface. talk_base::SocketAddress IpcPacketSocket::GetLocalAddress() const { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); return local_address_; } talk_base::SocketAddress IpcPacketSocket::GetRemoteAddress() const { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); return remote_address_; } int IpcPacketSocket::Send(const void *data, size_t data_size) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); return SendTo(data, data_size, remote_address_); } int IpcPacketSocket::SendTo(const void *data, size_t data_size, const talk_base::SocketAddress& address) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); switch (state_) { case IS_UNINITIALIZED: @@ -221,7 +220,7 @@ int IpcPacketSocket::SendTo(const void *data, size_t data_size, } int IpcPacketSocket::Close() { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); client_->Close(); state_ = IS_CLOSED; @@ -230,7 +229,7 @@ int IpcPacketSocket::Close() { } talk_base::AsyncPacketSocket::State IpcPacketSocket::GetState() const { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); switch (state_) { case IS_UNINITIALIZED: @@ -267,17 +266,17 @@ int IpcPacketSocket::SetOption(talk_base::Socket::Option opt, int value) { } int IpcPacketSocket::GetError() const { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); return error_; } void IpcPacketSocket::SetError(int error) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); error_ = error; } void IpcPacketSocket::OnOpen(const net::IPEndPoint& address) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); if (!jingle_glue::IPEndPointToSocketAddress(address, &local_address_)) { // Always expect correct IPv4 address to be allocated. @@ -296,7 +295,7 @@ void IpcPacketSocket::OnOpen(const net::IPEndPoint& address) { void IpcPacketSocket::OnIncomingTcpConnection( const net::IPEndPoint& address, P2PSocketClient* client) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); scoped_ptr<IpcPacketSocket> socket(new IpcPacketSocket()); @@ -310,7 +309,7 @@ void IpcPacketSocket::OnIncomingTcpConnection( } void IpcPacketSocket::OnSendComplete() { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); --send_packets_pending_; DCHECK_GE(send_packets_pending_, 0); @@ -323,14 +322,14 @@ void IpcPacketSocket::OnSendComplete() { } void IpcPacketSocket::OnError() { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); state_ = IS_ERROR; error_ = ECONNABORTED; } void IpcPacketSocket::OnDataReceived(const net::IPEndPoint& address, const std::vector<char>& data) { - DCHECK_EQ(MessageLoop::current(), message_loop_); + DCHECK_EQ(base::MessageLoop::current(), message_loop_); talk_base::SocketAddress address_lj; if (!jingle_glue::IPEndPointToSocketAddress(address, &address_lj)) { diff --git a/content/renderer/pepper/pepper_broker_impl_unittest.cc b/content/renderer/pepper/pepper_broker_impl_unittest.cc index aa61bf8..dc894a9 100644 --- a/content/renderer/pepper/pepper_broker_impl_unittest.cc +++ b/content/renderer/pepper/pepper_broker_impl_unittest.cc @@ -16,7 +16,7 @@ namespace content { class PepperBrokerImplTest : public ::testing::Test { protected: - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; // We need a render process for ppapi::proxy::ProxyChannel to work. MockRenderProcess mock_process_; }; diff --git a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc index 26788f8..2352673 100644 --- a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc +++ b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc @@ -70,10 +70,13 @@ class PepperDeviceEnumerationHostHelper::ScopedRequest bool succeeded, const std::vector<ppapi::DeviceRefData>& devices) { if (sync_call_) { - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, - base::Bind(&ScopedRequest::EnumerateDevicesCallbackBody, AsWeakPtr(), - request_id, succeeded, devices)); + base::Bind(&ScopedRequest::EnumerateDevicesCallbackBody, + AsWeakPtr(), + request_id, + succeeded, + devices)); } else { DCHECK_EQ(request_id_, request_id); callback_.Run(request_id, succeeded, devices); diff --git a/content/renderer/pepper/pepper_graphics_2d_host.cc b/content/renderer/pepper/pepper_graphics_2d_host.cc index 89a43e9..778f4f0 100644 --- a/content/renderer/pepper/pepper_graphics_2d_host.cc +++ b/content/renderer/pepper/pepper_graphics_2d_host.cc @@ -725,7 +725,7 @@ void PepperGraphics2DHost::SendOffscreenFlushAck() { void PepperGraphics2DHost::ScheduleOffscreenFlushAck() { offscreen_flush_pending_ = true; - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, base::Bind(&PepperGraphics2DHost::SendOffscreenFlushAck, weak_ptr_factory_.GetWeakPtr()), diff --git a/content/renderer/pepper/pepper_in_process_router.cc b/content/renderer/pepper/pepper_in_process_router.cc index 62f7dbd..acd4226 100644 --- a/content/renderer/pepper/pepper_in_process_router.cc +++ b/content/renderer/pepper/pepper_in_process_router.cc @@ -94,11 +94,11 @@ bool PepperInProcessRouter::SendToPlugin(IPC::Message* msg) { } else { CHECK(!pending_message_id_); // Dispatch plugin messages from the message loop. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&PepperInProcessRouter::DispatchPluginMsg, - weak_factory_.GetWeakPtr(), - base::Owned(message.release()))); + weak_factory_.GetWeakPtr(), + base::Owned(message.release()))); } return true; } diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc index 89e3be8..110e1bc 100644 --- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc +++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc @@ -1406,11 +1406,12 @@ int PepperPluginDelegateImpl::EnumerateDevices( PepperDeviceEnumerationEventHandler::FromPepperDeviceType(type), GURL()); #else - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind( &PepperDeviceEnumerationEventHandler::OnDevicesEnumerationFailed, - device_enumeration_event_handler_->AsWeakPtr(), request_id)); + device_enumeration_event_handler_->AsWeakPtr(), + request_id)); #endif return request_id; @@ -1423,12 +1424,12 @@ void PepperPluginDelegateImpl::StopEnumerateDevices(int request_id) { #if defined(ENABLE_WEBRTC) // Need to post task since this function might be called inside the callback // of EnumerateDevices. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, - base::Bind( - &MediaStreamDispatcher::StopEnumerateDevices, - render_view_->media_stream_dispatcher()->AsWeakPtr(), - request_id, device_enumeration_event_handler_.get()->AsWeakPtr())); + base::Bind(&MediaStreamDispatcher::StopEnumerateDevices, + render_view_->media_stream_dispatcher()->AsWeakPtr(), + request_id, + device_enumeration_event_handler_.get()->AsWeakPtr())); #endif } @@ -1570,10 +1571,11 @@ int PepperPluginDelegateImpl::OpenDevice(PP_DeviceType_Dev type, PepperDeviceEnumerationEventHandler::FromPepperDeviceType(type), GURL()); #else - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&PepperDeviceEnumerationEventHandler::OnDeviceOpenFailed, - device_enumeration_event_handler_->AsWeakPtr(), request_id)); + device_enumeration_event_handler_->AsWeakPtr(), + request_id)); #endif return request_id; diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc index 68b6450..28acc8b 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc @@ -729,7 +729,7 @@ void RenderThreadImpl::EnsureWebKitInitialized() { bool enable = command_line.HasSwitch(switches::kEnableThreadedCompositing); if (enable) { - MessageLoop* override_loop = + base::MessageLoop* override_loop = GetContentClient()->renderer()->OverrideCompositorMessageLoop(); if (override_loop) { compositor_message_loop_proxy_ = override_loop->message_loop_proxy(); @@ -854,7 +854,7 @@ scoped_ptr<base::SharedMemory> new ChildProcessHostMsg_SyncAllocateSharedMemory(size, &handle); // Allow calling this from the compositor thread. - if (MessageLoop::current() == message_loop()) + if (base::MessageLoop::current() == message_loop()) success = ChildThread::Send(message); else success = sync_message_filter()->Send(message); @@ -1097,7 +1097,8 @@ bool RenderThreadImpl::IsMainThread() { } bool RenderThreadImpl::IsIOThread() { - return MessageLoop::current() == ChildProcess::current()->io_message_loop(); + return base::MessageLoop::current() == + ChildProcess::current()->io_message_loop(); } MessageLoop* RenderThreadImpl::GetMainLoop() { @@ -1132,7 +1133,7 @@ int32 RenderThreadImpl::CreateViewCommandBuffer( &route_id); // Allow calling this from the compositor thread. - if (MessageLoop::current() == message_loop()) + if (base::MessageLoop::current() == message_loop()) ChildThread::Send(message); else sync_message_filter()->Send(message); @@ -1330,7 +1331,7 @@ void RenderThreadImpl::OnSetWebKitSharedTimersSuspended(bool suspend) { scoped_refptr<base::MessageLoopProxy> RenderThreadImpl::GetFileThreadMessageLoopProxy() { - DCHECK(message_loop() == MessageLoop::current()); + DCHECK(message_loop() == base::MessageLoop::current()); if (!file_thread_) { file_thread_.reset(new base::Thread("Renderer::FILE")); file_thread_->Start(); diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h index 8d2fd2a..be9b176 100644 --- a/content/renderer/render_thread_impl.h +++ b/content/renderer/render_thread_impl.h @@ -115,7 +115,7 @@ class CONTENT_EXPORT RenderThreadImpl : public RenderThread, // RenderThread implementation: virtual bool Send(IPC::Message* msg) OVERRIDE; - virtual MessageLoop* GetMessageLoop() OVERRIDE; + virtual base::MessageLoop* GetMessageLoop() OVERRIDE; virtual IPC::SyncChannel* GetChannel() OVERRIDE; virtual std::string GetLocale() OVERRIDE; virtual IPC::SyncMessageFilter* GetSyncMessageFilter() OVERRIDE; @@ -158,7 +158,7 @@ class CONTENT_EXPORT RenderThreadImpl : public RenderThread, // GpuChannelHostFactory implementation: virtual bool IsMainThread() OVERRIDE; virtual bool IsIOThread() OVERRIDE; - virtual MessageLoop* GetMainLoop() OVERRIDE; + virtual base::MessageLoop* GetMainLoop() OVERRIDE; virtual scoped_refptr<base::MessageLoopProxy> GetIOLoopProxy() OVERRIDE; virtual base::WaitableEvent* GetShutDownEvent() OVERRIDE; virtual scoped_ptr<base::SharedMemory> AllocateSharedMemory( diff --git a/content/renderer/render_thread_impl_browsertest.cc b/content/renderer/render_thread_impl_browsertest.cc index 79eb6bc..d8dc67b 100644 --- a/content/renderer/render_thread_impl_browsertest.cc +++ b/content/renderer/render_thread_impl_browsertest.cc @@ -38,7 +38,7 @@ TEST_F(RenderThreadImplBrowserTest, ContentRendererClient content_renderer_client; SetRendererClientForTesting(&content_renderer_client); - MessageLoopForIO message_loop_; + base::MessageLoopForIO message_loop_; std::string channel_id = IPC::Channel::GenerateVerifiedChannelID( std::string()); diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc index 5ea62ca..2150615 100644 --- a/content/renderer/render_view_impl.cc +++ b/content/renderer/render_view_impl.cc @@ -6286,10 +6286,12 @@ WebContentDetectionResult RenderViewImpl::detectContentAround( void RenderViewImpl::scheduleContentIntent(const WebURL& intent) { // Introduce a short delay so that the user can notice the content. - MessageLoop::current()->PostDelayedTask( + base::MessageLoop::current()->PostDelayedTask( FROM_HERE, - base::Bind(&RenderViewImpl::LaunchAndroidContentIntent, AsWeakPtr(), - intent, expected_content_intent_id_), + base::Bind(&RenderViewImpl::LaunchAndroidContentIntent, + AsWeakPtr(), + intent, + expected_content_intent_id_), base::TimeDelta::FromMilliseconds(kContentIntentDelayMilliseconds)); } diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc index b681e5d..1939bb6 100644 --- a/content/renderer/render_widget.cc +++ b/content/renderer/render_widget.cc @@ -426,7 +426,7 @@ void RenderWidget::OnClose() { // If there is a Send call on the stack, then it could be dangerous to close // now. Post a task that only gets invoked when there are no nested message // loops. - MessageLoop::current()->PostNonNestableTask( + base::MessageLoop::current()->PostNonNestableTask( FROM_HERE, base::Bind(&RenderWidget::Close, this)); // Balances the AddRef taken when we called AddRoute. @@ -1325,7 +1325,7 @@ void RenderWidget::didInvalidateRect(const WebRect& rect) { // 2) Allows us to collect more damage rects before painting to help coalesce // the work that we will need to do. invalidation_task_posted_ = true; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&RenderWidget::InvalidationCallback, this)); } @@ -1366,7 +1366,7 @@ void RenderWidget::didScrollRect(int dx, int dy, // 2) Allows us to collect more damage rects before painting to help coalesce // the work that we will need to do. invalidation_task_posted_ = true; - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&RenderWidget::InvalidationCallback, this)); } @@ -1610,7 +1610,7 @@ void RenderWidget::closeWidgetSoon() { // could be closed before the JS finishes executing. So instead, post a // message back to the message loop, which won't run until the JS is // complete, and then the Close message can be sent. - MessageLoop::current()->PostTask( + base::MessageLoop::current()->PostTask( FROM_HERE, base::Bind(&RenderWidget::DoDeferredClose, this)); } diff --git a/content/renderer/renderer_main.cc b/content/renderer/renderer_main.cc index b69c0df..cc8e584 100644 --- a/content/renderer/renderer_main.cc +++ b/content/renderer/renderer_main.cc @@ -64,7 +64,7 @@ static void HandleRendererErrorTestParameters(const CommandLine& command_line) { // This is a simplified version of the browser Jankometer, which measures // the processing time of tasks on the render thread. -class RendererMessageLoopObserver : public MessageLoop::TaskObserver { +class RendererMessageLoopObserver : public base::MessageLoop::TaskObserver { public: RendererMessageLoopObserver() : process_times_(base::Histogram::FactoryGet( @@ -88,7 +88,7 @@ class RendererMessageLoopObserver : public MessageLoop::TaskObserver { }; // For measuring memory usage after each task. Behind a command line flag. -class MemoryObserver : public MessageLoop::TaskObserver { +class MemoryObserver : public base::MessageLoop::TaskObserver { public: MemoryObserver() {} virtual ~MemoryObserver() {} @@ -145,12 +145,13 @@ int RendererMain(const MainFunctionParams& parameters) { #if defined(OS_MACOSX) // As long as we use Cocoa in the renderer (for the forseeable future as of // now; see http://crbug.com/13890 for info) we need to have a UI loop. - MessageLoop main_message_loop(MessageLoop::TYPE_UI); + base::MessageLoop main_message_loop(base::MessageLoop::TYPE_UI); #else // The main message loop of the renderer services doesn't have IO or UI tasks, // unless in-process-plugins is used. - MessageLoop main_message_loop(RenderProcessImpl::InProcessPlugins() ? - MessageLoop::TYPE_UI : MessageLoop::TYPE_DEFAULT); + base::MessageLoop main_message_loop(RenderProcessImpl::InProcessPlugins() + ? base::MessageLoop::TYPE_UI + : base::MessageLoop::TYPE_DEFAULT); #endif main_message_loop.AddTaskObserver(&task_observer); @@ -231,7 +232,7 @@ int RendererMain(const MainFunctionParams& parameters) { pool->Recycle(); #endif TRACE_EVENT_BEGIN_ETW("RendererMain.START_MSG_LOOP", 0, 0); - MessageLoop::current()->Run(); + base::MessageLoop::current()->Run(); TRACE_EVENT_END_ETW("RendererMain.START_MSG_LOOP", 0, 0); } } diff --git a/content/renderer/webplugin_delegate_proxy.cc b/content/renderer/webplugin_delegate_proxy.cc index bc0f057..c3459ed 100644 --- a/content/renderer/webplugin_delegate_proxy.cc +++ b/content/renderer/webplugin_delegate_proxy.cc @@ -168,14 +168,14 @@ class ResourceClientProxy : public webkit::npapi::WebPluginResourceClient { DCHECK(channel_ != NULL); channel_->Send(new PluginMsg_DidFinishLoading(instance_id_, resource_id_)); channel_ = NULL; - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } virtual void DidFail() OVERRIDE { DCHECK(channel_ != NULL); channel_->Send(new PluginMsg_DidFail(instance_id_, resource_id_)); channel_ = NULL; - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } virtual bool IsMultiByteResponseExpected() OVERRIDE { @@ -279,7 +279,7 @@ void WebPluginDelegateProxy::PluginDestroyed() { plugin_ = NULL; - MessageLoop::current()->DeleteSoon(FROM_HERE, this); + base::MessageLoop::current()->DeleteSoon(FROM_HERE, this); } bool WebPluginDelegateProxy::Initialize( |