Changeset 183795 in webkit
- Timestamp:
- May 4, 2015 9:49:00 PM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r183794 r183795 1 2015-05-04 Andreas Kling <akling@apple.com> 2 3 Record the reference time when Performance is constructed. 4 <https://webkit.org/b/144616> 5 6 Reviewed by Geoffrey Garen. 7 8 This is a merge of Blink's r156613 by simonjam@chromium.org. 9 10 Cache a copy of the DocumentLoader's reference timestamp when constructing 11 the Performance object. That way we don't have to jump through a bunch of scary 12 hoops to access it when now() is called later on. 13 14 * page/Performance.cpp: 15 (WebCore::Performance::Performance): 16 (WebCore::Performance::now): Deleted. 17 * page/Performance.h: 18 1 19 2015-05-04 Simon Fraser <simon.fraser@apple.com> 2 20 -
trunk/Source/WebCore/loader/DocumentLoadTiming.h
r168647 r183795 68 68 bool hasSameOriginAsPreviousDocument() const { return m_hasSameOriginAsPreviousDocument; } 69 69 70 double referenceMonotonicTime() const { return m_referenceMonotonicTime; } 71 70 72 private: 71 73 double m_referenceMonotonicTime; -
trunk/Source/WebCore/page/Performance.cpp
r179937 r183795 61 61 , m_userTiming(0) 62 62 #endif // ENABLE(USER_TIMING) 63 { 63 , m_referenceTime(frame->document()->loader()->timing().referenceMonotonicTime()) 64 { 65 ASSERT(m_referenceTime); 64 66 } 65 67 … … 229 231 double Performance::now() const 230 232 { 231 if (!frame()) 232 return 0; 233 234 return 1000.0 * m_frame->document()->loader()->timing().monotonicTimeToZeroBasedDocumentTime(monotonicallyIncreasingTime()); 233 return 1000.0 * (WTF::monotonicallyIncreasingTime() - m_referenceTime); 235 234 } 236 235 -
trunk/Source/WebCore/page/Performance.h
r181169 r183795 104 104 #endif 105 105 106 double m_referenceTime; 107 106 108 #if ENABLE(USER_TIMING) 107 109 RefPtr<UserTiming> m_userTiming;
Note: See TracChangeset
for help on using the changeset viewer.