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

Side by Side Diff: third_party/WebKit/Source/core/loader/ThreadableLoaderTest.cpp

Issue 2299883006: [Worker] Call prepareForShutdown ASAP when terminated forcibly (Closed)
Patch Set: fix Created 4 years, 3 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 | « no previous file | third_party/WebKit/Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/loader/ThreadableLoader.h" 5 #include "core/loader/ThreadableLoader.h"
6 6
7 #include "core/dom/ExecutionContextTask.h" 7 #include "core/dom/ExecutionContextTask.h"
8 #include "core/fetch/MemoryCache.h" 8 #include "core/fetch/MemoryCache.h"
9 #include "core/fetch/ResourceLoaderOptions.h" 9 #include "core/fetch/ResourceLoaderOptions.h"
10 #include "core/loader/DocumentThreadableLoader.h" 10 #include "core/loader/DocumentThreadableLoader.h"
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 249 }
250 250
251 void onServeRequests() override 251 void onServeRequests() override
252 { 252 {
253 testing::runPendingTasks(); 253 testing::runPendingTasks();
254 } 254 }
255 255
256 void onTearDown() override 256 void onTearDown() override
257 { 257 {
258 postTaskToWorkerGlobalScope(BLINK_FROM_HERE, createCrossThreadTask(&Work erThreadableLoaderTestHelper::clearLoader, crossThreadUnretained(this))); 258 postTaskToWorkerGlobalScope(BLINK_FROM_HERE, createCrossThreadTask(&Work erThreadableLoaderTestHelper::clearLoader, crossThreadUnretained(this)));
259 WaitableEvent event;
260 postTaskToWorkerGlobalScope(BLINK_FROM_HERE, createCrossThreadTask(&Wait ableEvent::signal, crossThreadUnretained(&event)));
261 event.wait();
259 m_workerThread->terminateAndWait(); 262 m_workerThread->terminateAndWait();
260 263
261 // Needed to clean up the things on the main thread side and 264 // Needed to clean up the things on the main thread side and
262 // avoid Resource leaks. 265 // avoid Resource leaks.
263 testing::runPendingTasks(); 266 testing::runPendingTasks();
264 267
265 m_workerThread->workerLoaderProxy()->detachProvider(this); 268 m_workerThread->workerLoaderProxy()->detachProvider(this);
266 } 269 }
267 270
268 private: 271 private:
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 // test is not saying that didFailAccessControlCheck should be dispatched 871 // test is not saying that didFailAccessControlCheck should be dispatched
869 // synchronously, but is saying that even when a response is served 872 // synchronously, but is saying that even when a response is served
870 // synchronously it should not lead to a crash. 873 // synchronously it should not lead to a crash.
871 startLoader(KURL(KURL(), "about:blank")); 874 startLoader(KURL(KURL(), "about:blank"));
872 callCheckpoint(2); 875 callCheckpoint(2);
873 } 876 }
874 877
875 } // namespace 878 } // namespace
876 879
877 } // namespace blink 880 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698