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

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

Issue 10909244: PPAPI: Get TrackedCallback ready for running on non-main threads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged. Created 8 years, 1 month 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/flash_device_id_resource.cc ('k') | ppapi/proxy/ppb_file_system_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_broker_proxy.h" 5 #include "ppapi/proxy/ppb_broker_proxy.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/trusted/ppb_broker_trusted.h" 9 #include "ppapi/c/trusted/ppb_broker_trusted.h"
10 #include "ppapi/proxy/enter_proxy.h" 10 #include "ppapi/proxy/enter_proxy.h"
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 // and then close them. This failure case is not performance critical. 101 // and then close them. This failure case is not performance critical.
102 base::SyncSocket temp_socket( 102 base::SyncSocket temp_socket(
103 IPC::PlatformFileForTransitToPlatformFile(socket_handle)); 103 IPC::PlatformFileForTransitToPlatformFile(socket_handle));
104 } 104 }
105 105
106 if (!TrackedCallback::IsPending(current_connect_callback_)) { 106 if (!TrackedCallback::IsPending(current_connect_callback_)) {
107 // The handle might leak if the plugin never calls GetHandle(). 107 // The handle might leak if the plugin never calls GetHandle().
108 return; 108 return;
109 } 109 }
110 110
111 TrackedCallback::ClearAndRun(&current_connect_callback_, result); 111 current_connect_callback_->Run(result);
112 } 112 }
113 113
114 PPB_Broker_Proxy::PPB_Broker_Proxy(Dispatcher* dispatcher) 114 PPB_Broker_Proxy::PPB_Broker_Proxy(Dispatcher* dispatcher)
115 : InterfaceProxy(dispatcher), 115 : InterfaceProxy(dispatcher),
116 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)){ 116 callback_factory_(ALLOW_THIS_IN_INITIALIZER_LIST(this)){
117 } 117 }
118 118
119 PPB_Broker_Proxy::~PPB_Broker_Proxy() { 119 PPB_Broker_Proxy::~PPB_Broker_Proxy() {
120 } 120 }
121 121
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 // The easiest way to clean it up is to just put it in an object 222 // The easiest way to clean it up is to just put it in an object
223 // and then close it. This failure case is not performance critical. 223 // and then close it. This failure case is not performance critical.
224 // The handle could still leak if Send succeeded but the IPC later failed. 224 // The handle could still leak if Send succeeded but the IPC later failed.
225 base::SyncSocket temp_socket( 225 base::SyncSocket temp_socket(
226 IPC::PlatformFileForTransitToPlatformFile(foreign_socket_handle)); 226 IPC::PlatformFileForTransitToPlatformFile(foreign_socket_handle));
227 } 227 }
228 } 228 }
229 229
230 } // namespace proxy 230 } // namespace proxy
231 } // namespace ppapi 231 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/flash_device_id_resource.cc ('k') | ppapi/proxy/ppb_file_system_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698