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

Side by Side Diff: ppapi/shared_impl/ppp_instance_combined.cc

Issue 9391006: PPAPI: Add unlocking for PPP calls and callbacks. Add more locking. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 8 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 | « ppapi/proxy/serialized_var_unittest.cc ('k') | ppapi/shared_impl/proxy_lock.h » ('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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/shared_impl/ppp_instance_combined.h" 5 #include "ppapi/shared_impl/ppp_instance_combined.h"
6 #include "ppapi/shared_impl/proxy_lock.h"
6 7
7 namespace ppapi { 8 namespace ppapi {
8 9
9 PPP_Instance_Combined::PPP_Instance_Combined( 10 PPP_Instance_Combined::PPP_Instance_Combined(
10 const PPP_Instance_1_0& instance_if) 11 const PPP_Instance_1_0& instance_if)
11 : did_change_view_1_0_(instance_if.DidChangeView) { 12 : did_change_view_1_0_(instance_if.DidChangeView) {
12 instance_1_1_.DidCreate = instance_if.DidCreate; 13 instance_1_1_.DidCreate = instance_if.DidCreate;
13 instance_1_1_.DidDestroy = instance_if.DidDestroy; 14 instance_1_1_.DidDestroy = instance_if.DidDestroy;
14 instance_1_1_.DidChangeView = NULL; 15 instance_1_1_.DidChangeView = NULL;
15 instance_1_1_.DidChangeFocus = instance_if.DidChangeFocus; 16 instance_1_1_.DidChangeFocus = instance_if.DidChangeFocus;
16 instance_1_1_.HandleDocumentLoad = instance_if.HandleDocumentLoad; 17 instance_1_1_.HandleDocumentLoad = instance_if.HandleDocumentLoad;
17 } 18 }
18 19
19 PPP_Instance_Combined::PPP_Instance_Combined( 20 PPP_Instance_Combined::PPP_Instance_Combined(
20 const PPP_Instance_1_1& instance_if) 21 const PPP_Instance_1_1& instance_if)
21 : instance_1_1_(instance_if), 22 : instance_1_1_(instance_if),
22 did_change_view_1_0_(NULL) { 23 did_change_view_1_0_(NULL) {
23 } 24 }
24 25
25 PP_Bool PPP_Instance_Combined::DidCreate(PP_Instance instance, 26 PP_Bool PPP_Instance_Combined::DidCreate(PP_Instance instance,
26 uint32_t argc, 27 uint32_t argc,
27 const char* argn[], 28 const char* argn[],
28 const char* argv[]) { 29 const char* argv[]) {
29 return instance_1_1_.DidCreate(instance, argc, argn, argv); 30 return CallWhileUnlocked(instance_1_1_.DidCreate, instance, argc, argn, argv);
30 } 31 }
31 32
32 void PPP_Instance_Combined::DidDestroy(PP_Instance instance) { 33 void PPP_Instance_Combined::DidDestroy(PP_Instance instance) {
33 return instance_1_1_.DidDestroy(instance); 34 return CallWhileUnlocked(instance_1_1_.DidDestroy, instance);
34 } 35 }
35 36
36 void PPP_Instance_Combined::DidChangeView(PP_Instance instance, 37 void PPP_Instance_Combined::DidChangeView(PP_Instance instance,
37 PP_Resource view_changed_resource, 38 PP_Resource view_changed_resource,
38 const struct PP_Rect* position, 39 const struct PP_Rect* position,
39 const struct PP_Rect* clip) { 40 const struct PP_Rect* clip) {
40 if (instance_1_1_.DidChangeView) 41 if (instance_1_1_.DidChangeView) {
41 instance_1_1_.DidChangeView(instance, view_changed_resource); 42 CallWhileUnlocked(instance_1_1_.DidChangeView,
42 else 43 instance,
43 did_change_view_1_0_(instance, position, clip); 44 view_changed_resource);
45 } else {
46 CallWhileUnlocked(did_change_view_1_0_, instance, position, clip);
47 }
44 } 48 }
45 49
46 void PPP_Instance_Combined::DidChangeFocus(PP_Instance instance, 50 void PPP_Instance_Combined::DidChangeFocus(PP_Instance instance,
47 PP_Bool has_focus) { 51 PP_Bool has_focus) {
48 instance_1_1_.DidChangeFocus(instance, has_focus); 52 CallWhileUnlocked(instance_1_1_.DidChangeFocus, instance, has_focus);
49 } 53 }
50 54
51 PP_Bool PPP_Instance_Combined::HandleDocumentLoad(PP_Instance instance, 55 PP_Bool PPP_Instance_Combined::HandleDocumentLoad(PP_Instance instance,
52 PP_Resource url_loader) { 56 PP_Resource url_loader) {
53 return instance_1_1_.HandleDocumentLoad(instance, url_loader); 57 return CallWhileUnlocked(instance_1_1_.HandleDocumentLoad,
58 instance,
59 url_loader);
54 } 60 }
55 61
56 } // namespace ppapi 62 } // namespace ppapi
57 63
OLDNEW
« no previous file with comments | « ppapi/proxy/serialized_var_unittest.cc ('k') | ppapi/shared_impl/proxy_lock.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698