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

Side by Side Diff: ppapi/proxy/ppb_instance_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/ppb_graphics_2d_proxy.cc ('k') | ppapi/proxy/ppb_talk_private_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_instance_proxy.h" 5 #include "ppapi/proxy/ppb_instance_proxy.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "ppapi/c/pp_errors.h" 8 #include "ppapi/c/pp_errors.h"
9 #include "ppapi/c/pp_time.h" 9 #include "ppapi/c/pp_time.h"
10 #include "ppapi/c/pp_var.h" 10 #include "ppapi/c/pp_var.h"
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after
1164 int32_t result) { 1164 int32_t result) {
1165 // Save the mouse callback on the instance data. 1165 // Save the mouse callback on the instance data.
1166 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> 1166 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
1167 GetInstanceData(instance); 1167 GetInstanceData(instance);
1168 if (!data) 1168 if (!data)
1169 return; // Instance was probably deleted. 1169 return; // Instance was probably deleted.
1170 if (!TrackedCallback::IsPending(data->mouse_lock_callback)) { 1170 if (!TrackedCallback::IsPending(data->mouse_lock_callback)) {
1171 NOTREACHED(); 1171 NOTREACHED();
1172 return; 1172 return;
1173 } 1173 }
1174 TrackedCallback::ClearAndRun(&(data->mouse_lock_callback), result); 1174 data->mouse_lock_callback->Run(result);
1175 } 1175 }
1176 1176
1177 void PPB_Instance_Proxy::MouseLockCompleteInHost(int32_t result, 1177 void PPB_Instance_Proxy::MouseLockCompleteInHost(int32_t result,
1178 PP_Instance instance) { 1178 PP_Instance instance) {
1179 dispatcher()->Send(new PpapiMsg_PPBInstance_MouseLockComplete( 1179 dispatcher()->Send(new PpapiMsg_PPBInstance_MouseLockComplete(
1180 API_ID_PPB_INSTANCE, instance, result)); 1180 API_ID_PPB_INSTANCE, instance, result));
1181 } 1181 }
1182 1182
1183 void PPB_Instance_Proxy::CancelAnyPendingRequestSurroundingText( 1183 void PPB_Instance_Proxy::CancelAnyPendingRequestSurroundingText(
1184 PP_Instance instance) { 1184 PP_Instance instance) {
1185 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())-> 1185 InstanceData* data = static_cast<PluginDispatcher*>(dispatcher())->
1186 GetInstanceData(instance); 1186 GetInstanceData(instance);
1187 if (!data) 1187 if (!data)
1188 return; // Instance was probably deleted. 1188 return; // Instance was probably deleted.
1189 data->should_do_request_surrounding_text = false; 1189 data->should_do_request_surrounding_text = false;
1190 } 1190 }
1191 1191
1192 } // namespace proxy 1192 } // namespace proxy
1193 } // namespace ppapi 1193 } // namespace ppapi
OLDNEW
« no previous file with comments | « ppapi/proxy/ppb_graphics_2d_proxy.cc ('k') | ppapi/proxy/ppb_talk_private_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698