Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 m_workerReportingProxy.workerGlobalScopeStarted(m_workerGlobalScope.get()); | 130 m_workerReportingProxy.workerGlobalScopeStarted(m_workerGlobalScope.get()); |
| 131 | 131 |
| 132 WorkerScriptController* script = m_workerGlobalScope->script(); | 132 WorkerScriptController* script = m_workerGlobalScope->script(); |
| 133 InspectorInstrumentation::willEvaluateWorkerScript(workerGlobalScope(), star tMode); | 133 InspectorInstrumentation::willEvaluateWorkerScript(workerGlobalScope(), star tMode); |
| 134 script->evaluate(ScriptSourceCode(sourceCode, scriptURL)); | 134 script->evaluate(ScriptSourceCode(sourceCode, scriptURL)); |
| 135 | 135 |
| 136 runEventLoop(); | 136 runEventLoop(); |
| 137 | 137 |
| 138 ThreadIdentifier threadID = m_threadID; | 138 ThreadIdentifier threadID = m_threadID; |
| 139 | 139 |
| 140 #if !ENABLE(OILPAN) | |
| 140 ASSERT(m_workerGlobalScope->hasOneRef()); | 141 ASSERT(m_workerGlobalScope->hasOneRef()); |
|
jochen (gone - plz use gerrit)
2014/02/28 08:26:06
note that this ASSERT() does not hold. The ref cou
sof
2014/02/28 08:32:52
I see. Has it proven useful to catch out bugs in t
jochen (gone - plz use gerrit)
2014/02/28 08:35:46
It clearly indicates that there's a bug. Nobody ca
sof
2014/02/28 08:39:25
Is there a bug on it already?
| |
| 142 #endif | |
| 141 | 143 |
| 142 // The below assignment will destroy the context, which will in turn notify messaging proxy. | 144 // The below assignment will destroy the context, which will in turn notify messaging proxy. |
| 143 // We cannot let any objects survive past thread exit, because no other thre ad will run GC or otherwise destroy them. | 145 // We cannot let any objects survive past thread exit, because no other thre ad will run GC or otherwise destroy them. |
| 146 m_workerGlobalScope->detach(); | |
| 144 m_workerGlobalScope = nullptr; | 147 m_workerGlobalScope = nullptr; |
| 145 | 148 |
| 146 // Cleanup thread heap which causes all objects to be finalized. | 149 // Cleanup thread heap which causes all objects to be finalized. |
| 147 // After this call thread heap must be empty. | 150 // After this call thread heap must be empty. |
| 148 ThreadState::current()->cleanup(); | 151 ThreadState::current()->cleanup(); |
| 149 | 152 |
| 150 // Clean up PlatformThreadData before WTF::WTFThreadData goes away! | 153 // Clean up PlatformThreadData before WTF::WTFThreadData goes away! |
| 151 PlatformThreadData::current().destroy(); | 154 PlatformThreadData::current().destroy(); |
| 152 | 155 |
| 153 // The thread object may be already destroyed from notification now, don't t ry to access "this". | 156 // The thread object may be already destroyed from notification now, don't t ry to access "this". |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 void WorkerThread::releaseFastMallocFreeMemoryInAllThreads() | 251 void WorkerThread::releaseFastMallocFreeMemoryInAllThreads() |
| 249 { | 252 { |
| 250 MutexLocker lock(threadSetMutex()); | 253 MutexLocker lock(threadSetMutex()); |
| 251 HashSet<WorkerThread*>& threads = workerThreads(); | 254 HashSet<WorkerThread*>& threads = workerThreads(); |
| 252 HashSet<WorkerThread*>::iterator end = threads.end(); | 255 HashSet<WorkerThread*>::iterator end = threads.end(); |
| 253 for (HashSet<WorkerThread*>::iterator it = threads.begin(); it != end; ++it) | 256 for (HashSet<WorkerThread*>::iterator it = threads.begin(); it != end; ++it) |
| 254 (*it)->runLoop().postTask(adoptPtr(new ReleaseFastMallocFreeMemoryTask)) ; | 257 (*it)->runLoop().postTask(adoptPtr(new ReleaseFastMallocFreeMemoryTask)) ; |
| 255 } | 258 } |
| 256 | 259 |
| 257 } // namespace WebCore | 260 } // namespace WebCore |
| OLD | NEW |