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); | |
29 virtual ~PPB_URLResponseInfo_Proxy(); | 28 virtual ~PPB_URLResponseInfo_Proxy(); |
30 | 29 |
31 static const Info* GetInfo(); | |
32 | |
33 // URLResponseInfo objects are actually created and returned by the | 30 // URLResponseInfo objects are actually created and returned by the |
34 // URLLoader. This function allows the URLLoader to convert a new | 31 // URLLoader. This function allows the URLLoader to convert a new |
35 // HostResource representing a response info to a properly tracked | 32 // HostResource representing a response info to a properly tracked |
36 // URLReponseInfo Resource. Returns the plugin resource ID for the | 33 // URLReponseInfo Resource. Returns the plugin resource ID for the |
37 // new resource. | 34 // new resource. |
38 static PP_Resource CreateResponseForResource( | 35 static PP_Resource CreateResponseForResource( |
39 const ppapi::HostResource& resource); | 36 const ppapi::HostResource& resource); |
40 | 37 |
41 // InterfaceProxy implementation. | 38 // InterfaceProxy implementation. |
42 virtual bool OnMessageReceived(const IPC::Message& msg); | 39 virtual bool OnMessageReceived(const IPC::Message& msg); |
43 | 40 |
| 41 static const InterfaceID kInterfaceID = INTERFACE_ID_PPB_URL_RESPONSE_INFO; |
| 42 |
44 private: | 43 private: |
45 // Message handlers. | 44 // Message handlers. |
46 void OnMsgGetProperty(const ppapi::HostResource& response, | 45 void OnMsgGetProperty(const ppapi::HostResource& response, |
47 int32_t property, | 46 int32_t property, |
48 SerializedVarReturnValue result); | 47 SerializedVarReturnValue result); |
49 void OnMsgGetBodyAsFileRef(const ppapi::HostResource& response, | 48 void OnMsgGetBodyAsFileRef(const ppapi::HostResource& response, |
50 PPB_FileRef_CreateInfo* result); | 49 PPB_FileRef_CreateInfo* result); |
51 | 50 |
52 DISALLOW_COPY_AND_ASSIGN(PPB_URLResponseInfo_Proxy); | 51 DISALLOW_COPY_AND_ASSIGN(PPB_URLResponseInfo_Proxy); |
53 }; | 52 }; |
54 | 53 |
55 } // namespace proxy | 54 } // namespace proxy |
56 } // namespace ppapi | 55 } // namespace ppapi |
57 | 56 |
58 #endif // PPAPI_PROXY_PPB_URL_RESPONSE_INFO_PROXY_H_ | 57 #endif // PPAPI_PROXY_PPB_URL_RESPONSE_INFO_PROXY_H_ |
OLD | NEW |