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

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

Issue 2734783002: Fix oninstall-script tests for service worker (Closed)
Patch Set: delete tests 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..cae0191b1683932609186bf282ce9752668489de 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) {}
@@ -202,31 +200,18 @@ const AtomicString& ServiceWorkerGlobalScope::interfaceName() const {
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;
+ return WorkerGlobalScope::dispatchEventInternal(event);
falken 2017/03/21 04:27:37 Since it's now just calling the superclass's funct
yiyix 2017/03/21 05:44:27 Good call. Removed.
}
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());
falken 2017/03/21 04:27:37 Note for future reference: we could probably revis
yiyix 2017/03/21 05:44:27 Would it be preferable to add a TODO?
falken 2017/03/21 05:52:15 Hm, I think it's OK without it. The code will prob
}
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