| 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 13 matching lines...) Expand all Loading... |
| 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 */ | 30 */ |
| 31 | 31 |
| 32 #include "core/timing/PerformanceResourceTiming.h" | 32 #include "core/timing/PerformanceResourceTiming.h" |
| 33 | 33 |
| 34 #include "bindings/core/v8/V8ObjectBuilder.h" |
| 34 #include "core/timing/PerformanceBase.h" | 35 #include "core/timing/PerformanceBase.h" |
| 35 #include "platform/network/ResourceRequest.h" | 36 #include "platform/network/ResourceRequest.h" |
| 36 #include "platform/network/ResourceResponse.h" | 37 #include "platform/network/ResourceResponse.h" |
| 37 #include "platform/network/ResourceTimingInfo.h" | 38 #include "platform/network/ResourceTimingInfo.h" |
| 38 | 39 |
| 39 namespace blink { | 40 namespace blink { |
| 40 | 41 |
| 41 // TODO(majidvp): Should return DOMHighResTimeStamp type instead | 42 // TODO(majidvp): Should return DOMHighResTimeStamp type instead |
| 42 static double monotonicTimeToDOMHighResTimeStamp(double timeOrigin, double secon
ds) | 43 static double monotonicTimeToDOMHighResTimeStamp(double timeOrigin, double secon
ds) |
| 43 { | 44 { |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 } | 206 } |
| 206 | 207 |
| 207 double PerformanceResourceTiming::responseEnd() const | 208 double PerformanceResourceTiming::responseEnd() const |
| 208 { | 209 { |
| 209 if (!m_finishTime) | 210 if (!m_finishTime) |
| 210 return responseStart(); | 211 return responseStart(); |
| 211 | 212 |
| 212 return monotonicTimeToDOMHighResTimeStamp(m_timeOrigin, m_finishTime); | 213 return monotonicTimeToDOMHighResTimeStamp(m_timeOrigin, m_finishTime); |
| 213 } | 214 } |
| 214 | 215 |
| 216 void PerformanceResourceTiming::buildJSONValue(V8ObjectBuilder& builder) const |
| 217 { |
| 218 PerformanceEntry::buildJSONValue(builder); |
| 219 builder.addString("initiatorType", initiatorType()); |
| 220 builder.addNumber("workerStart", workerStart()); |
| 221 builder.addNumber("redirectStart", redirectStart()); |
| 222 builder.addNumber("redirectEnd", redirectEnd()); |
| 223 builder.addNumber("fetchStart", fetchStart()); |
| 224 builder.addNumber("domainLookupStart", domainLookupStart()); |
| 225 builder.addNumber("domainLookupEnd", domainLookupEnd()); |
| 226 builder.addNumber("connectStart", connectStart()); |
| 227 builder.addNumber("connectEnd", connectEnd()); |
| 228 builder.addNumber("secureConnectionStart", secureConnectionStart()); |
| 229 builder.addNumber("requestStart", requestStart()); |
| 230 builder.addNumber("responseStart", responseStart()); |
| 231 builder.addNumber("responseEnd", responseEnd()); |
| 232 } |
| 233 |
| 215 } // namespace blink | 234 } // namespace blink |
| OLD | NEW |