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

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

Issue 178663004: Oilpan: move WorkerGlobalScope to oilpan's heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: clang compile fix Created 6 years, 10 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/WorkerSupplementable.h ('k') | Source/heap/Handle.h » ('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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 ASSERT(m_workerGlobalScope->hasOneRef()); 140 ASSERT(m_workerGlobalScope->hasOneRef());
141 141
142 // The below assignment will destroy the context, which will in turn notify messaging proxy. 142 // 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. 143 // We cannot let any objects survive past thread exit, because no other thre ad will run GC or otherwise destroy them.
144 m_workerGlobalScope->detach();
144 m_workerGlobalScope = nullptr; 145 m_workerGlobalScope = nullptr;
haraken 2014/02/26 02:39:34 Shall we change m_workerGlobalScope to RefPtrWillB
sof 2014/02/26 06:29:42 Makes sense to do that (but I didn't want to incre
145 146
146 // Cleanup thread heap which causes all objects to be finalized. 147 // Cleanup thread heap which causes all objects to be finalized.
147 // After this call thread heap must be empty. 148 // After this call thread heap must be empty.
148 ThreadState::current()->cleanup(); 149 ThreadState::current()->cleanup();
149 150
150 // Clean up PlatformThreadData before WTF::WTFThreadData goes away! 151 // Clean up PlatformThreadData before WTF::WTFThreadData goes away!
151 PlatformThreadData::current().destroy(); 152 PlatformThreadData::current().destroy();
152 153
153 // The thread object may be already destroyed from notification now, don't t ry to access "this". 154 // The thread object may be already destroyed from notification now, don't t ry to access "this".
154 detachThread(threadID); 155 detachThread(threadID);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 void WorkerThread::releaseFastMallocFreeMemoryInAllThreads() 249 void WorkerThread::releaseFastMallocFreeMemoryInAllThreads()
249 { 250 {
250 MutexLocker lock(threadSetMutex()); 251 MutexLocker lock(threadSetMutex());
251 HashSet<WorkerThread*>& threads = workerThreads(); 252 HashSet<WorkerThread*>& threads = workerThreads();
252 HashSet<WorkerThread*>::iterator end = threads.end(); 253 HashSet<WorkerThread*>::iterator end = threads.end();
253 for (HashSet<WorkerThread*>::iterator it = threads.begin(); it != end; ++it) 254 for (HashSet<WorkerThread*>::iterator it = threads.begin(); it != end; ++it)
254 (*it)->runLoop().postTask(adoptPtr(new ReleaseFastMallocFreeMemoryTask)) ; 255 (*it)->runLoop().postTask(adoptPtr(new ReleaseFastMallocFreeMemoryTask)) ;
255 } 256 }
256 257
257 } // namespace WebCore 258 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/workers/WorkerSupplementable.h ('k') | Source/heap/Handle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698