OLD | NEW |
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...) Loading... |
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 | 202 |
206 // The thread reference isn't currently cleared, as the execution | 203 // We do not clear the thread field of the |
207 // context's thread is accessed by GCed lifetime objects when | 204 // WorkerGlobalScope. Other objects keep the worker global scope |
208 // they're finalized. | 205 // alive because they need its thread field to check that work is |
209 // FIXME: oilpan: avoid by explicitly removing the WorkerGlobalScope | 206 // being carried out on the right thread. We therefore cannot clear |
210 // as an observable context right here. | 207 // the thread field before all references to the worker global |
| 208 // scope are gone. |
211 } | 209 } |
212 | 210 |
213 void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState
& exceptionState) | 211 void WorkerGlobalScope::importScripts(const Vector<String>& urls, ExceptionState
& exceptionState) |
214 { | 212 { |
215 ASSERT(contentSecurityPolicy()); | 213 ASSERT(contentSecurityPolicy()); |
216 Vector<String>::const_iterator urlsEnd = urls.end(); | 214 Vector<String>::const_iterator urlsEnd = urls.end(); |
217 Vector<KURL> completedURLs; | 215 Vector<KURL> completedURLs; |
218 for (Vector<String>::const_iterator it = urls.begin(); it != urlsEnd; ++it)
{ | 216 for (Vector<String>::const_iterator it = urls.begin(); it != urlsEnd; ++it)
{ |
219 const KURL& url = executionContext()->completeURL(*it); | 217 const KURL& url = executionContext()->completeURL(*it); |
220 if (!url.isValid()) { | 218 if (!url.isValid()) { |
(...skipping 84 matching lines...) Loading... |
305 { | 303 { |
306 visitor->trace(m_console); | 304 visitor->trace(m_console); |
307 visitor->trace(m_location); | 305 visitor->trace(m_location); |
308 visitor->trace(m_navigator); | 306 visitor->trace(m_navigator); |
309 #if ENABLE(OILPAN) | 307 #if ENABLE(OILPAN) |
310 HeapSupplementable<WorkerGlobalScope>::trace(visitor); | 308 HeapSupplementable<WorkerGlobalScope>::trace(visitor); |
311 #endif | 309 #endif |
312 } | 310 } |
313 | 311 |
314 } // namespace WebCore | 312 } // namespace WebCore |
OLD | NEW |