OLD | NEW |
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/shared_impl/ppp_instance_combined.h" | 5 #include "ppapi/shared_impl/ppp_instance_combined.h" |
6 #include "ppapi/shared_impl/proxy_lock.h" | 6 #include "ppapi/shared_impl/proxy_lock.h" |
7 | 7 |
8 namespace ppapi { | 8 namespace ppapi { |
9 | 9 |
10 // static | 10 // static |
(...skipping 22 matching lines...) Expand all Loading... |
33 : did_change_view_1_0_(instance_if.DidChangeView) { | 33 : did_change_view_1_0_(instance_if.DidChangeView) { |
34 instance_1_1_.DidCreate = instance_if.DidCreate; | 34 instance_1_1_.DidCreate = instance_if.DidCreate; |
35 instance_1_1_.DidDestroy = instance_if.DidDestroy; | 35 instance_1_1_.DidDestroy = instance_if.DidDestroy; |
36 instance_1_1_.DidChangeView = NULL; | 36 instance_1_1_.DidChangeView = NULL; |
37 instance_1_1_.DidChangeFocus = instance_if.DidChangeFocus; | 37 instance_1_1_.DidChangeFocus = instance_if.DidChangeFocus; |
38 instance_1_1_.HandleDocumentLoad = instance_if.HandleDocumentLoad; | 38 instance_1_1_.HandleDocumentLoad = instance_if.HandleDocumentLoad; |
39 } | 39 } |
40 | 40 |
41 PPP_Instance_Combined::PPP_Instance_Combined( | 41 PPP_Instance_Combined::PPP_Instance_Combined( |
42 const PPP_Instance_1_1& instance_if) | 42 const PPP_Instance_1_1& instance_if) |
43 : instance_1_1_(instance_if), | 43 : instance_1_1_(instance_if), did_change_view_1_0_(NULL) {} |
44 did_change_view_1_0_(NULL) { | |
45 } | |
46 | 44 |
47 PP_Bool PPP_Instance_Combined::DidCreate(PP_Instance instance, | 45 PP_Bool PPP_Instance_Combined::DidCreate(PP_Instance instance, |
48 uint32_t argc, | 46 uint32_t argc, |
49 const char* argn[], | 47 const char* argn[], |
50 const char* argv[]) { | 48 const char* argv[]) { |
51 return CallWhileUnlocked(instance_1_1_.DidCreate, instance, argc, argn, argv); | 49 return CallWhileUnlocked(instance_1_1_.DidCreate, instance, argc, argn, argv); |
52 } | 50 } |
53 | 51 |
54 void PPP_Instance_Combined::DidDestroy(PP_Instance instance) { | 52 void PPP_Instance_Combined::DidDestroy(PP_Instance instance) { |
55 return CallWhileUnlocked(instance_1_1_.DidDestroy, instance); | 53 return CallWhileUnlocked(instance_1_1_.DidDestroy, instance); |
56 } | 54 } |
57 | 55 |
58 void PPP_Instance_Combined::DidChangeView(PP_Instance instance, | 56 void PPP_Instance_Combined::DidChangeView(PP_Instance instance, |
59 PP_Resource view_changed_resource, | 57 PP_Resource view_changed_resource, |
60 const struct PP_Rect* position, | 58 const struct PP_Rect* position, |
61 const struct PP_Rect* clip) { | 59 const struct PP_Rect* clip) { |
62 if (instance_1_1_.DidChangeView) { | 60 if (instance_1_1_.DidChangeView) { |
63 CallWhileUnlocked(instance_1_1_.DidChangeView, | 61 CallWhileUnlocked( |
64 instance, | 62 instance_1_1_.DidChangeView, instance, view_changed_resource); |
65 view_changed_resource); | |
66 } else { | 63 } else { |
67 CallWhileUnlocked(did_change_view_1_0_, instance, position, clip); | 64 CallWhileUnlocked(did_change_view_1_0_, instance, position, clip); |
68 } | 65 } |
69 } | 66 } |
70 | 67 |
71 void PPP_Instance_Combined::DidChangeFocus(PP_Instance instance, | 68 void PPP_Instance_Combined::DidChangeFocus(PP_Instance instance, |
72 PP_Bool has_focus) { | 69 PP_Bool has_focus) { |
73 CallWhileUnlocked(instance_1_1_.DidChangeFocus, instance, has_focus); | 70 CallWhileUnlocked(instance_1_1_.DidChangeFocus, instance, has_focus); |
74 } | 71 } |
75 | 72 |
76 PP_Bool PPP_Instance_Combined::HandleDocumentLoad(PP_Instance instance, | 73 PP_Bool PPP_Instance_Combined::HandleDocumentLoad(PP_Instance instance, |
77 PP_Resource url_loader) { | 74 PP_Resource url_loader) { |
78 return CallWhileUnlocked(instance_1_1_.HandleDocumentLoad, | 75 return CallWhileUnlocked( |
79 instance, | 76 instance_1_1_.HandleDocumentLoad, instance, url_loader); |
80 url_loader); | |
81 } | 77 } |
82 | 78 |
83 } // namespace ppapi | 79 } // namespace ppapi |
84 | |
OLD | NEW |