| 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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 203 // the peer is still valid. | 203 // the peer is still valid. |
| 204 virtual void Cancel() = 0; | 204 virtual void Cancel() = 0; |
| 205 | 205 |
| 206 // Call this method to suspend or resume a load that is in progress. This | 206 // 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. | 207 // method may only be called after a successful call to the Start method. |
| 208 virtual void SetDefersLoading(bool value) = 0; | 208 virtual void SetDefersLoading(bool value) = 0; |
| 209 | 209 |
| 210 // Call this method when the priority of the requested resource changes after | 210 // 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 | 211 // Start() has been called. This method may only be called after a successful |
| 212 // call to the Start method. | 212 // call to the Start method. |
| 213 virtual void DidChangePriority(net::RequestPriority new_priority) = 0; | 213 virtual void DidChangePriority(net::RequestPriority new_priority, |
| 214 int intra_priority_value) = 0; |
| 214 | 215 |
| 215 // Call this method to load the resource synchronously (i.e., in one shot). | 216 // 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 | 217 // 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 | 218 // 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 | 219 // 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 | 220 // 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 | 221 // interrupt this method. Errors are reported via the status field of the |
| 221 // response parameter. | 222 // response parameter. |
| 222 virtual void SyncLoad(SyncLoadResponse* response) = 0; | 223 virtual void SyncLoad(SyncLoadResponse* response) = 0; |
| 223 | 224 |
| 224 protected: | 225 protected: |
| 225 // Construction must go through | 226 // Construction must go through |
| 226 // WebKitPlatformSupportImpl::CreateResourceLoader() | 227 // WebKitPlatformSupportImpl::CreateResourceLoader() |
| 227 // For HTTP(S) POST requests, the AppendDataToUpload and AppendFileToUpload | 228 // For HTTP(S) POST requests, the AppendDataToUpload and AppendFileToUpload |
| 228 // methods may be called to construct the body of the request. | 229 // methods may be called to construct the body of the request. |
| 229 WEBKIT_CHILD_EXPORT ResourceLoaderBridge(); | 230 WEBKIT_CHILD_EXPORT ResourceLoaderBridge(); |
| 230 | 231 |
| 231 private: | 232 private: |
| 232 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); | 233 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); |
| 233 }; | 234 }; |
| 234 | 235 |
| 235 } // namespace webkit_glue | 236 } // namespace webkit_glue |
| 236 | 237 |
| 237 #endif // WEBKIT_CHILD_RESOURCE_LOADER_BRIDGE_H_ | 238 #endif // WEBKIT_CHILD_RESOURCE_LOADER_BRIDGE_H_ |
| OLD | NEW |