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 URLRequestInfoData; | 23 struct URLRequestInfoData; |
| 24 struct URLResponseInfoData; |
24 | 25 |
25 namespace proxy { | 26 namespace proxy { |
26 | 27 |
27 struct PPBURLLoader_UpdateProgress_Params; | 28 struct PPBURLLoader_UpdateProgress_Params; |
28 | 29 |
29 class PPB_URLLoader_Proxy : public InterfaceProxy { | 30 class PPB_URLLoader_Proxy : public InterfaceProxy { |
30 public: | 31 public: |
31 PPB_URLLoader_Proxy(Dispatcher* dispatcher); | 32 PPB_URLLoader_Proxy(Dispatcher* dispatcher); |
32 virtual ~PPB_URLLoader_Proxy(); | 33 virtual ~PPB_URLLoader_Proxy(); |
33 | 34 |
(...skipping 20 matching lines...) Expand all Loading... |
54 static const ApiID kApiID = API_ID_PPB_URL_LOADER; | 55 static const ApiID kApiID = API_ID_PPB_URL_LOADER; |
55 | 56 |
56 private: | 57 private: |
57 // Plugin->renderer message handlers. | 58 // Plugin->renderer message handlers. |
58 void OnMsgCreate(PP_Instance instance, | 59 void OnMsgCreate(PP_Instance instance, |
59 HostResource* result); | 60 HostResource* result); |
60 void OnMsgOpen(const HostResource& loader, | 61 void OnMsgOpen(const HostResource& loader, |
61 const URLRequestInfoData& data); | 62 const URLRequestInfoData& data); |
62 void OnMsgFollowRedirect(const HostResource& loader); | 63 void OnMsgFollowRedirect(const HostResource& loader); |
63 void OnMsgGetResponseInfo(const HostResource& loader, | 64 void OnMsgGetResponseInfo(const HostResource& loader, |
64 HostResource* result); | 65 bool* success, |
| 66 URLResponseInfoData* result); |
65 void OnMsgReadResponseBody(const HostResource& loader, | 67 void OnMsgReadResponseBody(const HostResource& loader, |
66 int32_t bytes_to_read); | 68 int32_t bytes_to_read); |
67 void OnMsgFinishStreamingToFile(const HostResource& loader); | 69 void OnMsgFinishStreamingToFile(const HostResource& loader); |
68 void OnMsgClose(const HostResource& loader); | 70 void OnMsgClose(const HostResource& loader); |
69 void OnMsgGrantUniversalAccess(const HostResource& loader); | 71 void OnMsgGrantUniversalAccess(const HostResource& loader); |
70 | 72 |
71 // Renderer->plugin message handlers. | 73 // Renderer->plugin message handlers. |
72 void OnMsgUpdateProgress( | 74 void OnMsgUpdateProgress( |
73 const PPBURLLoader_UpdateProgress_Params& params); | 75 const PPBURLLoader_UpdateProgress_Params& params); |
74 void OnMsgReadResponseBodyAck(const IPC::Message& message); | 76 void OnMsgReadResponseBodyAck(const IPC::Message& message); |
75 void OnMsgCallbackComplete(const HostResource& host_resource, int32_t result); | 77 void OnMsgCallbackComplete(const HostResource& host_resource, int32_t result); |
76 | 78 |
77 // Handles callbacks for read complete messages. Takes ownership of the | 79 // Handles callbacks for read complete messages. Takes ownership of the |
78 // message pointer. | 80 // message pointer. |
79 void OnReadCallback(int32_t result, IPC::Message* message); | 81 void OnReadCallback(int32_t result, IPC::Message* message); |
80 | 82 |
81 // Handles callback for everything but reads. | 83 // Handles callback for everything but reads. |
82 void OnCallback(int32_t result, const HostResource& resource); | 84 void OnCallback(int32_t result, const HostResource& resource); |
83 | 85 |
84 ProxyCompletionCallbackFactory<PPB_URLLoader_Proxy> callback_factory_; | 86 ProxyCompletionCallbackFactory<PPB_URLLoader_Proxy> callback_factory_; |
85 }; | 87 }; |
86 | 88 |
87 } // namespace proxy | 89 } // namespace proxy |
88 } // namespace ppapi | 90 } // namespace ppapi |
89 | 91 |
90 #endif // PPAPI_PPB_URL_LOADER_PROXY_H_ | 92 #endif // PPAPI_PPB_URL_LOADER_PROXY_H_ |
OLD | NEW |