| 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 "ppapi/c/pp_completion_callback.h" | 8 #include "ppapi/c/pp_completion_callback.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" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 namespace pp { | 22 namespace pp { |
| 23 namespace proxy { | 23 namespace proxy { |
| 24 | 24 |
| 25 struct PPBURLLoader_UpdateProgress_Params; | 25 struct PPBURLLoader_UpdateProgress_Params; |
| 26 | 26 |
| 27 class PPB_URLLoader_Proxy : public InterfaceProxy { | 27 class PPB_URLLoader_Proxy : public InterfaceProxy { |
| 28 public: | 28 public: |
| 29 PPB_URLLoader_Proxy(Dispatcher* dispatcher, const void* target_interface); | 29 PPB_URLLoader_Proxy(Dispatcher* dispatcher, const void* target_interface); |
| 30 virtual ~PPB_URLLoader_Proxy(); | 30 virtual ~PPB_URLLoader_Proxy(); |
| 31 | 31 |
| 32 static const Info* GetInfo(); |
| 33 |
| 32 // URLLoader objects are normally allocated by the Create function, but | 34 // URLLoader objects are normally allocated by the Create function, but |
| 33 // they are also provided to PPP_Instance.OnMsgHandleDocumentLoad. This | 35 // they are also provided to PPP_Instance.OnMsgHandleDocumentLoad. This |
| 34 // function allows the proxy for DocumentLoad to create the correct plugin | 36 // function allows the proxy for DocumentLoad to create the correct plugin |
| 35 // proxied info for the given browser-supplied URLLoader resource ID. | 37 // proxied info for the given browser-supplied URLLoader resource ID. |
| 36 static PP_Resource TrackPluginResource( | 38 static PP_Resource TrackPluginResource( |
| 37 const HostResource& url_loader_resource); | 39 const HostResource& url_loader_resource); |
| 38 | 40 |
| 39 const PPB_URLLoader* ppb_url_loader_target() const { | 41 const PPB_URLLoader* ppb_url_loader_target() const { |
| 40 return reinterpret_cast<const PPB_URLLoader*>(target_interface()); | 42 return reinterpret_cast<const PPB_URLLoader*>(target_interface()); |
| 41 } | 43 } |
| 42 | 44 |
| 43 // InterfaceProxy implementation. | 45 // InterfaceProxy implementation. |
| 44 virtual const void* GetSourceInterface() const; | |
| 45 virtual InterfaceID GetInterfaceId() const; | |
| 46 virtual bool OnMessageReceived(const IPC::Message& msg); | 46 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 // Data associated with callbacks for ReadResponseBody. | 49 // Data associated with callbacks for ReadResponseBody. |
| 50 struct ReadCallbackInfo; | 50 struct ReadCallbackInfo; |
| 51 | 51 |
| 52 // Plugin->renderer message handlers. | 52 // Plugin->renderer message handlers. |
| 53 void OnMsgCreate(PP_Instance instance, | 53 void OnMsgCreate(PP_Instance instance, |
| 54 HostResource* result); | 54 HostResource* result); |
| 55 void OnMsgOpen(const HostResource& loader, | 55 void OnMsgOpen(const HostResource& loader, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 79 CompletionCallbackFactory<PPB_URLLoader_Proxy, | 79 CompletionCallbackFactory<PPB_URLLoader_Proxy, |
| 80 ProxyNonThreadSafeRefCount> callback_factory_; | 80 ProxyNonThreadSafeRefCount> callback_factory_; |
| 81 }; | 81 }; |
| 82 | 82 |
| 83 class PPB_URLLoaderTrusted_Proxy : public InterfaceProxy { | 83 class PPB_URLLoaderTrusted_Proxy : public InterfaceProxy { |
| 84 public: | 84 public: |
| 85 PPB_URLLoaderTrusted_Proxy(Dispatcher* dispatcher, | 85 PPB_URLLoaderTrusted_Proxy(Dispatcher* dispatcher, |
| 86 const void* target_interface); | 86 const void* target_interface); |
| 87 virtual ~PPB_URLLoaderTrusted_Proxy(); | 87 virtual ~PPB_URLLoaderTrusted_Proxy(); |
| 88 | 88 |
| 89 static const Info* GetInfo(); |
| 90 |
| 89 const PPB_URLLoaderTrusted* ppb_url_loader_trusted_target() const { | 91 const PPB_URLLoaderTrusted* ppb_url_loader_trusted_target() const { |
| 90 return reinterpret_cast<const PPB_URLLoaderTrusted*>(target_interface()); | 92 return reinterpret_cast<const PPB_URLLoaderTrusted*>(target_interface()); |
| 91 } | 93 } |
| 92 | 94 |
| 93 // InterfaceProxy implementation. | 95 // InterfaceProxy implementation. |
| 94 virtual const void* GetSourceInterface() const; | |
| 95 virtual InterfaceID GetInterfaceId() const; | |
| 96 virtual bool OnMessageReceived(const IPC::Message& msg); | 96 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 // Plugin->renderer message handlers. | 99 // Plugin->renderer message handlers. |
| 100 void OnMsgGrantUniversalAccess(const HostResource& loader); | 100 void OnMsgGrantUniversalAccess(const HostResource& loader); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 } // namespace proxy | 103 } // namespace proxy |
| 104 } // namespace pp | 104 } // namespace pp |
| 105 | 105 |
| 106 #endif // PPAPI_PPB_URL_LOADER_PROXY_H_ | 106 #endif // PPAPI_PPB_URL_LOADER_PROXY_H_ |
| OLD | NEW |