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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 // response's mime type. This may be a derived value. | 134 // response's mime type. This may be a derived value. |
135 std::string charset; | 135 std::string charset; |
136 | 136 |
137 // An opaque string carrying security information pertaining to this | 137 // An opaque string carrying security information pertaining to this |
138 // response. This may include information about the SSL connection used. | 138 // response. This may include information about the SSL connection used. |
139 std::string security_info; | 139 std::string security_info; |
140 | 140 |
141 // Content length if available. -1 if not available | 141 // Content length if available. -1 if not available |
142 int64 content_length; | 142 int64 content_length; |
143 | 143 |
144 // Length of the raw data transferred over the network. In case there is no | |
145 // data, contains -1. | |
146 int64 raw_data_length; | |
147 | |
144 // The appcache this response was loaded from, or kNoCacheId. | 148 // The appcache this response was loaded from, or kNoCacheId. |
145 int64 appcache_id; | 149 int64 appcache_id; |
146 | 150 |
147 // The manifest url of the appcache this response was loaded from. | 151 // The manifest url of the appcache this response was loaded from. |
148 // Note: this value is only populated for main resource requests. | 152 // Note: this value is only populated for main resource requests. |
149 GURL appcache_manifest_url; | 153 GURL appcache_manifest_url; |
150 | 154 |
151 // Connection identifier from the underlying network stack. In case there | 155 // Connection identifier from the underlying network stack. In case there |
152 // is no associated connection, contains 0. | 156 // is no associated connection, contains 0. |
153 uint32 connection_id; | 157 uint32 connection_id; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
293 // been followed). | 297 // been followed). |
294 virtual void OnReceivedResponse(const ResourceResponseInfo& info) = 0; | 298 virtual void OnReceivedResponse(const ResourceResponseInfo& info) = 0; |
295 | 299 |
296 // Called when a chunk of response data is downloaded. This method may be | 300 // Called when a chunk of response data is downloaded. This method may be |
297 // called multiple times or not at all if an error occurs. This method is | 301 // called multiple times or not at all if an error occurs. This method is |
298 // only called if RequestInfo::download_to_file was set to true, and in | 302 // only called if RequestInfo::download_to_file was set to true, and in |
299 // that case, OnReceivedData will not be called. | 303 // that case, OnReceivedData will not be called. |
300 virtual void OnDownloadedData(int len) = 0; | 304 virtual void OnDownloadedData(int len) = 0; |
301 | 305 |
302 // Called when a chunk of response data is available. This method may | 306 // Called when a chunk of response data is available. This method may |
303 // be called multiple times or not at all if an error occurs. | 307 // be called multiple times or not at all if an error occurs. |
darin (slow to review)
2011/04/08 15:47:18
please document raw_data_length
vsevik
2011/04/08 16:23:48
Done.
| |
304 virtual void OnReceivedData(const char* data, int len) = 0; | 308 virtual void OnReceivedData(const char* data, |
309 int data_length, | |
310 int raw_data_length) = 0; | |
305 | 311 |
306 // Called when metadata generated by the renderer is retrieved from the | 312 // Called when metadata generated by the renderer is retrieved from the |
307 // cache. This method may be called zero or one times. | 313 // cache. This method may be called zero or one times. |
308 virtual void OnReceivedCachedMetadata(const char* data, int len) { } | 314 virtual void OnReceivedCachedMetadata(const char* data, int len) { } |
309 | 315 |
310 // Called when the response is complete. This method signals completion of | 316 // Called when the response is complete. This method signals completion of |
311 // the resource load.ff | 317 // the resource load.ff |
312 virtual void OnCompletedRequest(const net::URLRequestStatus& status, | 318 virtual void OnCompletedRequest(const net::URLRequestStatus& status, |
313 const std::string& security_info, | 319 const std::string& security_info, |
314 const base::Time& completion_time) = 0; | 320 const base::Time& completion_time) = 0; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
378 // construction must go through Create() | 384 // construction must go through Create() |
379 ResourceLoaderBridge(); | 385 ResourceLoaderBridge(); |
380 | 386 |
381 private: | 387 private: |
382 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); | 388 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); |
383 }; | 389 }; |
384 | 390 |
385 } // namespace webkit_glue | 391 } // namespace webkit_glue |
386 | 392 |
387 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ | 393 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |
OLD | NEW |