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

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

Issue 1945953002: Fix an edge case where early disconnect() can omit delivering of observation. crbug/607324 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add missing CORE_EXPORT to PerformanceObserver class Created 4 years, 7 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/PerformanceObserver.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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/timing/PerformanceObserver.h" 5 #include "core/timing/PerformanceObserver.h"
6 6
7 #include "bindings/core/v8/ExceptionState.h" 7 #include "bindings/core/v8/ExceptionState.h"
8 #include "core/dom/ExecutionContext.h" 8 #include "core/dom/ExecutionContext.h"
9 #include "core/timing/PerformanceBase.h" 9 #include "core/timing/PerformanceBase.h"
10 #include "core/timing/PerformanceEntry.h" 10 #include "core/timing/PerformanceEntry.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 m_filterOptions = entryTypes; 50 m_filterOptions = entryTypes;
51 if (m_isRegistered) 51 if (m_isRegistered)
52 m_performance->updatePerformanceObserverFilterOptions(); 52 m_performance->updatePerformanceObserverFilterOptions();
53 else 53 else
54 m_performance->registerPerformanceObserver(*this); 54 m_performance->registerPerformanceObserver(*this);
55 m_isRegistered = true; 55 m_isRegistered = true;
56 } 56 }
57 57
58 void PerformanceObserver::disconnect() 58 void PerformanceObserver::disconnect()
59 { 59 {
60 m_performanceEntries.clear();
61 if (m_performance) 60 if (m_performance)
62 m_performance->unregisterPerformanceObserver(*this); 61 m_performance->unregisterPerformanceObserver(*this);
62
63 m_performanceEntries.clear();
63 m_isRegistered = false; 64 m_isRegistered = false;
64 } 65 }
65 66
66 void PerformanceObserver::enqueuePerformanceEntry(PerformanceEntry& entry) 67 void PerformanceObserver::enqueuePerformanceEntry(PerformanceEntry& entry)
67 { 68 {
68 ASSERT(isMainThread()); 69 ASSERT(isMainThread());
69 m_performanceEntries.append(&entry); 70 m_performanceEntries.append(&entry);
70 if (m_performance) 71 if (m_performance)
71 m_performance->activateObserver(*this); 72 m_performance->activateObserver(*this);
72 } 73 }
(...skipping 18 matching lines...) Expand all
91 } 92 }
92 93
93 DEFINE_TRACE(PerformanceObserver) 94 DEFINE_TRACE(PerformanceObserver)
94 { 95 {
95 visitor->trace(m_callback); 96 visitor->trace(m_callback);
96 visitor->trace(m_performance); 97 visitor->trace(m_performance);
97 visitor->trace(m_performanceEntries); 98 visitor->trace(m_performanceEntries);
98 } 99 }
99 100
100 } // namespace blink 101 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/timing/PerformanceObserver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698