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

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: incoroporated dominicc's comment 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
« no previous file with comments | « Source/core/workers/WorkerGlobalScope.h ('k') | Source/modules/modules.gypi » ('j') | 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) 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 class WorkerThreadShutdownStartTask : public ExecutionContextTask { 197 class WorkerThreadShutdownStartTask : public ExecutionContextTask {
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 workerGlobalScope->stopFetch();
208 workerGlobalScope->stopActiveDOMObjects(); 208 workerGlobalScope->stopActiveDOMObjects();
209 209
210 // Event listeners would keep DOMWrapperWorld objects alive for too long . Also, they have references to JS objects, 210 // 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. 211 // which become dangling once Heap is destroyed.
212 workerGlobalScope->removeAllEventListeners(); 212 workerGlobalScope->removeAllEventListeners();
213 213
214 // Stick a shutdown command at the end of the queue, so that we deal 214 // Stick a shutdown command at the end of the queue, so that we deal
215 // with all the cleanup tasks the databases post first. 215 // with all the cleanup tasks the databases post first.
216 workerGlobalScope->postTask(WorkerThreadShutdownFinishTask::create()); 216 workerGlobalScope->postTask(WorkerThreadShutdownFinishTask::create());
217 } 217 }
(...skipping 22 matching lines...) Expand all
240 } 240 }
241 m_runLoop.terminate(); 241 m_runLoop.terminate();
242 } 242 }
243 243
244 bool WorkerThread::isCurrentThread() const 244 bool WorkerThread::isCurrentThread() const
245 { 245 {
246 return m_threadID == currentThread(); 246 return m_threadID == currentThread();
247 } 247 }
248 248
249 } // namespace WebCore 249 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/workers/WorkerGlobalScope.h ('k') | Source/modules/modules.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698