Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Side by Side Diff: ppapi/proxy/ppb_network_monitor_private_proxy.cc

Issue 14273043: ppapi: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/proxy/ppb_message_loop_proxy.cc ('k') | ppapi/proxy/ppb_testing_proxy.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ppapi/proxy/ppb_network_monitor_private_proxy.h" 5 #include "ppapi/proxy/ppb_network_monitor_private_proxy.h"
6 6
7 #include "ppapi/proxy/enter_proxy.h" 7 #include "ppapi/proxy/enter_proxy.h"
8 #include "ppapi/proxy/ppapi_messages.h" 8 #include "ppapi/proxy/ppapi_messages.h"
9 #include "ppapi/shared_impl/proxy_lock.h" 9 #include "ppapi/shared_impl/proxy_lock.h"
10 #include "ppapi/thunk/ppb_network_monitor_private_api.h" 10 #include "ppapi/thunk/ppb_network_monitor_private_api.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 // If that is the first network monitor then send Start message. 99 // If that is the first network monitor then send Start message.
100 PluginGlobals::Get()->GetBrowserSender()->Send( 100 PluginGlobals::Get()->GetBrowserSender()->Send(
101 new PpapiHostMsg_PPBNetworkMonitor_Start( 101 new PpapiHostMsg_PPBNetworkMonitor_Start(
102 dispatcher->plugin_dispatcher_id())); 102 dispatcher->plugin_dispatcher_id()));
103 103
104 // We could have received network list message after sending the 104 // We could have received network list message after sending the
105 // previous Stop message. This list is stale now, so reset it 105 // previous Stop message. This list is stale now, so reset it
106 // here. 106 // here.
107 proxy->current_list_ = NULL; 107 proxy->current_list_ = NULL;
108 } else if (proxy->current_list_.get()) { 108 } else if (proxy->current_list_.get()) {
109 MessageLoop::current()->PostTask(FROM_HERE, base::Bind( 109 base::MessageLoop::current()->PostTask(
110 &NetworkMonitor::OnNetworkListReceivedLocks, 110 FROM_HERE,
111 result->AsWeakPtr(), proxy->current_list_)); 111 base::Bind(&NetworkMonitor::OnNetworkListReceivedLocks,
112 result->AsWeakPtr(),
113 proxy->current_list_));
112 } 114 }
113 115
114 return result->GetReference(); 116 return result->GetReference();
115 } 117 }
116 118
117 bool PPB_NetworkMonitor_Private_Proxy::OnMessageReceived( 119 bool PPB_NetworkMonitor_Private_Proxy::OnMessageReceived(
118 const IPC::Message& msg) { 120 const IPC::Message& msg) {
119 bool handled = true; 121 bool handled = true;
120 IPC_BEGIN_MESSAGE_MAP(PPB_NetworkMonitor_Private_Proxy, msg) 122 IPC_BEGIN_MESSAGE_MAP(PPB_NetworkMonitor_Private_Proxy, msg)
121 IPC_MESSAGE_HANDLER(PpapiMsg_PPBNetworkMonitor_NetworkList, 123 IPC_MESSAGE_HANDLER(PpapiMsg_PPBNetworkMonitor_NetworkList,
(...skipping 23 matching lines...) Expand all
145 PluginGlobals::Get()->GetBrowserSender()->Send( 147 PluginGlobals::Get()->GetBrowserSender()->Send(
146 new PpapiHostMsg_PPBNetworkMonitor_Stop( 148 new PpapiHostMsg_PPBNetworkMonitor_Stop(
147 dispatcher->plugin_dispatcher_id())); 149 dispatcher->plugin_dispatcher_id()));
148 } 150 }
149 current_list_ = NULL; 151 current_list_ = NULL;
150 } 152 }
151 } 153 }
152 154
153 } // namespace proxy 155 } // namespace proxy
154 } // namespace ppapi 156 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_message_loop_proxy.cc ('k') | ppapi/proxy/ppb_testing_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698