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 #ifndef PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ |
7 | 7 |
8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
9 #include "ppapi/c/pp_resource.h" | 9 #include "ppapi/c/pp_resource.h" |
10 #include "ppapi/c/pp_var.h" | 10 #include "ppapi/c/pp_var.h" |
11 #include "ppapi/cpp/completion_callback.h" | |
12 #include "ppapi/proxy/interface_proxy.h" | 11 #include "ppapi/proxy/interface_proxy.h" |
13 #include "ppapi/proxy/proxy_non_thread_safe_ref_count.h" | |
14 #include "ppapi/shared_impl/function_group_base.h" | 12 #include "ppapi/shared_impl/function_group_base.h" |
15 #include "ppapi/shared_impl/host_resource.h" | 13 #include "ppapi/shared_impl/host_resource.h" |
16 #include "ppapi/shared_impl/instance_impl.h" | 14 #include "ppapi/shared_impl/instance_impl.h" |
17 #include "ppapi/thunk/ppb_instance_api.h" | 15 #include "ppapi/thunk/ppb_instance_api.h" |
18 | 16 |
19 // Windows headers interfere with this file. | |
20 #ifdef PostMessage | |
21 #undef PostMessage | |
22 #endif | |
23 | |
24 namespace ppapi { | 17 namespace ppapi { |
25 namespace proxy { | 18 namespace proxy { |
26 | 19 |
27 class SerializedVarReceiveInput; | 20 class SerializedVarReceiveInput; |
28 class SerializedVarOutParam; | 21 class SerializedVarOutParam; |
29 class SerializedVarReturnValue; | 22 class SerializedVarReturnValue; |
30 | 23 |
31 class PPB_Instance_Proxy : public InterfaceProxy, | 24 class PPB_Instance_Proxy : public InterfaceProxy, |
32 public ppapi::InstanceImpl, | 25 public ppapi::InstanceImpl, |
33 public ppapi::thunk::PPB_Instance_FunctionAPI { | 26 public ppapi::thunk::PPB_Instance_FunctionAPI { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 PP_Instance instance, | 91 PP_Instance instance, |
99 PP_URLComponents_Dev* components) OVERRIDE; | 92 PP_URLComponents_Dev* components) OVERRIDE; |
100 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; | 93 virtual void PostMessage(PP_Instance instance, PP_Var message) OVERRIDE; |
101 virtual int32_t LockMouse(PP_Instance instance, | 94 virtual int32_t LockMouse(PP_Instance instance, |
102 PP_CompletionCallback callback) OVERRIDE; | 95 PP_CompletionCallback callback) OVERRIDE; |
103 virtual void UnlockMouse(PP_Instance instance) OVERRIDE; | 96 virtual void UnlockMouse(PP_Instance instance) OVERRIDE; |
104 | 97 |
105 static const ApiID kApiID = API_ID_PPB_INSTANCE; | 98 static const ApiID kApiID = API_ID_PPB_INSTANCE; |
106 | 99 |
107 private: | 100 private: |
108 // Plugin -> Host message handlers. | 101 // Message handlers. |
109 void OnMsgGetWindowObject(PP_Instance instance, | 102 void OnMsgGetWindowObject(PP_Instance instance, |
110 SerializedVarReturnValue result); | 103 SerializedVarReturnValue result); |
111 void OnMsgGetOwnerElementObject(PP_Instance instance, | 104 void OnMsgGetOwnerElementObject(PP_Instance instance, |
112 SerializedVarReturnValue result); | 105 SerializedVarReturnValue result); |
113 void OnMsgBindGraphics(PP_Instance instance, | 106 void OnMsgBindGraphics(PP_Instance instance, |
114 const ppapi::HostResource& device, | 107 const ppapi::HostResource& device, |
115 PP_Bool* result); | 108 PP_Bool* result); |
116 void OnMsgIsFullFrame(PP_Instance instance, PP_Bool* result); | 109 void OnMsgIsFullFrame(PP_Instance instance, PP_Bool* result); |
117 void OnMsgExecuteScript(PP_Instance instance, | 110 void OnMsgExecuteScript(PP_Instance instance, |
118 SerializedVarReceiveInput script, | 111 SerializedVarReceiveInput script, |
(...skipping 20 matching lines...) Expand all Loading... |
139 void OnMsgFlashGetScreenSize(PP_Instance instance, | 132 void OnMsgFlashGetScreenSize(PP_Instance instance, |
140 PP_Bool* result, | 133 PP_Bool* result, |
141 PP_Size* size); | 134 PP_Size* size); |
142 void OnMsgRequestInputEvents(PP_Instance instance, | 135 void OnMsgRequestInputEvents(PP_Instance instance, |
143 bool is_filtering, | 136 bool is_filtering, |
144 uint32_t event_classes); | 137 uint32_t event_classes); |
145 void OnMsgClearInputEvents(PP_Instance instance, | 138 void OnMsgClearInputEvents(PP_Instance instance, |
146 uint32_t event_classes); | 139 uint32_t event_classes); |
147 void OnMsgPostMessage(PP_Instance instance, | 140 void OnMsgPostMessage(PP_Instance instance, |
148 SerializedVarReceiveInput message); | 141 SerializedVarReceiveInput message); |
149 void OnMsgLockMouse(PP_Instance instance); | 142 void OnMsgLockMouse(PP_Instance instance, |
| 143 uint32_t serialized_callback); |
150 void OnMsgUnlockMouse(PP_Instance instance); | 144 void OnMsgUnlockMouse(PP_Instance instance); |
151 void OnMsgResolveRelativeToDocument(PP_Instance instance, | 145 void OnMsgResolveRelativeToDocument(PP_Instance instance, |
152 SerializedVarReceiveInput relative, | 146 SerializedVarReceiveInput relative, |
153 SerializedVarReturnValue result); | 147 SerializedVarReturnValue result); |
154 void OnMsgDocumentCanRequest(PP_Instance instance, | 148 void OnMsgDocumentCanRequest(PP_Instance instance, |
155 SerializedVarReceiveInput url, | 149 SerializedVarReceiveInput url, |
156 PP_Bool* result); | 150 PP_Bool* result); |
157 void OnMsgDocumentCanAccessDocument(PP_Instance active, | 151 void OnMsgDocumentCanAccessDocument(PP_Instance active, |
158 PP_Instance target, | 152 PP_Instance target, |
159 PP_Bool* result); | 153 PP_Bool* result); |
160 void OnMsgGetDocumentURL(PP_Instance instance, | 154 void OnMsgGetDocumentURL(PP_Instance instance, |
161 SerializedVarReturnValue result); | 155 SerializedVarReturnValue result); |
162 void OnMsgGetPluginInstanceURL(PP_Instance instance, | 156 void OnMsgGetPluginInstanceURL(PP_Instance instance, |
163 SerializedVarReturnValue result); | 157 SerializedVarReturnValue result); |
164 | |
165 // Host -> Plugin message handlers. | |
166 void OnMsgMouseLockComplete(PP_Instance instance, int32_t result); | |
167 | |
168 void MouseLockCompleteInHost(int32_t result, PP_Instance instance); | |
169 | |
170 pp::CompletionCallbackFactory<PPB_Instance_Proxy, | |
171 ProxyNonThreadSafeRefCount> callback_factory_; | |
172 }; | 158 }; |
173 | 159 |
174 } // namespace proxy | 160 } // namespace proxy |
175 } // namespace ppapi | 161 } // namespace ppapi |
176 | 162 |
177 #endif // PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ | 163 #endif // PPAPI_PROXY_PPB_INSTANCE_PROXY_H_ |
OLD | NEW |