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

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

Issue 6260057: Fix reentrancy in HandleInputEvent by posting a task (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: just set_unblock(false) Created 9 years, 10 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 | no next file » | 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/ppp_instance_proxy.h" 5 #include "ppapi/proxy/ppp_instance_proxy.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ppapi/c/pp_var.h" 9 #include "ppapi/c/pp_var.h"
10 #include "ppapi/c/ppp_instance.h" 10 #include "ppapi/c/ppp_instance.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 void DidChangeFocus(PP_Instance instance, PP_Bool has_focus) { 51 void DidChangeFocus(PP_Instance instance, PP_Bool has_focus) {
52 HostDispatcher::GetForInstance(instance)->Send( 52 HostDispatcher::GetForInstance(instance)->Send(
53 new PpapiMsg_PPPInstance_DidChangeFocus(INTERFACE_ID_PPP_INSTANCE, 53 new PpapiMsg_PPPInstance_DidChangeFocus(INTERFACE_ID_PPP_INSTANCE,
54 instance, has_focus)); 54 instance, has_focus));
55 } 55 }
56 56
57 PP_Bool HandleInputEvent(PP_Instance instance, 57 PP_Bool HandleInputEvent(PP_Instance instance,
58 const PP_InputEvent* event) { 58 const PP_InputEvent* event) {
59 PP_Bool result = PP_FALSE; 59 PP_Bool result = PP_FALSE;
60 HostDispatcher::GetForInstance(instance)->Send( 60 IPC::Message* msg = new PpapiMsg_PPPInstance_HandleInputEvent(
61 new PpapiMsg_PPPInstance_HandleInputEvent(INTERFACE_ID_PPP_INSTANCE, 61 INTERFACE_ID_PPP_INSTANCE, instance, *event, &result);
62 instance, *event, &result)); 62 // Make this message not unblock, to avoid re-entrancy problems when the
63 // plugin does a sync call to the renderer.
brettw 2011/02/02 05:00:08 Can you add something like: "This will force any s
64 msg->set_unblock(false);
65 HostDispatcher::GetForInstance(instance)->Send(msg);
63 return result; 66 return result;
64 } 67 }
65 68
66 PP_Bool HandleDocumentLoad(PP_Instance instance, 69 PP_Bool HandleDocumentLoad(PP_Instance instance,
67 PP_Resource url_loader) { 70 PP_Resource url_loader) {
68 PP_Bool result = PP_FALSE; 71 PP_Bool result = PP_FALSE;
69 HostResource serialized_loader; 72 HostResource serialized_loader;
70 serialized_loader.SetHostResource(instance, url_loader); 73 serialized_loader.SetHostResource(instance, url_loader);
71 HostDispatcher::GetForInstance(instance)->Send( 74 HostDispatcher::GetForInstance(instance)->Send(
72 new PpapiMsg_PPPInstance_HandleDocumentLoad(INTERFACE_ID_PPP_INSTANCE, 75 new PpapiMsg_PPPInstance_HandleDocumentLoad(INTERFACE_ID_PPP_INSTANCE,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 195
193 void PPP_Instance_Proxy::OnMsgGetInstanceObject( 196 void PPP_Instance_Proxy::OnMsgGetInstanceObject(
194 PP_Instance instance, 197 PP_Instance instance,
195 SerializedVarReturnValue result) { 198 SerializedVarReturnValue result) {
196 result.Return(dispatcher(), 199 result.Return(dispatcher(),
197 ppp_instance_target()->GetInstanceObject(instance)); 200 ppp_instance_target()->GetInstanceObject(instance));
198 } 201 }
199 202
200 } // namespace proxy 203 } // namespace proxy
201 } // namespace pp 204 } // namespace pp
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698