Chromium Code Reviews| 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) { |