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

Side by Side Diff: Source/web/WebKit.cpp

Issue 716723003: Script streaming: Shutdown streaming before V8. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 1 month 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/Init.cpp ('k') | no next file » | 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #include "config.h" 31 #include "config.h"
32 #include "public/web/WebKit.h" 32 #include "public/web/WebKit.h"
33 33
34 #include "bindings/core/v8/ScriptStreamerThread.h"
34 #include "bindings/core/v8/V8Binding.h" 35 #include "bindings/core/v8/V8Binding.h"
35 #include "bindings/core/v8/V8GCController.h" 36 #include "bindings/core/v8/V8GCController.h"
36 #include "bindings/core/v8/V8Initializer.h" 37 #include "bindings/core/v8/V8Initializer.h"
37 #include "core/Init.h" 38 #include "core/Init.h"
38 #include "core/animation/AnimationClock.h" 39 #include "core/animation/AnimationClock.h"
39 #include "core/dom/Microtask.h" 40 #include "core/dom/Microtask.h"
40 #include "core/frame/Settings.h" 41 #include "core/frame/Settings.h"
41 #include "core/page/Page.h" 42 #include "core/page/Page.h"
42 #include "core/workers/WorkerGlobalScopeProxy.h" 43 #include "core/workers/WorkerGlobalScopeProxy.h"
43 #include "gin/public/v8_platform.h" 44 #include "gin/public/v8_platform.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 ASSERT(s_pendingGCRunner); 198 ASSERT(s_pendingGCRunner);
198 delete s_pendingGCRunner; 199 delete s_pendingGCRunner;
199 s_pendingGCRunner = 0; 200 s_pendingGCRunner = 0;
200 201
201 ASSERT(s_messageLoopInterruptor); 202 ASSERT(s_messageLoopInterruptor);
202 ThreadState::current()->removeInterruptor(s_messageLoopInterruptor); 203 ThreadState::current()->removeInterruptor(s_messageLoopInterruptor);
203 delete s_messageLoopInterruptor; 204 delete s_messageLoopInterruptor;
204 s_messageLoopInterruptor = 0; 205 s_messageLoopInterruptor = 0;
205 } 206 }
206 207
208 // Shutdown V8-related background threads before V8 is ramped down. Note
209 // that this will wait the thread to stop its operations.
210 ScriptStreamerThread::shutdown();
211
207 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate(); 212 v8::Isolate* isolate = V8PerIsolateData::mainThreadIsolate();
208 V8PerIsolateData::willBeDestroyed(isolate); 213 V8PerIsolateData::willBeDestroyed(isolate);
209 214
210 // Make sure we stop WorkerThreads before the main thread's ThreadState 215 // Make sure we stop WorkerThreads before the main thread's ThreadState
211 // and later shutdown steps starts freeing up resources needed during 216 // and later shutdown steps starts freeing up resources needed during
212 // worker termination. 217 // worker termination.
213 WorkerThread::terminateAndWaitForAllWorkers(); 218 WorkerThread::terminateAndWaitForAllWorkers();
214 219
215 // Detach the main thread before starting the shutdown sequence 220 // Detach the main thread before starting the shutdown sequence
216 // so that the main thread won't get involved in a GC during the shutdown. 221 // so that the main thread won't get involved in a GC during the shutdown.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 channel->state = WTFLogChannelOn; 265 channel->state = WTFLogChannelOn;
261 #endif // !LOG_DISABLED 266 #endif // !LOG_DISABLED
262 } 267 }
263 268
264 void resetPluginCache(bool reloadPages) 269 void resetPluginCache(bool reloadPages)
265 { 270 {
266 Page::refreshPlugins(reloadPages); 271 Page::refreshPlugins(reloadPages);
267 } 272 }
268 273
269 } // namespace blink 274 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/Init.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698