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: Source/core/workers/WorkerGlobalScope.cpp

Issue 203233004: Oilpan: Fix worker thread termination finalization order issues. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved.
3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved. 3 * Copyright (C) 2009, 2011 Google Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 void WorkerGlobalScope::willStopActiveDOMObjects() 190 void WorkerGlobalScope::willStopActiveDOMObjects()
191 { 191 {
192 lifecycleNotifier().notifyWillStopActiveDOMObjects(); 192 lifecycleNotifier().notifyWillStopActiveDOMObjects();
193 } 193 }
194 194
195 void WorkerGlobalScope::dispose() 195 void WorkerGlobalScope::dispose()
196 { 196 {
197 ASSERT(thread()->isCurrentThread()); 197 ASSERT(thread()->isCurrentThread());
198 198
199 // Notify proxy that we are going away. This can free the WorkerThread objec t, so do not access it after this.
200 thread()->workerReportingProxy().workerGlobalScopeDestroyed();
201
202 clearScript(); 199 clearScript();
203 clearInspector(); 200 clearInspector();
204 setClient(0); 201 setClient(0);
205
206 // The thread reference isn't currently cleared, as the execution
207 // context's thread is accessed by GCed lifetime objects when
208 // they're finalized.
haraken 2014/03/18 13:55:45 Shall we keep this comment? It's a non-trivial fac
Mads Ager (chromium) 2014/03/18 14:08:09 Added back a comment explaining that we cannot cle
209 // FIXME: oilpan: avoid by explicitly removing the WorkerGlobalScope
210 // as an observable context right here.
211 } 202 }
212 203
213 void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState & exceptionState) 204 void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState & exceptionState)
214 { 205 {
215 ASSERT(contentSecurityPolicy()); 206 ASSERT(contentSecurityPolicy());
216 Vector<String>::const_iterator urlsEnd = urls.end(); 207 Vector<String>::const_iterator urlsEnd = urls.end();
217 Vector<KURL> completedURLs; 208 Vector<KURL> completedURLs;
218 for (Vector<String>::const_iterator it = urls.begin(); it != urlsEnd; ++it) { 209 for (Vector<String>::const_iterator it = urls.begin(); it != urlsEnd; ++it) {
219 const KURL& url = executionContext()->completeURL(*it); 210 const KURL& url = executionContext()->completeURL(*it);
220 if (!url.isValid()) { 211 if (!url.isValid()) {
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 { 296 {
306 visitor->trace(m_console); 297 visitor->trace(m_console);
307 visitor->trace(m_location); 298 visitor->trace(m_location);
308 visitor->trace(m_navigator); 299 visitor->trace(m_navigator);
309 #if ENABLE(OILPAN) 300 #if ENABLE(OILPAN)
310 HeapSupplementable<WorkerGlobalScope>::trace(visitor); 301 HeapSupplementable<WorkerGlobalScope>::trace(visitor);
311 #endif 302 #endif
312 } 303 }
313 304
314 } // namespace WebCore 305 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/workers/WorkerThread.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698