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_URL_UTIL_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_URL_UTIL_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_URL_UTIL_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_URL_UTIL_PROXY_H_ |
7 | 7 |
8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
9 #include "ppapi/proxy/interface_proxy.h" | 9 #include "ppapi/proxy/interface_proxy.h" |
10 #include "ppapi/proxy/serialized_var.h" | 10 #include "ppapi/proxy/serialized_var.h" |
11 | 11 |
12 struct PPB_URLUtil_Dev; | 12 struct PPB_URLUtil_Dev; |
13 | 13 |
14 namespace ppapi { | 14 namespace ppapi { |
15 namespace proxy { | 15 namespace proxy { |
16 | 16 |
17 class PPB_URLUtil_Proxy : public InterfaceProxy { | 17 class PPB_URLUtil_Proxy : public InterfaceProxy { |
18 public: | 18 public: |
19 PPB_URLUtil_Proxy(Dispatcher* dispatcher); | 19 PPB_URLUtil_Proxy(Dispatcher* dispatcher, const void* target_interface); |
20 virtual ~PPB_URLUtil_Proxy(); | 20 virtual ~PPB_URLUtil_Proxy(); |
21 | 21 |
22 static const Info* GetInfo(); | 22 static const Info* GetInfo(); |
23 | 23 |
| 24 const PPB_URLUtil_Dev* ppb_url_util_target() const { |
| 25 return static_cast<const PPB_URLUtil_Dev*>(target_interface()); |
| 26 } |
| 27 |
24 // InterfaceProxy implementation. | 28 // InterfaceProxy implementation. |
25 virtual bool OnMessageReceived(const IPC::Message& msg); | 29 virtual bool OnMessageReceived(const IPC::Message& msg); |
26 | 30 |
27 private: | 31 private: |
28 // Message handlers. | 32 // Message handlers. |
29 void OnMsgResolveRelativeToDocument(PP_Instance instance, | 33 void OnMsgResolveRelativeToDocument(PP_Instance instance, |
30 SerializedVarReceiveInput relative, | 34 SerializedVarReceiveInput relative, |
31 SerializedVarReturnValue result); | 35 SerializedVarReturnValue result); |
32 void OnMsgDocumentCanRequest(PP_Instance instance, | 36 void OnMsgDocumentCanRequest(PP_Instance instance, |
33 SerializedVarReceiveInput url, | 37 SerializedVarReceiveInput url, |
34 PP_Bool* result); | 38 PP_Bool* result); |
35 void OnMsgDocumentCanAccessDocument(PP_Instance active, | 39 void OnMsgDocumentCanAccessDocument(PP_Instance active, |
36 PP_Instance target, | 40 PP_Instance target, |
37 PP_Bool* result); | 41 PP_Bool* result); |
38 void OnMsgGetDocumentURL(PP_Instance instance, | 42 void OnMsgGetDocumentURL(PP_Instance instance, |
39 SerializedVarReturnValue result); | 43 SerializedVarReturnValue result); |
40 void OnMsgGetPluginInstanceURL(PP_Instance instance, | 44 void OnMsgGetPluginInstanceURL(PP_Instance instance, |
41 SerializedVarReturnValue result); | 45 SerializedVarReturnValue result); |
42 | 46 |
43 // When this proxy is in the host side, this value caches the interface | |
44 // pointer so we don't have to retrieve it from the dispatcher each time. | |
45 // In the plugin, this value is always NULL. | |
46 const PPB_URLUtil_Dev* ppb_url_util_impl_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(PPB_URLUtil_Proxy); | 47 DISALLOW_COPY_AND_ASSIGN(PPB_URLUtil_Proxy); |
49 }; | 48 }; |
50 | 49 |
51 } // namespace proxy | 50 } // namespace proxy |
52 } // namespace ppapi | 51 } // namespace ppapi |
53 | 52 |
54 #endif // PPAPI_PROXY_PPB_URL_UTIL_PROXY_H_ | 53 #endif // PPAPI_PROXY_PPB_URL_UTIL_PROXY_H_ |
55 | 54 |
OLD | NEW |