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. | 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 // Structure containing timing information for the request. It addresses | 46 // Structure containing timing information for the request. It addresses |
47 // http://groups.google.com/group/http-archive-specification/web/har-1-1-spec | 47 // http://groups.google.com/group/http-archive-specification/web/har-1-1-spec |
48 // and http://dev.w3.org/2006/webapi/WebTiming/ needs. | 48 // and http://dev.w3.org/2006/webapi/WebTiming/ needs. |
49 // | 49 // |
50 // All the values for starts and ends are given in milliseconds and are | 50 // All the values for starts and ends are given in milliseconds and are |
51 // offsets with respect to the given base time. | 51 // offsets with respect to the given base time. |
52 struct ResourceLoadTimingInfo { | 52 struct ResourceLoadTimingInfo { |
53 WEBKIT_GLUE_EXPORT ResourceLoadTimingInfo(); | 53 WEBKIT_GLUE_EXPORT ResourceLoadTimingInfo(); |
54 WEBKIT_GLUE_EXPORT ~ResourceLoadTimingInfo(); | 54 WEBKIT_GLUE_EXPORT ~ResourceLoadTimingInfo(); |
55 | 55 |
56 // All the values in this struct are given as offsets in milliseconds wrt | 56 // All the values in this struct are given as offsets in ticks wrt |
57 // this base time. | 57 // this base tick count. |
| 58 base::TimeTicks base_ticks; |
| 59 |
| 60 // The value of Time::Now() when base_ticks was set. |
58 base::Time base_time; | 61 base::Time base_time; |
59 | 62 |
60 // The time that proxy processing started. For requests with no proxy phase, | 63 // The time that proxy processing started. For requests with no proxy phase, |
61 // this time is -1. | 64 // this time is -1. |
62 int32 proxy_start; | 65 int32 proxy_start; |
63 | 66 |
64 // The time that proxy processing ended. For reused sockets this time | 67 // The time that proxy processing ended. For reused sockets this time |
65 // is -1. | 68 // is -1. |
66 int32 proxy_end; | 69 int32 proxy_end; |
67 | 70 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 virtual void OnReceivedData(const char* data, | 325 virtual void OnReceivedData(const char* data, |
323 int data_length, | 326 int data_length, |
324 int encoded_data_length) = 0; | 327 int encoded_data_length) = 0; |
325 | 328 |
326 // Called when metadata generated by the renderer is retrieved from the | 329 // Called when metadata generated by the renderer is retrieved from the |
327 // cache. This method may be called zero or one times. | 330 // cache. This method may be called zero or one times. |
328 virtual void OnReceivedCachedMetadata(const char* data, int len) { } | 331 virtual void OnReceivedCachedMetadata(const char* data, int len) { } |
329 | 332 |
330 // Called when the response is complete. This method signals completion of | 333 // Called when the response is complete. This method signals completion of |
331 // the resource load.ff | 334 // the resource load.ff |
332 virtual void OnCompletedRequest(const net::URLRequestStatus& status, | 335 virtual void OnCompletedRequest( |
333 const std::string& security_info, | 336 const net::URLRequestStatus& status, |
334 const base::Time& completion_time) = 0; | 337 const std::string& security_info, |
| 338 const base::TimeTicks& completion_time) = 0; |
335 }; | 339 }; |
336 | 340 |
337 // use WebKitPlatformSupportImpl::CreateResourceLoader() for construction, but | 341 // use WebKitPlatformSupportImpl::CreateResourceLoader() for construction, but |
338 // anybody can delete at any time, INCLUDING during processing of callbacks. | 342 // anybody can delete at any time, INCLUDING during processing of callbacks. |
339 WEBKIT_GLUE_EXPORT virtual ~ResourceLoaderBridge(); | 343 WEBKIT_GLUE_EXPORT virtual ~ResourceLoaderBridge(); |
340 | 344 |
341 // Call this method before calling Start() to append a chunk of binary data | 345 // Call this method before calling Start() to append a chunk of binary data |
342 // to the request body. May only be used with HTTP(S) POST requests. | 346 // to the request body. May only be used with HTTP(S) POST requests. |
343 virtual void AppendDataToUpload(const char* data, int data_len) = 0; | 347 virtual void AppendDataToUpload(const char* data, int data_len) = 0; |
344 | 348 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 // methods may be called to construct the body of the request. | 403 // methods may be called to construct the body of the request. |
400 WEBKIT_GLUE_EXPORT ResourceLoaderBridge(); | 404 WEBKIT_GLUE_EXPORT ResourceLoaderBridge(); |
401 | 405 |
402 private: | 406 private: |
403 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); | 407 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); |
404 }; | 408 }; |
405 | 409 |
406 } // namespace webkit_glue | 410 } // namespace webkit_glue |
407 | 411 |
408 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ | 412 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ |
OLD | NEW |