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

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

Issue 297493004: Move modules-dependent eventtarget code out of core. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 7 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/modules/websockets/WebSocket.h ('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 22 matching lines...) Expand all
33 33
34 #include "RuntimeEnabledFeatures.h" 34 #include "RuntimeEnabledFeatures.h"
35 #include "bindings/v8/V8Binding.h" 35 #include "bindings/v8/V8Binding.h"
36 #include "bindings/v8/V8Initializer.h" 36 #include "bindings/v8/V8Initializer.h"
37 #include "core/Init.h" 37 #include "core/Init.h"
38 #include "core/dom/Microtask.h" 38 #include "core/dom/Microtask.h"
39 #include "core/frame/Settings.h" 39 #include "core/frame/Settings.h"
40 #include "core/page/Page.h" 40 #include "core/page/Page.h"
41 #include "core/workers/WorkerGlobalScopeProxy.h" 41 #include "core/workers/WorkerGlobalScopeProxy.h"
42 #include "gin/public/v8_platform.h" 42 #include "gin/public/v8_platform.h"
43 #include "modules/InitModules.h"
43 #include "platform/LayoutTestSupport.h" 44 #include "platform/LayoutTestSupport.h"
44 #include "platform/Logging.h" 45 #include "platform/Logging.h"
45 #include "platform/graphics/ImageDecodingStore.h" 46 #include "platform/graphics/ImageDecodingStore.h"
46 #include "platform/graphics/media/MediaPlayer.h" 47 #include "platform/graphics/media/MediaPlayer.h"
47 #include "platform/heap/Heap.h" 48 #include "platform/heap/Heap.h"
48 #include "platform/heap/glue/MessageLoopInterruptor.h" 49 #include "platform/heap/glue/MessageLoopInterruptor.h"
49 #include "platform/heap/glue/PendingGCRunner.h" 50 #include "platform/heap/glue/PendingGCRunner.h"
50 #include "public/platform/Platform.h" 51 #include "public/platform/Platform.h"
51 #include "public/platform/WebPrerenderingSupport.h" 52 #include "public/platform/WebPrerenderingSupport.h"
52 #include "public/platform/WebThread.h" 53 #include "public/platform/WebThread.h"
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // currentThread will always be non-null in production, but can be null in C hromium unit tests. 161 // currentThread will always be non-null in production, but can be null in C hromium unit tests.
161 if (WebThread* currentThread = platform->currentThread()) { 162 if (WebThread* currentThread = platform->currentThread()) {
162 ASSERT(!s_pendingGCRunner); 163 ASSERT(!s_pendingGCRunner);
163 s_pendingGCRunner = new WebCore::PendingGCRunner; 164 s_pendingGCRunner = new WebCore::PendingGCRunner;
164 currentThread->addTaskObserver(s_pendingGCRunner); 165 currentThread->addTaskObserver(s_pendingGCRunner);
165 166
166 ASSERT(!s_messageLoopInterruptor); 167 ASSERT(!s_messageLoopInterruptor);
167 s_messageLoopInterruptor = new WebCore::MessageLoopInterruptor(currentTh read); 168 s_messageLoopInterruptor = new WebCore::MessageLoopInterruptor(currentTh read);
168 WebCore::ThreadState::current()->addInterruptor(s_messageLoopInterruptor ); 169 WebCore::ThreadState::current()->addInterruptor(s_messageLoopInterruptor );
169 } 170 }
170 WebCore::init(); 171
172 DEFINE_STATIC_LOCAL(WebCore::ModulesInitializer, initializer, ());
eseidel 2014/05/19 21:44:23 So why can't we just call WebCore::init() and Modu
c.shu 2014/05/19 21:53:03 Thanks for the review, Eric. The problem was that
173 initializer.init();
171 174
172 // There are some code paths (for example, running WebKit in the browser 175 // There are some code paths (for example, running WebKit in the browser
173 // process and calling into LocalStorage before anything else) where the 176 // process and calling into LocalStorage before anything else) where the
174 // UTF8 string encoding tables are used on a background thread before 177 // UTF8 string encoding tables are used on a background thread before
175 // they're set up. This is a problem because their set up routines assert 178 // they're set up. This is a problem because their set up routines assert
176 // they're running on the main WebKitThread. It might be possible to make 179 // they're running on the main WebKitThread. It might be possible to make
177 // the initialization thread-safe, but given that so many code paths use 180 // the initialization thread-safe, but given that so many code paths use
178 // this, initializing this lazily probably doesn't buy us much. 181 // this, initializing this lazily probably doesn't buy us much.
179 WTF::UTF8Encoding(); 182 WTF::UTF8Encoding();
180 183
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 channel->state = WTFLogChannelOn; 261 channel->state = WTFLogChannelOn;
259 #endif // !LOG_DISABLED 262 #endif // !LOG_DISABLED
260 } 263 }
261 264
262 void resetPluginCache(bool reloadPages) 265 void resetPluginCache(bool reloadPages)
263 { 266 {
264 WebCore::Page::refreshPlugins(reloadPages); 267 WebCore::Page::refreshPlugins(reloadPages);
265 } 268 }
266 269
267 } // namespace blink 270 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/websockets/WebSocket.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698