| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_PPB_URL_LOADER_PROXY_H_ | 5 #ifndef PPAPI_PPB_URL_LOADER_PROXY_H_ |
| 6 #define PPAPI_PPB_URL_LOADER_PROXY_H_ | 6 #define PPAPI_PPB_URL_LOADER_PROXY_H_ |
| 7 | 7 |
| 8 #include "base/weak_ptr.h" | 8 #include "base/weak_ptr.h" |
| 9 #include "ppapi/c/pp_completion_callback.h" | 9 #include "ppapi/c/pp_completion_callback.h" |
| 10 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
| 11 #include "ppapi/c/pp_module.h" | 11 #include "ppapi/c/pp_module.h" |
| 12 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
| 13 #include "ppapi/c/pp_size.h" | 13 #include "ppapi/c/pp_size.h" |
| 14 #include "ppapi/c/pp_var.h" | 14 #include "ppapi/c/pp_var.h" |
| 15 #include "ppapi/proxy/interface_proxy.h" | 15 #include "ppapi/proxy/interface_proxy.h" |
| 16 | 16 |
| 17 struct PPB_URLLoader_Dev; | 17 struct PPB_URLLoader; |
| 18 | 18 |
| 19 namespace pp { | 19 namespace pp { |
| 20 namespace proxy { | 20 namespace proxy { |
| 21 | 21 |
| 22 class PPB_URLLoader_Proxy : public InterfaceProxy, | 22 class PPB_URLLoader_Proxy : public InterfaceProxy, |
| 23 public base::SupportsWeakPtr<PPB_URLLoader_Proxy> { | 23 public base::SupportsWeakPtr<PPB_URLLoader_Proxy> { |
| 24 public: | 24 public: |
| 25 PPB_URLLoader_Proxy(Dispatcher* dispatcher, const void* target_interface); | 25 PPB_URLLoader_Proxy(Dispatcher* dispatcher, const void* target_interface); |
| 26 virtual ~PPB_URLLoader_Proxy(); | 26 virtual ~PPB_URLLoader_Proxy(); |
| 27 | 27 |
| 28 // URLLoader objects are normally allocated by the Create function, but | 28 // URLLoader objects are normally allocated by the Create function, but |
| 29 // they are also provided to PPP_Instance.OnMsgHandleDocumentLoad. This | 29 // they are also provided to PPP_Instance.OnMsgHandleDocumentLoad. This |
| 30 // function allows the proxy for DocumentLoad to create the correct plugin | 30 // function allows the proxy for DocumentLoad to create the correct plugin |
| 31 // proxied info for the given browser-supplied URLLoader resource ID. | 31 // proxied info for the given browser-supplied URLLoader resource ID. |
| 32 static void TrackPluginResource(PP_Resource url_loader_resource); | 32 static void TrackPluginResource(PP_Resource url_loader_resource); |
| 33 | 33 |
| 34 const PPB_URLLoader_Dev* ppb_url_loader_target() const { | 34 const PPB_URLLoader* ppb_url_loader_target() const { |
| 35 return reinterpret_cast<const PPB_URLLoader_Dev*>(target_interface()); | 35 return reinterpret_cast<const PPB_URLLoader*>(target_interface()); |
| 36 } | 36 } |
| 37 | 37 |
| 38 // InterfaceProxy implementation. | 38 // InterfaceProxy implementation. |
| 39 virtual const void* GetSourceInterface() const; | 39 virtual const void* GetSourceInterface() const; |
| 40 virtual InterfaceID GetInterfaceId() const; | 40 virtual InterfaceID GetInterfaceId() const; |
| 41 virtual void OnMessageReceived(const IPC::Message& msg); | 41 virtual void OnMessageReceived(const IPC::Message& msg); |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // Plugin->renderer message handlers. | 44 // Plugin->renderer message handlers. |
| 45 void OnMsgCreate(PP_Instance instance, | 45 void OnMsgCreate(PP_Instance instance, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 65 int64_t total_bytes_to_be_received); | 65 int64_t total_bytes_to_be_received); |
| 66 void OnMsgReadResponseBodyAck(PP_Resource pp_resource, | 66 void OnMsgReadResponseBodyAck(PP_Resource pp_resource, |
| 67 int32_t result, | 67 int32_t result, |
| 68 const std::string& data); | 68 const std::string& data); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace proxy | 71 } // namespace proxy |
| 72 } // namespace pp | 72 } // namespace pp |
| 73 | 73 |
| 74 #endif // PPAPI_PPB_URL_LOADER_PROXY_H_ | 74 #endif // PPAPI_PPB_URL_LOADER_PROXY_H_ |
| OLD | NEW |