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

Unified Diff: third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp

Issue 2558773002: Remove ContextLifecycleObserver from WaitUntilObserver (Closed)
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp b/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp
index 332362a0a27e8707d6da49528a2306e6e063a32f..e4839a1731bb49b70e45b0f1455abd4b360ef70e 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.cpp
@@ -91,7 +91,7 @@ void WaitUntilObserver::willDispatchEvent() {
// waitUntil() isn't called, that means between willDispatchEvent() and
// didDispatchEvent().
if (m_type == NotificationClick)
- getExecutionContext()->allowWindowInteraction();
+ m_executionContext->allowWindowInteraction();
incrementPendingActivity();
}
@@ -112,7 +112,7 @@ void WaitUntilObserver::waitUntil(ScriptState* scriptState,
return;
}
- if (!getExecutionContext())
+ if (!m_executionContext)
return;
// When handling a notificationclick event, we want to allow one window to
@@ -133,7 +133,7 @@ void WaitUntilObserver::waitUntil(ScriptState* scriptState,
WaitUntilObserver::WaitUntilObserver(ExecutionContext* context,
EventType type,
int eventID)
- : ContextLifecycleObserver(context),
+ : m_executionContext(context),
m_type(type),
m_eventID(eventID),
m_consumeWindowInteractionTimer(
@@ -153,11 +153,11 @@ void WaitUntilObserver::incrementPendingActivity() {
void WaitUntilObserver::decrementPendingActivity() {
ASSERT(m_pendingActivity > 0);
- if (!getExecutionContext() || (!m_hasError && --m_pendingActivity))
+ if (!m_executionContext || (!m_hasError && --m_pendingActivity))
return;
ServiceWorkerGlobalScopeClient* client =
- ServiceWorkerGlobalScopeClient::from(getExecutionContext());
+ ServiceWorkerGlobalScopeClient::from(m_executionContext);
WebServiceWorkerEventResult result =
m_hasError ? WebServiceWorkerEventResultRejected
: WebServiceWorkerEventResultCompleted;
@@ -196,17 +196,17 @@ void WaitUntilObserver::decrementPendingActivity() {
m_eventDispatchTime);
break;
}
- setContext(nullptr);
+ m_executionContext = nullptr;
}
void WaitUntilObserver::consumeWindowInteraction(TimerBase*) {
- if (!getExecutionContext())
+ if (!m_executionContext)
return;
- getExecutionContext()->consumeWindowInteraction();
+ m_executionContext->consumeWindowInteraction();
}
DEFINE_TRACE(WaitUntilObserver) {
- ContextLifecycleObserver::trace(visitor);
+ visitor->trace(m_executionContext);
}
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/modules/serviceworkers/WaitUntilObserver.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698