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