| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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" |
| 11 #include "ppapi/c/pp_resource.h" | 11 #include "ppapi/c/pp_resource.h" |
| 12 #include "ppapi/c/pp_size.h" | 12 #include "ppapi/c/pp_size.h" |
| 13 #include "ppapi/c/pp_var.h" | 13 #include "ppapi/c/pp_var.h" |
| 14 #include "ppapi/c/ppb_url_loader.h" | 14 #include "ppapi/c/ppb_url_loader.h" |
| 15 #include "ppapi/c/trusted/ppb_url_loader_trusted.h" | 15 #include "ppapi/c/trusted/ppb_url_loader_trusted.h" |
| 16 #include "ppapi/proxy/interface_proxy.h" | 16 #include "ppapi/proxy/interface_proxy.h" |
| 17 #include "ppapi/proxy/proxy_completion_callback_factory.h" | 17 #include "ppapi/proxy/proxy_completion_callback_factory.h" |
| 18 #include "ppapi/shared_impl/host_resource.h" | 18 #include "ppapi/shared_impl/host_resource.h" |
| 19 #include "ppapi/utility/completion_callback_factory.h" | 19 #include "ppapi/utility/completion_callback_factory.h" |
| 20 | 20 |
| 21 namespace ppapi { | 21 namespace ppapi { |
| 22 | 22 |
| 23 struct PPB_URLRequestInfo_Data; | 23 struct URLRequestInfoData; |
| 24 | 24 |
| 25 namespace proxy { | 25 namespace proxy { |
| 26 | 26 |
| 27 struct PPBURLLoader_UpdateProgress_Params; | 27 struct PPBURLLoader_UpdateProgress_Params; |
| 28 | 28 |
| 29 class PPB_URLLoader_Proxy : public InterfaceProxy { | 29 class PPB_URLLoader_Proxy : public InterfaceProxy { |
| 30 public: | 30 public: |
| 31 PPB_URLLoader_Proxy(Dispatcher* dispatcher); | 31 PPB_URLLoader_Proxy(Dispatcher* dispatcher); |
| 32 virtual ~PPB_URLLoader_Proxy(); | 32 virtual ~PPB_URLLoader_Proxy(); |
| 33 | 33 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 51 // time you're sending a new URLLoader that the plugin hasn't seen yet. | 51 // time you're sending a new URLLoader that the plugin hasn't seen yet. |
| 52 void PrepareURLLoaderForSendingToPlugin(PP_Resource resource); | 52 void PrepareURLLoaderForSendingToPlugin(PP_Resource resource); |
| 53 | 53 |
| 54 static const ApiID kApiID = API_ID_PPB_URL_LOADER; | 54 static const ApiID kApiID = API_ID_PPB_URL_LOADER; |
| 55 | 55 |
| 56 private: | 56 private: |
| 57 // Plugin->renderer message handlers. | 57 // Plugin->renderer message handlers. |
| 58 void OnMsgCreate(PP_Instance instance, | 58 void OnMsgCreate(PP_Instance instance, |
| 59 HostResource* result); | 59 HostResource* result); |
| 60 void OnMsgOpen(const HostResource& loader, | 60 void OnMsgOpen(const HostResource& loader, |
| 61 const PPB_URLRequestInfo_Data& data); | 61 const URLRequestInfoData& data); |
| 62 void OnMsgFollowRedirect(const HostResource& loader); | 62 void OnMsgFollowRedirect(const HostResource& loader); |
| 63 void OnMsgGetResponseInfo(const HostResource& loader, | 63 void OnMsgGetResponseInfo(const HostResource& loader, |
| 64 HostResource* result); | 64 HostResource* result); |
| 65 void OnMsgReadResponseBody(const HostResource& loader, | 65 void OnMsgReadResponseBody(const HostResource& loader, |
| 66 int32_t bytes_to_read); | 66 int32_t bytes_to_read); |
| 67 void OnMsgFinishStreamingToFile(const HostResource& loader); | 67 void OnMsgFinishStreamingToFile(const HostResource& loader); |
| 68 void OnMsgClose(const HostResource& loader); | 68 void OnMsgClose(const HostResource& loader); |
| 69 void OnMsgGrantUniversalAccess(const HostResource& loader); | 69 void OnMsgGrantUniversalAccess(const HostResource& loader); |
| 70 | 70 |
| 71 // Renderer->plugin message handlers. | 71 // Renderer->plugin message handlers. |
| 72 void OnMsgUpdateProgress( | 72 void OnMsgUpdateProgress( |
| 73 const PPBURLLoader_UpdateProgress_Params& params); | 73 const PPBURLLoader_UpdateProgress_Params& params); |
| 74 void OnMsgReadResponseBodyAck(const IPC::Message& message); | 74 void OnMsgReadResponseBodyAck(const IPC::Message& message); |
| 75 void OnMsgCallbackComplete(const HostResource& host_resource, int32_t result); | 75 void OnMsgCallbackComplete(const HostResource& host_resource, int32_t result); |
| 76 | 76 |
| 77 // Handles callbacks for read complete messages. Takes ownership of the | 77 // Handles callbacks for read complete messages. Takes ownership of the |
| 78 // message pointer. | 78 // message pointer. |
| 79 void OnReadCallback(int32_t result, IPC::Message* message); | 79 void OnReadCallback(int32_t result, IPC::Message* message); |
| 80 | 80 |
| 81 // Handles callback for everything but reads. | 81 // Handles callback for everything but reads. |
| 82 void OnCallback(int32_t result, const HostResource& resource); | 82 void OnCallback(int32_t result, const HostResource& resource); |
| 83 | 83 |
| 84 ProxyCompletionCallbackFactory<PPB_URLLoader_Proxy> callback_factory_; | 84 ProxyCompletionCallbackFactory<PPB_URLLoader_Proxy> callback_factory_; |
| 85 }; | 85 }; |
| 86 | 86 |
| 87 } // namespace proxy | 87 } // namespace proxy |
| 88 } // namespace ppapi | 88 } // namespace ppapi |
| 89 | 89 |
| 90 #endif // PPAPI_PPB_URL_LOADER_PROXY_H_ | 90 #endif // PPAPI_PPB_URL_LOADER_PROXY_H_ |
| OLD | NEW |