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_RESPONSE_INFO_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPB_URL_RESPONSE_INFO_PROXY_H_ |
6 #define PPAPI_PROXY_PPB_URL_RESPONSE_INFO_PROXY_H_ | 6 #define PPAPI_PROXY_PPB_URL_RESPONSE_INFO_PROXY_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/c/pp_module.h" | 10 #include "ppapi/c/pp_module.h" |
11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
12 #include "ppapi/proxy/interface_proxy.h" | 12 #include "ppapi/proxy/interface_proxy.h" |
13 #include "ppapi/shared_impl/host_resource.h" | 13 #include "ppapi/shared_impl/host_resource.h" |
14 | 14 |
15 struct PPB_URLResponseInfo; | 15 struct PPB_URLResponseInfo; |
16 | 16 |
17 namespace ppapi { | 17 namespace ppapi { |
18 | 18 |
19 struct PPB_FileRef_CreateInfo; | 19 struct PPB_FileRef_CreateInfo; |
20 | 20 |
21 namespace proxy { | 21 namespace proxy { |
22 | 22 |
23 class SerializedVarReturnValue; | 23 class SerializedVarReturnValue; |
24 | 24 |
25 class PPB_URLResponseInfo_Proxy : public InterfaceProxy { | 25 class PPB_URLResponseInfo_Proxy : public InterfaceProxy { |
26 public: | 26 public: |
27 PPB_URLResponseInfo_Proxy(Dispatcher* dispatcher); | 27 PPB_URLResponseInfo_Proxy(Dispatcher* dispatcher, |
| 28 const void* target_interface); |
28 virtual ~PPB_URLResponseInfo_Proxy(); | 29 virtual ~PPB_URLResponseInfo_Proxy(); |
29 | 30 |
| 31 static const Info* GetInfo(); |
| 32 |
30 // URLResponseInfo objects are actually created and returned by the | 33 // URLResponseInfo objects are actually created and returned by the |
31 // URLLoader. This function allows the URLLoader to convert a new | 34 // URLLoader. This function allows the URLLoader to convert a new |
32 // HostResource representing a response info to a properly tracked | 35 // HostResource representing a response info to a properly tracked |
33 // URLReponseInfo Resource. Returns the plugin resource ID for the | 36 // URLReponseInfo Resource. Returns the plugin resource ID for the |
34 // new resource. | 37 // new resource. |
35 static PP_Resource CreateResponseForResource( | 38 static PP_Resource CreateResponseForResource( |
36 const ppapi::HostResource& resource); | 39 const ppapi::HostResource& resource); |
37 | 40 |
38 // InterfaceProxy implementation. | 41 // InterfaceProxy implementation. |
39 virtual bool OnMessageReceived(const IPC::Message& msg); | 42 virtual bool OnMessageReceived(const IPC::Message& msg); |
40 | 43 |
41 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_URL_RESPONSE_INFO; | |
42 | |
43 private: | 44 private: |
44 // Message handlers. | 45 // Message handlers. |
45 void OnMsgGetProperty(const ppapi::HostResource& response, | 46 void OnMsgGetProperty(const ppapi::HostResource& response, |
46 int32_t property, | 47 int32_t property, |
47 SerializedVarReturnValue result); | 48 SerializedVarReturnValue result); |
48 void OnMsgGetBodyAsFileRef(const ppapi::HostResource& response, | 49 void OnMsgGetBodyAsFileRef(const ppapi::HostResource& response, |
49 PPB_FileRef_CreateInfo* result); | 50 PPB_FileRef_CreateInfo* result); |
50 | 51 |
51 DISALLOW_COPY_AND_ASSIGN(PPB_URLResponseInfo_Proxy); | 52 DISALLOW_COPY_AND_ASSIGN(PPB_URLResponseInfo_Proxy); |
52 }; | 53 }; |
53 | 54 |
54 } // namespace proxy | 55 } // namespace proxy |
55 } // namespace ppapi | 56 } // namespace ppapi |
56 | 57 |
57 #endif // PPAPI_PROXY_PPB_URL_RESPONSE_INFO_PROXY_H_ | 58 #endif // PPAPI_PROXY_PPB_URL_RESPONSE_INFO_PROXY_H_ |
OLD | NEW |