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

Side by Side Diff: Source/core/timing/PerformanceResourceTiming.cpp

Issue 1152673004: Add workerStart attribute to ResourceTiming (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2012 Intel Inc. All rights reserved. 3 * Copyright (C) 2012 Intel Inc. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 PerformanceResourceTiming::~PerformanceResourceTiming() 63 PerformanceResourceTiming::~PerformanceResourceTiming()
64 { 64 {
65 } 65 }
66 66
67 AtomicString PerformanceResourceTiming::initiatorType() const 67 AtomicString PerformanceResourceTiming::initiatorType() const
68 { 68 {
69 return m_initiatorType; 69 return m_initiatorType;
70 } 70 }
71 71
72 double PerformanceResourceTiming::workerStart() const
73 {
74 if (!m_timing || m_timing->workerStart() == 0.0)
75 return 0.0;
76
77 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m_tim ing->workerStart());
78 }
79
72 double PerformanceResourceTiming::redirectStart() const 80 double PerformanceResourceTiming::redirectStart() const
73 { 81 {
74 if (!m_lastRedirectEndTime || !m_allowRedirectDetails) 82 if (!m_lastRedirectEndTime || !m_allowRedirectDetails)
75 return 0.0; 83 return 0.0;
76 84
85 if (double workerStartTime = workerStart())
86 return workerStartTime;
87
77 return PerformanceEntry::startTime(); 88 return PerformanceEntry::startTime();
78 } 89 }
79 90
80 double PerformanceResourceTiming::redirectEnd() const 91 double PerformanceResourceTiming::redirectEnd() const
81 { 92 {
82 if (!m_lastRedirectEndTime || !m_allowRedirectDetails) 93 if (!m_lastRedirectEndTime || !m_allowRedirectDetails)
83 return 0.0; 94 return 0.0;
84 95
85 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m_las tRedirectEndTime); 96 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m_las tRedirectEndTime);
86 } 97 }
87 98
88 double PerformanceResourceTiming::fetchStart() const 99 double PerformanceResourceTiming::fetchStart() const
89 { 100 {
90 if (m_lastRedirectEndTime) { 101 if (m_lastRedirectEndTime) {
91 // FIXME: ASSERT(m_timing) should be in constructor once timeticks of 102 // FIXME: ASSERT(m_timing) should be in constructor once timeticks of
92 // AppCache is exposed from chrome network stack, crbug/251100 103 // AppCache is exposed from chrome network stack, crbug/251100
93 ASSERT(m_timing); 104 ASSERT(m_timing);
94 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m _timing->requestTime()); 105 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m _timing->requestTime());
95 } 106 }
96 107
108 if (double workerStartTime = workerStart())
109 return workerStartTime;
110
97 return PerformanceEntry::startTime(); 111 return PerformanceEntry::startTime();
98 } 112 }
99 113
100 double PerformanceResourceTiming::domainLookupStart() const 114 double PerformanceResourceTiming::domainLookupStart() const
101 { 115 {
102 if (!m_allowTimingDetails) 116 if (!m_allowTimingDetails)
103 return 0.0; 117 return 0.0;
104 118
105 if (!m_timing || m_timing->dnsStart() == 0.0) 119 if (!m_timing || m_timing->dnsStart() == 0.0)
106 return fetchStart(); 120 return fetchStart();
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m_fin ishTime); 204 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m_fin ishTime);
191 } 205 }
192 206
193 DEFINE_TRACE(PerformanceResourceTiming) 207 DEFINE_TRACE(PerformanceResourceTiming)
194 { 208 {
195 visitor->trace(m_requestingDocument); 209 visitor->trace(m_requestingDocument);
196 PerformanceEntry::trace(visitor); 210 PerformanceEntry::trace(visitor);
197 } 211 }
198 212
199 } // namespace blink 213 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/timing/PerformanceResourceTiming.h ('k') | Source/core/timing/PerformanceResourceTiming.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698