OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |