Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(704)

Side by Side Diff: third_party/WebKit/Source/core/timing/PerformanceTiming.cpp

Issue 2592953004: Replace DOMWindowProperty in core/timing/ with ContextClient (Closed)
Patch Set: Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/timing/PerformanceTiming.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 ASSERT(seconds >= 0); 52 ASSERT(seconds >= 0);
53 double clampedSeconds = PerformanceBase::clampTimeResolution(seconds); 53 double clampedSeconds = PerformanceBase::clampTimeResolution(seconds);
54 return static_cast<unsigned long long>(clampedSeconds * 1000.0); 54 return static_cast<unsigned long long>(clampedSeconds * 1000.0);
55 } 55 }
56 56
57 static double toDoubleSeconds(unsigned long long integerMilliseconds) { 57 static double toDoubleSeconds(unsigned long long integerMilliseconds) {
58 return integerMilliseconds / 1000.0; 58 return integerMilliseconds / 1000.0;
59 } 59 }
60 60
61 PerformanceTiming::PerformanceTiming(LocalFrame* frame) 61 PerformanceTiming::PerformanceTiming(LocalFrame* frame)
62 : DOMWindowProperty(frame) {} 62 : ContextClient(frame) {}
63 63
64 unsigned long long PerformanceTiming::navigationStart() const { 64 unsigned long long PerformanceTiming::navigationStart() const {
65 DocumentLoadTiming* timing = documentLoadTiming(); 65 DocumentLoadTiming* timing = documentLoadTiming();
66 if (!timing) 66 if (!timing)
67 return 0; 67 return 0;
68 68
69 return monotonicTimeToIntegerMilliseconds(timing->navigationStart()); 69 return monotonicTimeToIntegerMilliseconds(timing->navigationStart());
70 } 70 }
71 71
72 unsigned long long PerformanceTiming::unloadEventStart() const { 72 unsigned long long PerformanceTiming::unloadEventStart() const {
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 unsigned long long integerMilliseconds) const { 531 unsigned long long integerMilliseconds) const {
532 const DocumentLoadTiming* timing = documentLoadTiming(); 532 const DocumentLoadTiming* timing = documentLoadTiming();
533 if (!timing) 533 if (!timing)
534 return 0; 534 return 0;
535 535
536 return timing->pseudoWallTimeToMonotonicTime( 536 return timing->pseudoWallTimeToMonotonicTime(
537 toDoubleSeconds(integerMilliseconds)); 537 toDoubleSeconds(integerMilliseconds));
538 } 538 }
539 539
540 DEFINE_TRACE(PerformanceTiming) { 540 DEFINE_TRACE(PerformanceTiming) {
541 DOMWindowProperty::trace(visitor); 541 ContextClient::trace(visitor);
542 } 542 }
543 543
544 } // namespace blink 544 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/timing/PerformanceTiming.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698