Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: webkit/glue/resource_loader_bridge.h

Issue 7602023: Use a monotonic clock (TimeTicks) to report network times to WebCore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pass TimeTicks in ResourceLoadTimingInfo Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // Structure containing timing information for the request. It addresses 45 // Structure containing timing information for the request. It addresses
46 // http://groups.google.com/group/http-archive-specification/web/har-1-1-spec 46 // http://groups.google.com/group/http-archive-specification/web/har-1-1-spec
47 // and http://dev.w3.org/2006/webapi/WebTiming/ needs. 47 // and http://dev.w3.org/2006/webapi/WebTiming/ needs.
48 // 48 //
49 // All the values for starts and ends are given in milliseconds and are 49 // All the values for starts and ends are given in milliseconds and are
50 // offsets with respect to the given base time. 50 // offsets with respect to the given base time.
51 struct ResourceLoadTimingInfo { 51 struct ResourceLoadTimingInfo {
52 ResourceLoadTimingInfo(); 52 ResourceLoadTimingInfo();
53 ~ResourceLoadTimingInfo(); 53 ~ResourceLoadTimingInfo();
54 54
55 // All the values in this struct are given as offsets in milliseconds wrt 55 // All the values in this struct are given as offsets in ticks wrt
56 // this base time. 56 // this base tick count.
wtc 2011/08/26 23:39:15 If the values are offsets wrt base_ticks, the valu
57 base::TimeTicks base_ticks;
58
59 // The value of Time::Now() when base_ticks was set.
57 base::Time base_time; 60 base::Time base_time;
58 61
59 // The time that proxy processing started. For requests with no proxy phase, 62 // The time that proxy processing started. For requests with no proxy phase,
60 // this time is -1. 63 // this time is -1.
61 int32 proxy_start; 64 int32 proxy_start;
62 65
63 // The time that proxy processing ended. For reused sockets this time 66 // The time that proxy processing ended. For reused sockets this time
64 // is -1. 67 // is -1.
65 int32 proxy_end; 68 int32 proxy_end;
66 69
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 virtual void OnReceivedData(const char* data, 320 virtual void OnReceivedData(const char* data,
318 int data_length, 321 int data_length,
319 int encoded_data_length) = 0; 322 int encoded_data_length) = 0;
320 323
321 // Called when metadata generated by the renderer is retrieved from the 324 // Called when metadata generated by the renderer is retrieved from the
322 // cache. This method may be called zero or one times. 325 // cache. This method may be called zero or one times.
323 virtual void OnReceivedCachedMetadata(const char* data, int len) { } 326 virtual void OnReceivedCachedMetadata(const char* data, int len) { }
324 327
325 // Called when the response is complete. This method signals completion of 328 // Called when the response is complete. This method signals completion of
326 // the resource load.ff 329 // the resource load.ff
327 virtual void OnCompletedRequest(const net::URLRequestStatus& status, 330 virtual void OnCompletedRequest(
328 const std::string& security_info, 331 const net::URLRequestStatus& status,
329 const base::Time& completion_time) = 0; 332 const std::string& security_info,
333 const base::TimeTicks& completion_time) = 0;
330 }; 334 };
331 335
332 // use Create() for construction, but anybody can delete at any time, 336 // use Create() for construction, but anybody can delete at any time,
333 // INCLUDING during processing of callbacks. 337 // INCLUDING during processing of callbacks.
334 virtual ~ResourceLoaderBridge(); 338 virtual ~ResourceLoaderBridge();
335 339
336 // Call this method to make a new instance. 340 // Call this method to make a new instance.
337 // 341 //
338 // For HTTP(S) POST requests, the AppendDataToUpload and AppendFileToUpload 342 // For HTTP(S) POST requests, the AppendDataToUpload and AppendFileToUpload
339 // methods may be called to construct the body of the request. 343 // methods may be called to construct the body of the request.
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 // construction must go through Create() 401 // construction must go through Create()
398 ResourceLoaderBridge(); 402 ResourceLoaderBridge();
399 403
400 private: 404 private:
401 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge); 405 DISALLOW_COPY_AND_ASSIGN(ResourceLoaderBridge);
402 }; 406 };
403 407
404 } // namespace webkit_glue 408 } // namespace webkit_glue
405 409
406 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_ 410 #endif // WEBKIT_GLUE_RESOURCE_LOADER_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698