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 24 matching lines...) Expand all Loading... |
35 #include "core/dom/DocumentTiming.h" | 35 #include "core/dom/DocumentTiming.h" |
36 #include "core/frame/Frame.h" | 36 #include "core/frame/Frame.h" |
37 #include "core/loader/DocumentLoadTiming.h" | 37 #include "core/loader/DocumentLoadTiming.h" |
38 #include "core/loader/DocumentLoader.h" | 38 #include "core/loader/DocumentLoader.h" |
39 #include "core/loader/FrameLoader.h" | 39 #include "core/loader/FrameLoader.h" |
40 #include "platform/network/ResourceLoadTiming.h" | 40 #include "platform/network/ResourceLoadTiming.h" |
41 #include "platform/network/ResourceResponse.h" | 41 #include "platform/network/ResourceResponse.h" |
42 | 42 |
43 namespace WebCore { | 43 namespace WebCore { |
44 | 44 |
45 DEFINE_GC_INFO(PerformanceTiming); | |
46 | |
47 static unsigned long long toIntegerMilliseconds(double seconds) | 45 static unsigned long long toIntegerMilliseconds(double seconds) |
48 { | 46 { |
49 ASSERT(seconds >= 0); | 47 ASSERT(seconds >= 0); |
50 return static_cast<unsigned long long>(seconds * 1000.0); | 48 return static_cast<unsigned long long>(seconds * 1000.0); |
51 } | 49 } |
52 | 50 |
53 PerformanceTiming::PerformanceTiming(Frame* frame) | 51 PerformanceTiming::PerformanceTiming(Frame* frame) |
54 : DOMWindowProperty(frame) | 52 : DOMWindowProperty(frame) |
55 { | 53 { |
56 ScriptWrappable::init(this); | 54 ScriptWrappable::init(this); |
(...skipping 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 { | 349 { |
352 ASSERT(monotonicSeconds >= 0); | 350 ASSERT(monotonicSeconds >= 0); |
353 const DocumentLoadTiming* timing = documentLoadTiming(); | 351 const DocumentLoadTiming* timing = documentLoadTiming(); |
354 if (!timing) | 352 if (!timing) |
355 return 0; | 353 return 0; |
356 | 354 |
357 return toIntegerMilliseconds(timing->monotonicTimeToPseudoWallTime(monotonic
Seconds)); | 355 return toIntegerMilliseconds(timing->monotonicTimeToPseudoWallTime(monotonic
Seconds)); |
358 } | 356 } |
359 | 357 |
360 } // namespace WebCore | 358 } // namespace WebCore |
OLD | NEW |