Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 return nullptr; | 59 return nullptr; |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace | 62 } // namespace |
| 63 | 63 |
| 64 using PerformanceObserverVector = HeapVector<Member<PerformanceObserver>>; | 64 using PerformanceObserverVector = HeapVector<Member<PerformanceObserver>>; |
| 65 | 65 |
| 66 static const size_t defaultResourceTimingBufferSize = 150; | 66 static const size_t defaultResourceTimingBufferSize = 150; |
| 67 static const size_t defaultFrameTimingBufferSize = 150; | 67 static const size_t defaultFrameTimingBufferSize = 150; |
| 68 | 68 |
| 69 PerformanceBase::PerformanceBase(double timeOrigin) | 69 PerformanceBase::PerformanceBase(double timeOrigin, |
| 70 RefPtr<WebTaskRunner> taskRunner) | |
| 70 : m_frameTimingBufferSize(defaultFrameTimingBufferSize), | 71 : m_frameTimingBufferSize(defaultFrameTimingBufferSize), |
| 71 m_resourceTimingBufferSize(defaultResourceTimingBufferSize), | 72 m_resourceTimingBufferSize(defaultResourceTimingBufferSize), |
| 72 m_userTiming(nullptr), | 73 m_userTiming(nullptr), |
| 73 m_timeOrigin(timeOrigin), | 74 m_timeOrigin(timeOrigin), |
| 74 m_observerFilterOptions(PerformanceEntry::Invalid), | 75 m_observerFilterOptions(PerformanceEntry::Invalid), |
| 75 m_deliverObservationsTimer( | 76 m_deliverObservationsTimer( |
| 77 std::move(taskRunner), | |
|
haraken
2017/01/20 02:21:51
What is making it hard to unconditionally use Task
jbroman
2017/01/20 02:27:04
PerformanceBase doesn't have any object to pass to
| |
| 76 this, | 78 this, |
| 77 &PerformanceBase::deliverObservationsTimerFired) {} | 79 &PerformanceBase::deliverObservationsTimerFired) {} |
| 78 | 80 |
| 79 PerformanceBase::~PerformanceBase() {} | 81 PerformanceBase::~PerformanceBase() {} |
| 80 | 82 |
| 81 PerformanceNavigationTiming::NavigationType PerformanceBase::getNavigationType( | 83 PerformanceNavigationTiming::NavigationType PerformanceBase::getNavigationType( |
| 82 NavigationType type, | 84 NavigationType type, |
| 83 const Document* document) { | 85 const Document* document) { |
| 84 if (document && | 86 if (document && |
| 85 document->pageVisibilityState() == PageVisibilityStatePrerender) { | 87 document->pageVisibilityState() == PageVisibilityStatePrerender) { |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 597 visitor->trace(m_resourceTimingBuffer); | 599 visitor->trace(m_resourceTimingBuffer); |
| 598 visitor->trace(m_navigationTiming); | 600 visitor->trace(m_navigationTiming); |
| 599 visitor->trace(m_userTiming); | 601 visitor->trace(m_userTiming); |
| 600 visitor->trace(m_observers); | 602 visitor->trace(m_observers); |
| 601 visitor->trace(m_activeObservers); | 603 visitor->trace(m_activeObservers); |
| 602 visitor->trace(m_suspendedObservers); | 604 visitor->trace(m_suspendedObservers); |
| 603 EventTargetWithInlineData::trace(visitor); | 605 EventTargetWithInlineData::trace(visitor); |
| 604 } | 606 } |
| 605 | 607 |
| 606 } // namespace blink | 608 } // namespace blink |
| OLD | NEW |