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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 } | 70 } |
71 | 71 |
72 double PerformanceResourceTiming::workerStart() const | 72 double PerformanceResourceTiming::workerStart() const |
73 { | 73 { |
74 if (!m_timing || m_timing->workerStart() == 0.0) | 74 if (!m_timing || m_timing->workerStart() == 0.0) |
75 return 0.0; | 75 return 0.0; |
76 | 76 |
77 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m_tim
ing->workerStart()); | 77 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m_tim
ing->workerStart()); |
78 } | 78 } |
79 | 79 |
| 80 double PerformanceResourceTiming::workerReady() const |
| 81 { |
| 82 if (!m_timing || m_timing->workerReady() == 0.0) |
| 83 return 0.0; |
| 84 |
| 85 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m_tim
ing->workerReady()); |
| 86 } |
| 87 |
80 double PerformanceResourceTiming::redirectStart() const | 88 double PerformanceResourceTiming::redirectStart() const |
81 { | 89 { |
82 if (!m_lastRedirectEndTime || !m_allowRedirectDetails) | 90 if (!m_lastRedirectEndTime || !m_allowRedirectDetails) |
83 return 0.0; | 91 return 0.0; |
84 | 92 |
85 if (double workerStartTime = workerStart()) | 93 if (double workerReadyTime = workerReady()) |
86 return workerStartTime; | 94 return workerReadyTime; |
87 | 95 |
88 return PerformanceEntry::startTime(); | 96 return PerformanceEntry::startTime(); |
89 } | 97 } |
90 | 98 |
91 double PerformanceResourceTiming::redirectEnd() const | 99 double PerformanceResourceTiming::redirectEnd() const |
92 { | 100 { |
93 if (!m_lastRedirectEndTime || !m_allowRedirectDetails) | 101 if (!m_lastRedirectEndTime || !m_allowRedirectDetails) |
94 return 0.0; | 102 return 0.0; |
95 | 103 |
96 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m_las
tRedirectEndTime); | 104 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m_las
tRedirectEndTime); |
97 } | 105 } |
98 | 106 |
99 double PerformanceResourceTiming::fetchStart() const | 107 double PerformanceResourceTiming::fetchStart() const |
100 { | 108 { |
101 if (m_lastRedirectEndTime) { | 109 if (m_lastRedirectEndTime) { |
102 // FIXME: ASSERT(m_timing) should be in constructor once timeticks of | 110 // FIXME: ASSERT(m_timing) should be in constructor once timeticks of |
103 // AppCache is exposed from chrome network stack, crbug/251100 | 111 // AppCache is exposed from chrome network stack, crbug/251100 |
104 ASSERT(m_timing); | 112 ASSERT(m_timing); |
105 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m
_timing->requestTime()); | 113 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m
_timing->requestTime()); |
106 } | 114 } |
107 | 115 |
108 if (double workerStartTime = workerStart()) | 116 if (double workerReadyTime = workerReady()) |
109 return workerStartTime; | 117 return workerReadyTime; |
110 | 118 |
111 return PerformanceEntry::startTime(); | 119 return PerformanceEntry::startTime(); |
112 } | 120 } |
113 | 121 |
114 double PerformanceResourceTiming::domainLookupStart() const | 122 double PerformanceResourceTiming::domainLookupStart() const |
115 { | 123 { |
116 if (!m_allowTimingDetails) | 124 if (!m_allowTimingDetails) |
117 return 0.0; | 125 return 0.0; |
118 | 126 |
119 if (!m_timing || m_timing->dnsStart() == 0.0) | 127 if (!m_timing || m_timing->dnsStart() == 0.0) |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m_fin
ishTime); | 212 return monotonicTimeToDocumentMilliseconds(m_requestingDocument.get(), m_fin
ishTime); |
205 } | 213 } |
206 | 214 |
207 DEFINE_TRACE(PerformanceResourceTiming) | 215 DEFINE_TRACE(PerformanceResourceTiming) |
208 { | 216 { |
209 visitor->trace(m_requestingDocument); | 217 visitor->trace(m_requestingDocument); |
210 PerformanceEntry::trace(visitor); | 218 PerformanceEntry::trace(visitor); |
211 } | 219 } |
212 | 220 |
213 } // namespace blink | 221 } // namespace blink |
OLD | NEW |