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

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

Issue 2655123002: Revert of Added DCHECK for monotonicTimeToDOMHighResTimeStamp in PerformanceBase (Closed)
Patch Set: sync Created 3 years, 10 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/PerformanceBase.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 * 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 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 } 573 }
574 574
575 DOMHighResTimeStamp PerformanceBase::monotonicTimeToDOMHighResTimeStamp( 575 DOMHighResTimeStamp PerformanceBase::monotonicTimeToDOMHighResTimeStamp(
576 double timeOrigin, 576 double timeOrigin,
577 double monotonicTime) { 577 double monotonicTime) {
578 // Avoid exposing raw platform timestamps. 578 // Avoid exposing raw platform timestamps.
579 if (!monotonicTime || !timeOrigin) 579 if (!monotonicTime || !timeOrigin)
580 return 0.0; 580 return 0.0;
581 581
582 double timeInSeconds = monotonicTime - timeOrigin; 582 double timeInSeconds = monotonicTime - timeOrigin;
583 DCHECK_GE(timeInSeconds, 0); 583 if (timeInSeconds < 0)
584 return 0.0;
584 return convertSecondsToDOMHighResTimeStamp( 585 return convertSecondsToDOMHighResTimeStamp(
585 clampTimeResolution(timeInSeconds)); 586 clampTimeResolution(timeInSeconds));
586 } 587 }
587 588
588 DOMHighResTimeStamp PerformanceBase::monotonicTimeToDOMHighResTimeStamp( 589 DOMHighResTimeStamp PerformanceBase::monotonicTimeToDOMHighResTimeStamp(
589 double monotonicTime) const { 590 double monotonicTime) const {
590 return monotonicTimeToDOMHighResTimeStamp(m_timeOrigin, monotonicTime); 591 return monotonicTimeToDOMHighResTimeStamp(m_timeOrigin, monotonicTime);
591 } 592 }
592 593
593 DOMHighResTimeStamp PerformanceBase::now() const { 594 DOMHighResTimeStamp PerformanceBase::now() const {
594 return monotonicTimeToDOMHighResTimeStamp(monotonicallyIncreasingTime()); 595 return monotonicTimeToDOMHighResTimeStamp(monotonicallyIncreasingTime());
595 } 596 }
596 597
597 DEFINE_TRACE(PerformanceBase) { 598 DEFINE_TRACE(PerformanceBase) {
598 visitor->trace(m_frameTimingBuffer); 599 visitor->trace(m_frameTimingBuffer);
599 visitor->trace(m_resourceTimingBuffer); 600 visitor->trace(m_resourceTimingBuffer);
600 visitor->trace(m_navigationTiming); 601 visitor->trace(m_navigationTiming);
601 visitor->trace(m_userTiming); 602 visitor->trace(m_userTiming);
602 visitor->trace(m_observers); 603 visitor->trace(m_observers);
603 visitor->trace(m_activeObservers); 604 visitor->trace(m_activeObservers);
604 visitor->trace(m_suspendedObservers); 605 visitor->trace(m_suspendedObservers);
605 EventTargetWithInlineData::trace(visitor); 606 EventTargetWithInlineData::trace(visitor);
606 } 607 }
607 608
608 } // namespace blink 609 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/timing/PerformanceBase.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698