| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 static unsigned long long toIntegerMilliseconds(double seconds) | 45 static unsigned long long toIntegerMilliseconds(double seconds) |
| 46 { | 46 { |
| 47 ASSERT(seconds >= 0); | 47 ASSERT(seconds >= 0); |
| 48 return static_cast<unsigned long long>(seconds * 1000.0); | 48 return static_cast<unsigned long long>(seconds * 1000.0); |
| 49 } | 49 } |
| 50 | 50 |
| 51 PerformanceTiming::PerformanceTiming(LocalFrame* frame) | 51 PerformanceTiming::PerformanceTiming(LocalFrame* frame) |
| 52 : DOMWindowProperty(frame) | 52 : DOMWindowProperty(frame) |
| 53 { | 53 { |
| 54 ScriptWrappable::init(this); | |
| 55 } | 54 } |
| 56 | 55 |
| 57 unsigned long long PerformanceTiming::navigationStart() const | 56 unsigned long long PerformanceTiming::navigationStart() const |
| 58 { | 57 { |
| 59 DocumentLoadTiming* timing = documentLoadTiming(); | 58 DocumentLoadTiming* timing = documentLoadTiming(); |
| 60 if (!timing) | 59 if (!timing) |
| 61 return 0; | 60 return 0; |
| 62 | 61 |
| 63 return monotonicTimeToIntegerMilliseconds(timing->navigationStart()); | 62 return monotonicTimeToIntegerMilliseconds(timing->navigationStart()); |
| 64 } | 63 } |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 349 { | 348 { |
| 350 ASSERT(monotonicSeconds >= 0); | 349 ASSERT(monotonicSeconds >= 0); |
| 351 const DocumentLoadTiming* timing = documentLoadTiming(); | 350 const DocumentLoadTiming* timing = documentLoadTiming(); |
| 352 if (!timing) | 351 if (!timing) |
| 353 return 0; | 352 return 0; |
| 354 | 353 |
| 355 return toIntegerMilliseconds(timing->monotonicTimeToPseudoWallTime(monotonic
Seconds)); | 354 return toIntegerMilliseconds(timing->monotonicTimeToPseudoWallTime(monotonic
Seconds)); |
| 356 } | 355 } |
| 357 | 356 |
| 358 } // namespace blink | 357 } // namespace blink |
| OLD | NEW |