| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "core/dom/DocumentTiming.h" | 38 #include "core/dom/DocumentTiming.h" |
| 39 #include "core/frame/LocalFrame.h" | 39 #include "core/frame/LocalFrame.h" |
| 40 #include "core/loader/DocumentLoadTiming.h" | 40 #include "core/loader/DocumentLoadTiming.h" |
| 41 #include "core/loader/DocumentLoader.h" | 41 #include "core/loader/DocumentLoader.h" |
| 42 #include "core/loader/FrameLoader.h" | 42 #include "core/loader/FrameLoader.h" |
| 43 #include "core/paint/PaintTiming.h" | 43 #include "core/paint/PaintTiming.h" |
| 44 #include "core/timing/PerformanceBase.h" | 44 #include "core/timing/PerformanceBase.h" |
| 45 #include "platform/network/ResourceLoadTiming.h" | 45 #include "platform/network/ResourceLoadTiming.h" |
| 46 #include "platform/network/ResourceResponse.h" | 46 #include "platform/network/ResourceResponse.h" |
| 47 | 47 |
| 48 // Legacy support for NT1(https://www.w3.org/TR/navigation-timing/). |
| 48 namespace blink { | 49 namespace blink { |
| 49 | 50 |
| 50 static unsigned long long toIntegerMilliseconds(double seconds) { | 51 static unsigned long long toIntegerMilliseconds(double seconds) { |
| 51 ASSERT(seconds >= 0); | 52 ASSERT(seconds >= 0); |
| 52 double clampedSeconds = PerformanceBase::clampTimeResolution(seconds); | 53 double clampedSeconds = PerformanceBase::clampTimeResolution(seconds); |
| 53 return static_cast<unsigned long long>(clampedSeconds * 1000.0); | 54 return static_cast<unsigned long long>(clampedSeconds * 1000.0); |
| 54 } | 55 } |
| 55 | 56 |
| 56 static double toDoubleSeconds(unsigned long long integerMilliseconds) { | 57 static double toDoubleSeconds(unsigned long long integerMilliseconds) { |
| 57 return integerMilliseconds / 1000.0; | 58 return integerMilliseconds / 1000.0; |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 | 527 |
| 527 return timing->pseudoWallTimeToMonotonicTime( | 528 return timing->pseudoWallTimeToMonotonicTime( |
| 528 toDoubleSeconds(integerMilliseconds)); | 529 toDoubleSeconds(integerMilliseconds)); |
| 529 } | 530 } |
| 530 | 531 |
| 531 DEFINE_TRACE(PerformanceTiming) { | 532 DEFINE_TRACE(PerformanceTiming) { |
| 532 DOMWindowProperty::trace(visitor); | 533 DOMWindowProperty::trace(visitor); |
| 533 } | 534 } |
| 534 | 535 |
| 535 } // namespace blink | 536 } // namespace blink |
| OLD | NEW |