OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 CONTENT_RENDERER_PEPPER_PEPPER_URL_LOADER_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_URL_LOADER_HOST_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_URL_LOADER_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_URL_LOADER_HOST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 #include "ppapi/host/resource_host.h" | 11 #include "ppapi/host/resource_host.h" |
12 #include "ppapi/proxy/resource_message_params.h" | 12 #include "ppapi/proxy/resource_message_params.h" |
13 #include "ppapi/shared_impl/url_request_info_data.h" | 13 #include "ppapi/shared_impl/url_request_info_data.h" |
14 #include "ppapi/shared_impl/url_response_info_data.h" | 14 #include "ppapi/shared_impl/url_response_info_data.h" |
15 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" | 15 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" |
16 | 16 |
17 namespace WebKit { | 17 namespace WebKit { |
18 class WebFrame; | 18 class WebFrame; |
19 class WebURLLoader; | 19 class WebURLLoader; |
20 } | 20 } |
21 | 21 |
22 namespace content { | 22 namespace content { |
23 | 23 |
24 class RendererPpapiHost; | 24 class RendererPpapiHostImpl; |
25 | 25 |
26 class PepperURLLoaderHost | 26 class PepperURLLoaderHost |
27 : public ppapi::host::ResourceHost, | 27 : public ppapi::host::ResourceHost, |
28 public WebKit::WebURLLoaderClient { | 28 public WebKit::WebURLLoaderClient { |
29 public: | 29 public: |
30 // If main_document_loader is true, PP_Resource must be 0 since it will be | 30 // If main_document_loader is true, PP_Resource must be 0 since it will be |
31 // pending until the plugin resource attaches to it. | 31 // pending until the plugin resource attaches to it. |
32 PepperURLLoaderHost(RendererPpapiHost* host, | 32 PepperURLLoaderHost(RendererPpapiHostImpl* host, |
33 bool main_document_loader, | 33 bool main_document_loader, |
34 PP_Instance instance, | 34 PP_Instance instance, |
35 PP_Resource resource); | 35 PP_Resource resource); |
36 virtual ~PepperURLLoaderHost(); | 36 virtual ~PepperURLLoaderHost(); |
37 | 37 |
38 // ResourceHost implementation. | 38 // ResourceHost implementation. |
39 virtual int32_t OnResourceMessageReceived( | 39 virtual int32_t OnResourceMessageReceived( |
40 const IPC::Message& msg, | 40 const IPC::Message& msg, |
41 ppapi::host::HostMessageContext* context) OVERRIDE; | 41 ppapi::host::HostMessageContext* context) OVERRIDE; |
42 | 42 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // differences between document loads and regular ones. | 92 // differences between document loads and regular ones. |
93 void SetDefersLoading(bool defers_loading); | 93 void SetDefersLoading(bool defers_loading); |
94 | 94 |
95 // Converts a WebURLResponse to a URLResponseInfo and saves it. | 95 // Converts a WebURLResponse to a URLResponseInfo and saves it. |
96 void SaveResponse(const WebKit::WebURLResponse& response); | 96 void SaveResponse(const WebKit::WebURLResponse& response); |
97 | 97 |
98 // Sends the UpdateProgress message (if necessary) to the plugin. | 98 // Sends the UpdateProgress message (if necessary) to the plugin. |
99 void UpdateProgress(); | 99 void UpdateProgress(); |
100 | 100 |
101 // Non-owning pointer. | 101 // Non-owning pointer. |
102 RendererPpapiHost* renderer_ppapi_host_; | 102 RendererPpapiHostImpl* renderer_ppapi_host_; |
103 | 103 |
104 // If true, then the plugin instance is a full-frame plugin and we're just | 104 // If true, then the plugin instance is a full-frame plugin and we're just |
105 // wrapping the main document's loader (i.e. loader_ is null). | 105 // wrapping the main document's loader (i.e. loader_ is null). |
106 bool main_document_loader_; | 106 bool main_document_loader_; |
107 | 107 |
108 // The data that generated the request. | 108 // The data that generated the request. |
109 ppapi::URLRequestInfoData request_data_; | 109 ppapi::URLRequestInfoData request_data_; |
110 | 110 |
111 // Set to true when this loader can ignore same originl policy. | 111 // Set to true when this loader can ignore same originl policy. |
112 bool has_universal_access_; | 112 bool has_universal_access_; |
(...skipping 16 matching lines...) Expand all Loading... |
129 // to the plugin when the plugin side connects. The pointers are owned by | 129 // to the plugin when the plugin side connects. The pointers are owned by |
130 // this object and must be deleted. | 130 // this object and must be deleted. |
131 std::vector<IPC::Message*> pending_replies_; | 131 std::vector<IPC::Message*> pending_replies_; |
132 | 132 |
133 DISALLOW_COPY_AND_ASSIGN(PepperURLLoaderHost); | 133 DISALLOW_COPY_AND_ASSIGN(PepperURLLoaderHost); |
134 }; | 134 }; |
135 | 135 |
136 } // namespace content | 136 } // namespace content |
137 | 137 |
138 #endif // CONTENT_RENDERER_PEPPER_PEPPER_URL_LOADER_HOST_H_ | 138 #endif // CONTENT_RENDERER_PEPPER_PEPPER_URL_LOADER_HOST_H_ |
OLD | NEW |