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