| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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, which also provides a factory method Create | 7 // implemented by the embedder, which also provides a factory method Create |
| 8 // to instantiate this object. | 8 // to instantiate this object. |
| 9 // | 9 // |
| 10 // One of these objects will be created by WebKit for each request. WebKit | 10 // One of these objects will be created by WebKit for each request. WebKit |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 virtual void OnReceivedResponse(const ResourceResponseInfo& info) = 0; | 295 virtual void OnReceivedResponse(const ResourceResponseInfo& info) = 0; |
| 296 | 296 |
| 297 // Called when a chunk of response data is downloaded. This method may be | 297 // Called when a chunk of response data is downloaded. This method may be |
| 298 // called multiple times or not at all if an error occurs. This method is | 298 // called multiple times or not at all if an error occurs. This method is |
| 299 // only called if RequestInfo::download_to_file was set to true, and in | 299 // only called if RequestInfo::download_to_file was set to true, and in |
| 300 // that case, OnReceivedData will not be called. | 300 // that case, OnReceivedData will not be called. |
| 301 virtual void OnDownloadedData(int len) = 0; | 301 virtual void OnDownloadedData(int len) = 0; |
| 302 | 302 |
| 303 // Called when a chunk of response data is available. This method may | 303 // Called when a chunk of response data is available. This method may |
| 304 // be called multiple times or not at all if an error occurs. | 304 // be called multiple times or not at all if an error occurs. |
| 305 virtual void OnReceivedData(const char* data, int len) = 0; | 305 virtual void OnReceivedData(const char* data, |
| 306 int data_length, |
| 307 int length_received) = 0; |
| 306 | 308 |
| 307 // Called when metadata generated by the renderer is retrieved from the | 309 // Called when metadata generated by the renderer is retrieved from the |
| 308 // cache. This method may be called zero or one times. | 310 // cache. This method may be called zero or one times. |
| 309 virtual void OnReceivedCachedMetadata(const char* data, int len) { } | 311 virtual void OnReceivedCachedMetadata(const char* data, int len) { } |
| 310 | 312 |
| 311 // Called when the response is complete. This method signals completion of | 313 // Called when the response is complete. This method signals completion of |
| 312 // the resource load.ff | 314 // the resource load.ff |
| 313 virtual void OnCompletedRequest(const net::URLRequestStatus& status, | 315 virtual void OnCompletedRequest(const net::URLRequestStatus& status, |
| 314 const std::string& security_info, | 316 const std::string& security_info, |
| 315 const base::Time& completion_time) = 0; | 317 const base::Time& completion_time) = 0; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 // construction must go through Create() | 381 // construction must go through Create() |
| 380 ResourceLoaderBridge(); | 382 ResourceLoaderBridge(); |
| 381 | 383 |
| 382 private: | 384 private: |
| 383 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); | 385 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); |
| 384 }; | 386 }; |
| 385 | 387 |
| 386 } // namespace webkit_glue | 388 } // namespace webkit_glue |
| 387 | 389 |
| 388 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ | 390 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |
| OLD | NEW |