OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "config.h" | 5 #include "config.h" |
6 #include "InitModules.h" | 6 #include "InitModules.h" |
7 | 7 |
8 #include "bindings/modules/v8/ModuleBindingsInitializer.h" | 8 #include "bindings/modules/v8/ModuleBindingsInitializer.h" |
9 #include "core/EventTypeNames.h" | 9 #include "core/EventTypeNames.h" |
10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
11 #include "core/html/HTMLCanvasElement.h" | 11 #include "core/html/HTMLCanvasElement.h" |
12 #include "modules/EventModulesFactory.h" | 12 #include "modules/EventModulesFactory.h" |
13 #include "modules/EventModulesNames.h" | 13 #include "modules/EventModulesNames.h" |
14 #include "modules/EventTargetModulesNames.h" | 14 #include "modules/EventTargetModulesNames.h" |
15 #include "modules/IndexedDBNames.h" | 15 #include "modules/IndexedDBNames.h" |
16 #include "modules/accessibility/AXObjectCacheImpl.h" | 16 #include "modules/accessibility/AXObjectCacheImpl.h" |
17 #include "modules/canvas2d/CanvasRenderingContext2D.h" | 17 #include "modules/canvas2d/CanvasRenderingContext2D.h" |
| 18 #include "modules/compositorworker/CompositorWorkerManager.h" |
18 #include "modules/filesystem/DraggedIsolatedFileSystemImpl.h" | 19 #include "modules/filesystem/DraggedIsolatedFileSystemImpl.h" |
19 #include "modules/webdatabase/DatabaseManager.h" | 20 #include "modules/webdatabase/DatabaseManager.h" |
20 #include "modules/webgl/WebGL2RenderingContext.h" | 21 #include "modules/webgl/WebGL2RenderingContext.h" |
21 #include "modules/webgl/WebGLRenderingContext.h" | 22 #include "modules/webgl/WebGLRenderingContext.h" |
22 | 23 |
23 namespace blink { | 24 namespace blink { |
24 | 25 |
25 void ModulesInitializer::init() | 26 void ModulesInitializer::init() |
26 { | 27 { |
27 ASSERT(!isInitialized()); | 28 ASSERT(!isInitialized()); |
28 | 29 |
29 // Strings must be initialized before calling CoreInitializer::init(). | 30 // Strings must be initialized before calling CoreInitializer::init(). |
30 const unsigned modulesStaticStringsCount = EventNames::EventModulesNamesCoun
t | 31 const unsigned modulesStaticStringsCount = EventNames::EventModulesNamesCoun
t |
31 + EventTargetNames::EventTargetModulesNamesCount | 32 + EventTargetNames::EventTargetModulesNamesCount |
32 + IndexedDBNames::IndexedDBNamesCount; | 33 + IndexedDBNames::IndexedDBNamesCount; |
33 StringImpl::reserveStaticStringsCapacityForSize(modulesStaticStringsCount); | 34 StringImpl::reserveStaticStringsCapacityForSize(modulesStaticStringsCount); |
34 | 35 |
35 EventNames::initModules(); | 36 EventNames::initModules(); |
36 EventTargetNames::initModules(); | 37 EventTargetNames::initModules(); |
37 Document::registerEventFactory(EventModulesFactory::create()); | 38 Document::registerEventFactory(EventModulesFactory::create()); |
38 ModuleBindingsInitializer::init(); | 39 ModuleBindingsInitializer::init(); |
39 IndexedDBNames::init(); | 40 IndexedDBNames::init(); |
40 AXObjectCache::init(AXObjectCacheImpl::create); | 41 AXObjectCache::init(AXObjectCacheImpl::create); |
41 DraggedIsolatedFileSystem::init(DraggedIsolatedFileSystemImpl::prepareForDat
aObject); | 42 DraggedIsolatedFileSystem::init(DraggedIsolatedFileSystemImpl::prepareForDat
aObject); |
42 | 43 |
43 CoreInitializer::init(); | 44 CoreInitializer::init(); |
44 | 45 |
| 46 if (RuntimeEnabledFeatures::compositorWorkerEnabled()) |
| 47 CompositorWorkerManager::initialize(); |
| 48 |
45 // Canvas context types must be registered with the HTMLCanvasElement. | 49 // Canvas context types must be registered with the HTMLCanvasElement. |
46 HTMLCanvasElement::registerRenderingContextFactory(adoptPtr(new CanvasRender
ingContext2D::Factory())); | 50 HTMLCanvasElement::registerRenderingContextFactory(adoptPtr(new CanvasRender
ingContext2D::Factory())); |
47 HTMLCanvasElement::registerRenderingContextFactory(adoptPtr(new WebGLRenderi
ngContext::Factory())); | 51 HTMLCanvasElement::registerRenderingContextFactory(adoptPtr(new WebGLRenderi
ngContext::Factory())); |
48 HTMLCanvasElement::registerRenderingContextFactory(adoptPtr(new WebGL2Render
ingContext::Factory())); | 52 HTMLCanvasElement::registerRenderingContextFactory(adoptPtr(new WebGL2Render
ingContext::Factory())); |
49 | 53 |
50 ASSERT(isInitialized()); | 54 ASSERT(isInitialized()); |
51 } | 55 } |
52 | 56 |
53 void ModulesInitializer::terminateThreads() | 57 void ModulesInitializer::terminateThreads() |
54 { | 58 { |
| 59 if (RuntimeEnabledFeatures::compositorWorkerEnabled()) |
| 60 CompositorWorkerManager::shutdown(); |
55 DatabaseManager::terminateDatabaseThread(); | 61 DatabaseManager::terminateDatabaseThread(); |
56 } | 62 } |
57 | 63 |
58 } // namespace blink | 64 } // namespace blink |
OLD | NEW |