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

Side by Side Diff: Source/core/workers/WorkerThread.cpp

Issue 318393002: Initial implementation of ServiceWorkerGlobalScope.fetch() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add test for destroying the execution context while fetch is happening. Created 6 years, 6 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 public: 198 public:
199 static PassOwnPtr<WorkerThreadShutdownStartTask> create() 199 static PassOwnPtr<WorkerThreadShutdownStartTask> create()
200 { 200 {
201 return adoptPtr(new WorkerThreadShutdownStartTask()); 201 return adoptPtr(new WorkerThreadShutdownStartTask());
202 } 202 }
203 203
204 virtual void performTask(ExecutionContext *context) 204 virtual void performTask(ExecutionContext *context)
205 { 205 {
206 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context); 206 WorkerGlobalScope* workerGlobalScope = toWorkerGlobalScope(context);
207 207
208 workerGlobalScope->stopFetch();
209
dominicc (has gone to gerrit) 2014/06/16 06:07:50 Let's tighten up the whitespace here by deleting 2
horo 2014/06/16 06:32:18 Done.
208 workerGlobalScope->stopActiveDOMObjects(); 210 workerGlobalScope->stopActiveDOMObjects();
209 211
210 // Event listeners would keep DOMWrapperWorld objects alive for too long . Also, they have references to JS objects, 212 // Event listeners would keep DOMWrapperWorld objects alive for too long . Also, they have references to JS objects,
211 // which become dangling once Heap is destroyed. 213 // which become dangling once Heap is destroyed.
212 workerGlobalScope->removeAllEventListeners(); 214 workerGlobalScope->removeAllEventListeners();
213 215
214 // Stick a shutdown command at the end of the queue, so that we deal 216 // Stick a shutdown command at the end of the queue, so that we deal
215 // with all the cleanup tasks the databases post first. 217 // with all the cleanup tasks the databases post first.
216 workerGlobalScope->postTask(WorkerThreadShutdownFinishTask::create()); 218 workerGlobalScope->postTask(WorkerThreadShutdownFinishTask::create());
217 } 219 }
(...skipping 22 matching lines...) Expand all
240 } 242 }
241 m_runLoop.terminate(); 243 m_runLoop.terminate();
242 } 244 }
243 245
244 bool WorkerThread::isCurrentThread() const 246 bool WorkerThread::isCurrentThread() const
245 { 247 {
246 return m_threadID == currentThread(); 248 return m_threadID == currentThread();
247 } 249 }
248 250
249 } // namespace WebCore 251 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698