Bug 41824

Summary: Wire network times from ResourceLoadTiming to performance.timing
Product: WebKit Reporter: Tony Gentilcore <tonyg>
Component: WebCore Misc.Assignee: Tony Gentilcore <tonyg>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, fishd, pfeldman
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
Bug Depends on: 41332, 42091    
Bug Blocks: 30685    
Attachments:
Description Flags
Patch fishd: review+, fishd: commit-queue-

Description Tony Gentilcore 2010-07-07 18:12:41 PDT
Wire network times from ResourceLoadTiming to performance.timing for Web Timing feature
Comment 1 Tony Gentilcore 2010-07-12 21:35:27 PDT
Created attachment 61320 [details]
Patch
Comment 2 Darin Fisher (:fishd, Google) 2010-07-12 22:05:22 PDT
Comment on attachment 61320 [details]
Patch

WebCore/page/Timing.cpp:84
 +      return static_cast<unsigned long long>(domainLookupStart * 1000);
nit: use 1000.0 to improve readability (same nit applies elsewhere).  a
static helper function might also be nice: toIntegerMilliseconds(double)?

R=me
Comment 3 Tony Gentilcore 2010-07-13 16:29:40 PDT
(In reply to comment #2)
> (From update of attachment 61320 [details])
> WebCore/page/Timing.cpp:84
>  +      return static_cast<unsigned long long>(domainLookupStart * 1000);
> nit: use 1000.0 to improve readability (same nit applies elsewhere).  a
> static helper function might also be nice: toIntegerMilliseconds(double)?

Wow, that is so much cleaner. Thanks.

> 
> R=me

Landed r63259
Comment 4 Darin Fisher (:fishd, Google) 2010-07-13 23:00:08 PDT
Note: toIntegerMilliseconds probably would have been better as a file static instead of a class static.  that way it will have internal linkage and be optimized away to nothing (although that might still happen in this case).  class statics have external linkage by default.
Comment 5 Tony Gentilcore 2010-07-14 13:30:23 PDT
(In reply to comment #4)
> Note: toIntegerMilliseconds probably would have been better as a file static instead of a class static.  that way it will have internal linkage and be optimized away to nothing (although that might still happen in this case).  class statics have external linkage by default.

Great education for me. I assumed they would compile to the same thing.

I'll post a follow-up patch.