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

Side by Side Diff: third_party/WebKit/Source/modules/serviceworkers/ServiceWorkerGlobalScope.cpp

Issue 2268933002: ServiceWorker: Detect forcible worker thread termination in a correct way (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert moving getExitCode() in favor of https://codereview.chromium.org/2274453002/ Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerThread.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 return dispatchResult; 179 return dispatchResult;
180 } 180 }
181 181
182 void ServiceWorkerGlobalScope::dispatchExtendableEvent(Event* event, WaitUntilOb server* observer) 182 void ServiceWorkerGlobalScope::dispatchExtendableEvent(Event* event, WaitUntilOb server* observer)
183 { 183 {
184 ASSERT(m_eventNestingLevel == 0); 184 ASSERT(m_eventNestingLevel == 0);
185 m_hadErrorInTopLevelEventHandler = false; 185 m_hadErrorInTopLevelEventHandler = false;
186 186
187 observer->willDispatchEvent(); 187 observer->willDispatchEvent();
188 dispatchEvent(event); 188 dispatchEvent(event);
189 if (thread()->terminated()) 189
190 // Check if the worker thread is forcibly terminated during the event
191 // because of timeout etc.
192 if (thread()->isForciblyTerminated())
190 m_hadErrorInTopLevelEventHandler = true; 193 m_hadErrorInTopLevelEventHandler = true;
194
191 observer->didDispatchEvent(m_hadErrorInTopLevelEventHandler); 195 observer->didDispatchEvent(m_hadErrorInTopLevelEventHandler);
192 } 196 }
193 197
194 DEFINE_TRACE(ServiceWorkerGlobalScope) 198 DEFINE_TRACE(ServiceWorkerGlobalScope)
195 { 199 {
196 visitor->trace(m_clients); 200 visitor->trace(m_clients);
197 visitor->trace(m_registration); 201 visitor->trace(m_registration);
198 WorkerGlobalScope::trace(visitor); 202 WorkerGlobalScope::trace(visitor);
199 } 203 }
200 204
(...skipping 20 matching lines...) Expand all
221 } 225 }
222 226
223 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta dataSize) 227 void ServiceWorkerGlobalScope::scriptLoaded(size_t scriptSize, size_t cachedMeta dataSize)
224 { 228 {
225 ++m_scriptCount; 229 ++m_scriptCount;
226 m_scriptTotalSize += scriptSize; 230 m_scriptTotalSize += scriptSize;
227 m_scriptCachedMetadataTotalSize += cachedMetadataSize; 231 m_scriptCachedMetadataTotalSize += cachedMetadataSize;
228 } 232 }
229 233
230 } // namespace blink 234 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/workers/WorkerThread.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698