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

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

Issue 2734783002: Fix oninstall-script tests for service worker (Closed)
Patch Set: address comment Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.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/ServiceWorkerGlobalScope.cpp
diff --git a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
index 0a0aa43c48b88ee220b1285b9d1c004563c5d336..d9ad4a79b899f3c08347e85bd29cd70c34a6739a 100644
--- a/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
+++ b/third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp
@@ -104,8 +104,6 @@ ServiceWorkerGlobalScope::ServiceWorkerGlobalScope(
std::move(starterOriginPrivilegeData),
workerClients),
m_didEvaluateScript(false),
- m_hadErrorInTopLevelEventHandler(false),
- m_eventNestingLevel(0),
m_scriptCount(0),
m_scriptTotalSize(0),
m_scriptCachedMetadataTotalSize(0) {}
@@ -200,33 +198,15 @@ const AtomicString& ServiceWorkerGlobalScope::interfaceName() const {
return EventTargetNames::ServiceWorkerGlobalScope;
}
-DispatchEventResult ServiceWorkerGlobalScope::dispatchEventInternal(
- Event* event) {
- m_eventNestingLevel++;
- DispatchEventResult dispatchResult =
- WorkerGlobalScope::dispatchEventInternal(event);
- if (event->interfaceName() == EventNames::ErrorEvent &&
- m_eventNestingLevel == 2)
- m_hadErrorInTopLevelEventHandler = true;
- m_eventNestingLevel--;
- return dispatchResult;
-}
-
void ServiceWorkerGlobalScope::dispatchExtendableEvent(
Event* event,
WaitUntilObserver* observer) {
- ASSERT(m_eventNestingLevel == 0);
- m_hadErrorInTopLevelEventHandler = false;
-
observer->willDispatchEvent();
dispatchEvent(event);
// Check if the worker thread is forcibly terminated during the event
// because of timeout etc.
- if (thread()->isForciblyTerminated())
- m_hadErrorInTopLevelEventHandler = true;
-
- observer->didDispatchEvent(m_hadErrorInTopLevelEventHandler);
+ observer->didDispatchEvent(thread()->isForciblyTerminated());
}
DEFINE_TRACE(ServiceWorkerGlobalScope) {
« no previous file with comments | « third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698