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

Unified Diff: third_party/WebKit/Source/core/timing/PerformanceObserver.cpp

Issue 2549673004: Remove RefPtr<ScriptState> from PerformanceObserver (Closed)
Patch Set: temp Created 4 years 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/timing/PerformanceObserver.cpp
diff --git a/third_party/WebKit/Source/core/timing/PerformanceObserver.cpp b/third_party/WebKit/Source/core/timing/PerformanceObserver.cpp
index b1c89825040d17b34a1fce9258bb9972aa9bfa08..a0148f020551f4167e7c4e951409a89054d40751 100644
--- a/third_party/WebKit/Source/core/timing/PerformanceObserver.cpp
+++ b/third_party/WebKit/Source/core/timing/PerformanceObserver.cpp
@@ -17,17 +17,17 @@
namespace blink {
PerformanceObserver* PerformanceObserver::create(
- ScriptState* scriptState,
+ ExecutionContext* executionContext,
PerformanceBase* performance,
PerformanceObserverCallback* callback) {
ASSERT(isMainThread());
- return new PerformanceObserver(scriptState, performance, callback);
+ return new PerformanceObserver(executionContext, performance, callback);
}
-PerformanceObserver::PerformanceObserver(ScriptState* scriptState,
+PerformanceObserver::PerformanceObserver(ExecutionContext* executionContext,
PerformanceBase* performance,
PerformanceObserverCallback* callback)
- : m_scriptState(scriptState),
+ : m_executionContext(executionContext),
m_callback(this, callback),
m_performance(performance),
m_filterOptions(PerformanceEntry::Invalid),
@@ -77,8 +77,7 @@ void PerformanceObserver::enqueuePerformanceEntry(PerformanceEntry& entry) {
}
bool PerformanceObserver::shouldBeSuspended() const {
- return m_scriptState->getExecutionContext() &&
- m_scriptState->getExecutionContext()->activeDOMObjectsAreSuspended();
+ return m_executionContext->activeDOMObjectsAreSuspended();
}
void PerformanceObserver::deliver() {
@@ -95,6 +94,7 @@ void PerformanceObserver::deliver() {
}
DEFINE_TRACE(PerformanceObserver) {
+ visitor->trace(m_executionContext);
visitor->trace(m_callback);
visitor->trace(m_performance);
visitor->trace(m_performanceEntries);

Powered by Google App Engine
This is Rietveld 408576698