OLD | NEW |
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/proxy/ppb_instance_proxy.h" | 5 #include "ppapi/proxy/ppb_instance_proxy.h" |
6 | 6 |
7 #include "ppapi/c/dev/ppb_fullscreen_dev.h" | 7 #include "ppapi/c/dev/ppb_fullscreen_dev.h" |
8 #include "ppapi/c/pp_var.h" | 8 #include "ppapi/c/pp_var.h" |
9 #include "ppapi/c/ppb_instance.h" | 9 #include "ppapi/c/ppb_instance.h" |
10 #include "ppapi/c/ppb_messaging.h" | 10 #include "ppapi/c/ppb_messaging.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 | 40 |
41 PPB_Instance_Proxy::PPB_Instance_Proxy(Dispatcher* dispatcher, | 41 PPB_Instance_Proxy::PPB_Instance_Proxy(Dispatcher* dispatcher, |
42 const void* target_interface) | 42 const void* target_interface) |
43 : InterfaceProxy(dispatcher, target_interface) { | 43 : InterfaceProxy(dispatcher, target_interface) { |
44 } | 44 } |
45 | 45 |
46 PPB_Instance_Proxy::~PPB_Instance_Proxy() { | 46 PPB_Instance_Proxy::~PPB_Instance_Proxy() { |
47 } | 47 } |
48 | 48 |
49 // static | 49 // static |
50 const InterfaceProxy::Info* PPB_Instance_Proxy::GetInfo0_4() { | |
51 static const Info info = { | |
52 ppapi::thunk::GetPPB_Instance_0_4_Thunk(), | |
53 PPB_INSTANCE_INTERFACE_0_4, | |
54 INTERFACE_ID_NONE, // 1_0 is the canonical one. | |
55 false, | |
56 &CreateInstanceProxy, | |
57 }; | |
58 return &info; | |
59 } | |
60 | |
61 // static | |
62 const InterfaceProxy::Info* PPB_Instance_Proxy::GetInfo0_5() { | 50 const InterfaceProxy::Info* PPB_Instance_Proxy::GetInfo0_5() { |
63 static const Info info = { | 51 static const Info info = { |
64 ppapi::thunk::GetPPB_Instance_1_0_Thunk(), | 52 ppapi::thunk::GetPPB_Instance_1_0_Thunk(), |
65 PPB_INSTANCE_INTERFACE_0_5, | 53 PPB_INSTANCE_INTERFACE_0_5, |
66 INTERFACE_ID_NONE, // 1_0 is the canonical one. | 54 INTERFACE_ID_NONE, // 1_0 is the canonical one. |
67 false, | 55 false, |
68 &CreateInstanceProxy, | 56 &CreateInstanceProxy, |
69 }; | 57 }; |
70 return &info; | 58 return &info; |
71 } | 59 } |
72 | 60 |
73 // static | 61 // static |
74 const InterfaceProxy::Info* PPB_Instance_Proxy::GetInfo1_0() { | 62 const InterfaceProxy::Info* PPB_Instance_Proxy::GetInfo1_0() { |
75 static const Info info = { | 63 static const Info info = { |
76 ppapi::thunk::GetPPB_Instance_1_0_Thunk(), | 64 ppapi::thunk::GetPPB_Instance_1_0_Thunk(), |
77 PPB_INSTANCE_INTERFACE_1_0, | 65 PPB_INSTANCE_INTERFACE_1_0, |
78 INTERFACE_ID_PPB_INSTANCE, | 66 INTERFACE_ID_PPB_INSTANCE, |
79 false, | 67 false, |
80 &CreateInstanceProxy, | 68 &CreateInstanceProxy, |
81 }; | 69 }; |
82 return &info; | 70 return &info; |
83 } | 71 } |
84 | 72 |
85 // static | 73 // static |
86 const InterfaceProxy::Info* PPB_Instance_Proxy::GetInfoMessaging() { | 74 const InterfaceProxy::Info* PPB_Instance_Proxy::GetInfoMessaging() { |
87 static const Info info = { | 75 static const Info info = { |
88 ppapi::thunk::GetPPB_Messaging_Thunk(), | 76 ppapi::thunk::GetPPB_Messaging_Thunk(), |
89 PPB_MESSAGING_INTERFACE, | 77 PPB_MESSAGING_INTERFACE, |
90 INTERFACE_ID_NONE, // 0_5 is the canonical one. | 78 INTERFACE_ID_NONE, // 1_0 is the canonical one. |
91 false, | 79 false, |
92 &CreateInstanceProxy, | 80 &CreateInstanceProxy, |
93 }; | 81 }; |
94 return &info; | 82 return &info; |
95 } | 83 } |
96 | 84 |
97 // static | 85 // static |
98 const InterfaceProxy::Info* PPB_Instance_Proxy::GetInfoPrivate() { | 86 const InterfaceProxy::Info* PPB_Instance_Proxy::GetInfoPrivate() { |
99 static const Info info = { | 87 static const Info info = { |
100 ppapi::thunk::GetPPB_Instance_Private_Thunk(), | 88 ppapi::thunk::GetPPB_Instance_Private_Thunk(), |
101 PPB_INSTANCE_PRIVATE_INTERFACE, | 89 PPB_INSTANCE_PRIVATE_INTERFACE, |
102 INTERFACE_ID_NONE, // 0_5 is the canonical one. | 90 INTERFACE_ID_NONE, // 1_0 is the canonical one. |
103 false, | 91 false, |
104 &CreateInstanceProxy, | 92 &CreateInstanceProxy, |
105 }; | 93 }; |
106 return &info; | 94 return &info; |
107 } | 95 } |
108 | 96 |
109 // static | 97 // static |
110 const InterfaceProxy::Info* PPB_Instance_Proxy::GetInfoFullscreen() { | 98 const InterfaceProxy::Info* PPB_Instance_Proxy::GetInfoFullscreen() { |
111 static const Info info = { | 99 static const Info info = { |
112 ppapi::thunk::GetPPB_Fullscreen_Thunk(), | 100 ppapi::thunk::GetPPB_Fullscreen_Thunk(), |
113 PPB_FULLSCREEN_DEV_INTERFACE, | 101 PPB_FULLSCREEN_DEV_INTERFACE, |
114 INTERFACE_ID_NONE, // 0_5 is the canonical one. | 102 INTERFACE_ID_NONE, // 1_0 is the canonical one. |
115 false, | 103 false, |
116 &CreateInstanceProxy, | 104 &CreateInstanceProxy, |
117 }; | 105 }; |
118 return &info; | 106 return &info; |
119 } | 107 } |
120 | 108 |
121 bool PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) { | 109 bool PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) { |
122 // Prevent the dispatcher from going away during a call to ExecuteScript. | 110 // Prevent the dispatcher from going away during a call to ExecuteScript. |
123 // This must happen OUTSIDE of ExecuteScript since the SerializedVars use | 111 // This must happen OUTSIDE of ExecuteScript since the SerializedVars use |
124 // the dispatcher upon return of the function (converting the | 112 // the dispatcher upon return of the function (converting the |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 | 358 |
371 void PPB_Instance_Proxy::OnMsgPostMessage(PP_Instance instance, | 359 void PPB_Instance_Proxy::OnMsgPostMessage(PP_Instance instance, |
372 SerializedVarReceiveInput message) { | 360 SerializedVarReceiveInput message) { |
373 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false); | 361 EnterFunctionNoLock<PPB_Instance_FunctionAPI> enter(instance, false); |
374 if (enter.succeeded()) | 362 if (enter.succeeded()) |
375 enter.functions()->PostMessage(instance, message.Get(dispatcher())); | 363 enter.functions()->PostMessage(instance, message.Get(dispatcher())); |
376 } | 364 } |
377 | 365 |
378 } // namespace proxy | 366 } // namespace proxy |
379 } // namespace pp | 367 } // namespace pp |
OLD | NEW |