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

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

Issue 656463004: Use the scheduling mechanism provided by the platform (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed header path. Created 6 years, 2 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
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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "gin/public/v8_platform.h" 43 #include "gin/public/v8_platform.h"
44 #include "modules/InitModules.h" 44 #include "modules/InitModules.h"
45 #include "platform/LayoutTestSupport.h" 45 #include "platform/LayoutTestSupport.h"
46 #include "platform/Logging.h" 46 #include "platform/Logging.h"
47 #include "platform/RuntimeEnabledFeatures.h" 47 #include "platform/RuntimeEnabledFeatures.h"
48 #include "platform/graphics/ImageDecodingStore.h" 48 #include "platform/graphics/ImageDecodingStore.h"
49 #include "platform/graphics/media/MediaPlayer.h" 49 #include "platform/graphics/media/MediaPlayer.h"
50 #include "platform/heap/Heap.h" 50 #include "platform/heap/Heap.h"
51 #include "platform/heap/glue/MessageLoopInterruptor.h" 51 #include "platform/heap/glue/MessageLoopInterruptor.h"
52 #include "platform/heap/glue/PendingGCRunner.h" 52 #include "platform/heap/glue/PendingGCRunner.h"
53 #include "platform/scheduler/Scheduler.h"
54 #include "public/platform/Platform.h" 53 #include "public/platform/Platform.h"
55 #include "public/platform/WebPrerenderingSupport.h" 54 #include "public/platform/WebPrerenderingSupport.h"
55 #include "public/platform/WebScheduler.h"
56 #include "public/platform/WebThread.h" 56 #include "public/platform/WebThread.h"
57 #include "web/IndexedDBClientImpl.h" 57 #include "web/IndexedDBClientImpl.h"
58 #include "web/WebMediaPlayerClientImpl.h" 58 #include "web/WebMediaPlayerClientImpl.h"
59 #include "wtf/Assertions.h" 59 #include "wtf/Assertions.h"
60 #include "wtf/CryptographicallyRandomNumber.h" 60 #include "wtf/CryptographicallyRandomNumber.h"
61 #include "wtf/MainThread.h" 61 #include "wtf/MainThread.h"
62 #include "wtf/WTF.h" 62 #include "wtf/WTF.h"
63 #include "wtf/text/AtomicString.h" 63 #include "wtf/text/AtomicString.h"
64 #include "wtf/text/TextEncoding.h" 64 #include "wtf/text/TextEncoding.h"
65 #include <v8.h> 65 #include <v8.h>
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 ASSERT(!s_webKitInitialized); 141 ASSERT(!s_webKitInitialized);
142 s_webKitInitialized = true; 142 s_webKitInitialized = true;
143 143
144 ASSERT(platform); 144 ASSERT(platform);
145 Platform::initialize(platform); 145 Platform::initialize(platform);
146 146
147 WTF::setRandomSource(cryptographicallyRandomValues); 147 WTF::setRandomSource(cryptographicallyRandomValues);
148 WTF::initialize(currentTimeFunction, monotonicallyIncreasingTimeFunction); 148 WTF::initialize(currentTimeFunction, monotonicallyIncreasingTimeFunction);
149 WTF::initializeMainThread(callOnMainThreadFunction); 149 WTF::initializeMainThread(callOnMainThreadFunction);
150 Heap::init(); 150 Heap::init();
151 Scheduler::initializeOnMainThread();
152 151
153 ThreadState::attachMainThread(); 152 ThreadState::attachMainThread();
154 // currentThread will always be non-null in production, but can be null in C hromium unit tests. 153 // currentThread will always be non-null in production, but can be null in C hromium unit tests.
155 if (WebThread* currentThread = platform->currentThread()) { 154 if (WebThread* currentThread = platform->currentThread()) {
156 ASSERT(!s_pendingGCRunner); 155 ASSERT(!s_pendingGCRunner);
157 s_pendingGCRunner = new PendingGCRunner; 156 s_pendingGCRunner = new PendingGCRunner;
158 currentThread->addTaskObserver(s_pendingGCRunner); 157 currentThread->addTaskObserver(s_pendingGCRunner);
159 158
160 ASSERT(!s_messageLoopInterruptor); 159 ASSERT(!s_messageLoopInterruptor);
161 s_messageLoopInterruptor = new MessageLoopInterruptor(currentThread); 160 s_messageLoopInterruptor = new MessageLoopInterruptor(currentThread);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 218
220 V8PerIsolateData::destroy(isolate); 219 V8PerIsolateData::destroy(isolate);
221 220
222 shutdownWithoutV8(); 221 shutdownWithoutV8();
223 } 222 }
224 223
225 void shutdownWithoutV8() 224 void shutdownWithoutV8()
226 { 225 {
227 ASSERT(!s_endOfTaskRunner); 226 ASSERT(!s_endOfTaskRunner);
228 CoreInitializer::shutdown(); 227 CoreInitializer::shutdown();
229 Scheduler::shutdown(); 228 if (WebScheduler* scheduler = Platform::current()->scheduler())
eseidel 2014/10/21 16:11:02 Does this need to be before WTF and Heap? Is this
Sami 2014/10/21 18:49:34 Yes, it needs to be right between CoreInitializer:
229 scheduler->shutdown();
230 Heap::shutdown(); 230 Heap::shutdown();
231 WTF::shutdown(); 231 WTF::shutdown();
232 Platform::shutdown(); 232 Platform::shutdown();
233 WebPrerenderingSupport::shutdown(); 233 WebPrerenderingSupport::shutdown();
234 } 234 }
235 235
236 void setLayoutTestMode(bool value) 236 void setLayoutTestMode(bool value)
237 { 237 {
238 LayoutTestSupport::setIsRunningLayoutTest(value); 238 LayoutTestSupport::setIsRunningLayoutTest(value);
239 } 239 }
(...skipping 21 matching lines...) Expand all
261 channel->state = WTFLogChannelOn; 261 channel->state = WTFLogChannelOn;
262 #endif // !LOG_DISABLED 262 #endif // !LOG_DISABLED
263 } 263 }
264 264
265 void resetPluginCache(bool reloadPages) 265 void resetPluginCache(bool reloadPages)
266 { 266 {
267 Page::refreshPlugins(reloadPages); 267 Page::refreshPlugins(reloadPages);
268 } 268 }
269 269
270 } // namespace blink 270 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698