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

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

Issue 9937001: PPAPI: Refactor ppapi test callbacks to ease testing blocking callbacks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: working locally... Created 8 years, 8 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 | « no previous file | ppapi/tests/test_case.h » ('j') | ppapi/tests/test_file_system.cc » ('J')
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/plugin_proxy_delegate.h" 8 #include "ppapi/proxy/plugin_proxy_delegate.h"
9 #include "ppapi/proxy/ppapi_messages.h" 9 #include "ppapi/proxy/ppapi_messages.h"
10 #include "ppapi/thunk/ppb_network_monitor_private_api.h" 10 #include "ppapi/thunk/ppb_network_monitor_private_api.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 // If that is the first network monitor then send Start message. 91 // If that is the first network monitor then send Start message.
92 PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser( 92 PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser(
93 new PpapiHostMsg_PPBNetworkMonitor_Start( 93 new PpapiHostMsg_PPBNetworkMonitor_Start(
94 dispatcher->plugin_dispatcher_id())); 94 dispatcher->plugin_dispatcher_id()));
95 95
96 // We could have received network list message after sending the 96 // We could have received network list message after sending the
97 // previous Stop message. This list is stale now, so reset it 97 // previous Stop message. This list is stale now, so reset it
98 // here. 98 // here.
99 proxy->current_list_ = NULL; 99 proxy->current_list_ = NULL;
100 } else if (proxy->current_list_.get()) { 100 } else if (proxy->current_list_.get()) {
101 MessageLoop::current()->PostTask(FROM_HERE, base::Bind( 101 MessageLoop::current()->PostTask(FROM_HERE, RunWhileLocked(base::Bind(
dmichael (off chromium) 2012/04/02 21:15:02 somewhat unrelated, but causes problems running th
bbudge 2012/04/04 19:03:00 Does it also cause problems in normal use? Is ther
dmichael (off chromium) 2012/04/04 19:50:47 Yes, but locking is not enabled yet, so RunWhileLo
102 &NetworkMonitor::OnNetworkListReceived, 102 &NetworkMonitor::OnNetworkListReceived,
103 result->AsWeakPtr(), proxy->current_list_)); 103 result->AsWeakPtr(), proxy->current_list_)));
104 } 104 }
105 105
106 return result.release()->GetReference(); 106 return result.release()->GetReference();
107 } 107 }
108 108
109 bool PPB_NetworkMonitor_Private_Proxy::OnMessageReceived( 109 bool PPB_NetworkMonitor_Private_Proxy::OnMessageReceived(
110 const IPC::Message& msg) { 110 const IPC::Message& msg) {
111 bool handled = true; 111 bool handled = true;
112 IPC_BEGIN_MESSAGE_MAP(PPB_NetworkMonitor_Private_Proxy, msg) 112 IPC_BEGIN_MESSAGE_MAP(PPB_NetworkMonitor_Private_Proxy, msg)
113 IPC_MESSAGE_HANDLER(PpapiMsg_PPBNetworkMonitor_NetworkList, 113 IPC_MESSAGE_HANDLER(PpapiMsg_PPBNetworkMonitor_NetworkList,
(...skipping 23 matching lines...) Expand all
137 PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser( 137 PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser(
138 new PpapiHostMsg_PPBNetworkMonitor_Stop( 138 new PpapiHostMsg_PPBNetworkMonitor_Stop(
139 dispatcher->plugin_dispatcher_id())); 139 dispatcher->plugin_dispatcher_id()));
140 } 140 }
141 current_list_ = NULL; 141 current_list_ = NULL;
142 } 142 }
143 } 143 }
144 144
145 } // namespace proxy 145 } // namespace proxy
146 } // namespace ppapi 146 } // namespace ppapi
OLDNEW
« no previous file with comments | « no previous file | ppapi/tests/test_case.h » ('j') | ppapi/tests/test_file_system.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698