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 WebThreadedResourceProvider; | |
38 } | |
39 | |
36 namespace webkit_glue { | 40 namespace webkit_glue { |
37 class ResourceRequestBody; | 41 class ResourceRequestBody; |
38 | 42 |
39 class ResourceLoaderBridge { | 43 class ResourceLoaderBridge { |
40 public: | 44 public: |
41 // Structure used when calling | 45 // Structure used when calling |
42 // WebKitPlatformSupportImpl::CreateResourceLoader(). | 46 // WebKitPlatformSupportImpl::CreateResourceLoader(). |
43 struct WEBKIT_CHILD_EXPORT RequestInfo { | 47 struct WEBKIT_CHILD_EXPORT RequestInfo { |
44 RequestInfo(); | 48 RequestInfo(); |
45 ~RequestInfo(); | 49 ~RequestInfo(); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
205 | 209 |
206 // Call this method to suspend or resume a load that is in progress. This | 210 // Call this method to suspend or resume a load that is in progress. This |
207 // method may only be called after a successful call to the Start method. | 211 // method may only be called after a successful call to the Start method. |
208 virtual void SetDefersLoading(bool value) = 0; | 212 virtual void SetDefersLoading(bool value) = 0; |
209 | 213 |
210 // Call this method when the priority of the requested resource changes after | 214 // Call this method when the priority of the requested resource changes after |
211 // Start() has been called. This method may only be called after a successful | 215 // Start() has been called. This method may only be called after a successful |
212 // call to the Start method. | 216 // call to the Start method. |
213 virtual void DidChangePriority(net::RequestPriority new_priority) = 0; | 217 virtual void DidChangePriority(net::RequestPriority new_priority) = 0; |
214 | 218 |
219 // Call this method to request an implementation of | |
220 // WebThreadedResourceProvider which will be used to interact with the parser | |
darin (slow to review)
2014/02/11 07:05:00
It seems unnecessary to mention the "parser thread
| |
221 // thread. | |
222 virtual blink::WebThreadedResourceProvider* | |
223 CreateThreadedResourceProvider() = 0; | |
224 | |
215 // Call this method to load the resource synchronously (i.e., in one shot). | 225 // Call this method to load the resource synchronously (i.e., in one shot). |
216 // This is an alternative to the Start method. Be warned that this method | 226 // This is an alternative to the Start method. Be warned that this method |
217 // will block the calling thread until the resource is fully downloaded or an | 227 // will block the calling thread until the resource is fully downloaded or an |
218 // error occurs. It could block the calling thread for a long time, so only | 228 // error occurs. It could block the calling thread for a long time, so only |
219 // use this if you really need it! There is also no way for the caller to | 229 // use this if you really need it! There is also no way for the caller to |
220 // interrupt this method. Errors are reported via the status field of the | 230 // interrupt this method. Errors are reported via the status field of the |
221 // response parameter. | 231 // response parameter. |
222 virtual void SyncLoad(SyncLoadResponse* response) = 0; | 232 virtual void SyncLoad(SyncLoadResponse* response) = 0; |
223 | 233 |
224 protected: | 234 protected: |
225 // Construction must go through | 235 // Construction must go through |
226 // WebKitPlatformSupportImpl::CreateResourceLoader() | 236 // WebKitPlatformSupportImpl::CreateResourceLoader() |
227 // For HTTP(S) POST requests, the AppendDataToUpload and AppendFileToUpload | 237 // For HTTP(S) POST requests, the AppendDataToUpload and AppendFileToUpload |
228 // methods may be called to construct the body of the request. | 238 // methods may be called to construct the body of the request. |
229 WEBKIT_CHILD_EXPORT ResourceLoaderBridge(); | 239 WEBKIT_CHILD_EXPORT ResourceLoaderBridge(); |
230 | 240 |
231 private: | 241 private: |
232 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); | 242 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); |
233 }; | 243 }; |
234 | 244 |
235 } // namespace webkit_glue | 245 } // namespace webkit_glue |
236 | 246 |
237 #endif // WEBKIT_CHILD_RESOURCE_LOADER_BRIDGE_H_ | 247 #endif // WEBKIT_CHILD_RESOURCE_LOADER_BRIDGE_H_ |
OLD | NEW |