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 // The intent of this file is to provide a type-neutral abstraction between | 5 // The intent of this file is to provide a type-neutral abstraction between |
6 // Chrome and WebKit for resource loading. This pure-virtual interface is | 6 // Chrome and WebKit for resource loading. This pure-virtual interface is |
7 // implemented by the embedder. | 7 // implemented by the embedder. |
8 // | 8 // |
9 // One of these objects will be created by WebKit for each request. WebKit | 9 // One of these objects will be created by WebKit for each request. WebKit |
10 // will own the pointer to the bridge, and will delete it when the request is | 10 // will own the pointer to the bridge, and will delete it when the request is |
(...skipping 15 matching lines...) Expand all Loading... | |
26 #include "base/platform_file.h" | 26 #include "base/platform_file.h" |
27 #include "base/values.h" | 27 #include "base/values.h" |
28 #include "net/base/request_priority.h" | 28 #include "net/base/request_priority.h" |
29 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" | 29 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" |
30 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 30 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
31 #include "url/gurl.h" | 31 #include "url/gurl.h" |
32 #include "webkit/child/webkit_child_export.h" | 32 #include "webkit/child/webkit_child_export.h" |
33 #include "webkit/common/resource_response_info.h" | 33 #include "webkit/common/resource_response_info.h" |
34 #include "webkit/common/resource_type.h" | 34 #include "webkit/common/resource_type.h" |
35 | 35 |
36 namespace blink { | |
37 class WebThreadedDataReceiver; | |
38 } | |
39 | |
36 // TODO(pilgrim) remove this once resource loader is moved to content | 40 // TODO(pilgrim) remove this once resource loader is moved to content |
37 // http://crbug.com/338338 | 41 // http://crbug.com/338338 |
38 namespace content { | 42 namespace content { |
39 class ResourceRequestBody; | 43 class ResourceRequestBody; |
40 } | 44 } |
41 | 45 |
42 namespace webkit_glue { | 46 namespace webkit_glue { |
43 | 47 |
44 class ResourceLoaderBridge { | 48 class ResourceLoaderBridge { |
45 public: | 49 public: |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 | 214 |
211 // Call this method to suspend or resume a load that is in progress. This | 215 // Call this method to suspend or resume a load that is in progress. This |
212 // method may only be called after a successful call to the Start method. | 216 // method may only be called after a successful call to the Start method. |
213 virtual void SetDefersLoading(bool value) = 0; | 217 virtual void SetDefersLoading(bool value) = 0; |
214 | 218 |
215 // Call this method when the priority of the requested resource changes after | 219 // Call this method when the priority of the requested resource changes after |
216 // Start() has been called. This method may only be called after a successful | 220 // Start() has been called. This method may only be called after a successful |
217 // call to the Start method. | 221 // call to the Start method. |
218 virtual void DidChangePriority(net::RequestPriority new_priority) = 0; | 222 virtual void DidChangePriority(net::RequestPriority new_priority) = 0; |
219 | 223 |
224 // Call this method to attach a data receiver which will receive resource data | |
225 // on its own thread. | |
226 virtual bool AttachThreadedDataReceiver( | |
227 blink::WebThreadedDataReceiver* threadedDataReceiver) = 0; | |
darin (slow to review)
2014/03/19 03:51:28
nit: threaded_data_receiver
| |
228 | |
220 // Call this method to load the resource synchronously (i.e., in one shot). | 229 // Call this method to load the resource synchronously (i.e., in one shot). |
221 // This is an alternative to the Start method. Be warned that this method | 230 // This is an alternative to the Start method. Be warned that this method |
222 // will block the calling thread until the resource is fully downloaded or an | 231 // will block the calling thread until the resource is fully downloaded or an |
223 // error occurs. It could block the calling thread for a long time, so only | 232 // error occurs. It could block the calling thread for a long time, so only |
224 // use this if you really need it! There is also no way for the caller to | 233 // use this if you really need it! There is also no way for the caller to |
225 // interrupt this method. Errors are reported via the status field of the | 234 // interrupt this method. Errors are reported via the status field of the |
226 // response parameter. | 235 // response parameter. |
227 virtual void SyncLoad(SyncLoadResponse* response) = 0; | 236 virtual void SyncLoad(SyncLoadResponse* response) = 0; |
228 | 237 |
229 protected: | 238 protected: |
230 // Construction must go through | 239 // Construction must go through |
231 // WebKitPlatformSupportImpl::CreateResourceLoader() | 240 // WebKitPlatformSupportImpl::CreateResourceLoader() |
232 // For HTTP(S) POST requests, the AppendDataToUpload and AppendFileToUpload | 241 // For HTTP(S) POST requests, the AppendDataToUpload and AppendFileToUpload |
233 // methods may be called to construct the body of the request. | 242 // methods may be called to construct the body of the request. |
234 WEBKIT_CHILD_EXPORT ResourceLoaderBridge(); | 243 WEBKIT_CHILD_EXPORT ResourceLoaderBridge(); |
235 | 244 |
236 private: | 245 private: |
237 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); | 246 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); |
238 }; | 247 }; |
239 | 248 |
240 } // namespace webkit_glue | 249 } // namespace webkit_glue |
241 | 250 |
242 #endif // WEBKIT_CHILD_RESOURCE_LOADER_BRIDGE_H_ | 251 #endif // WEBKIT_CHILD_RESOURCE_LOADER_BRIDGE_H_ |
OLD | NEW |