| 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" | |
| 19 #include "modules/filesystem/DraggedIsolatedFileSystemImpl.h" | 18 #include "modules/filesystem/DraggedIsolatedFileSystemImpl.h" |
| 20 #include "modules/webdatabase/DatabaseManager.h" | 19 #include "modules/webdatabase/DatabaseManager.h" |
| 21 #include "modules/webgl/WebGL2RenderingContext.h" | 20 #include "modules/webgl/WebGL2RenderingContext.h" |
| 22 #include "modules/webgl/WebGLRenderingContext.h" | 21 #include "modules/webgl/WebGLRenderingContext.h" |
| 23 | 22 |
| 24 namespace blink { | 23 namespace blink { |
| 25 | 24 |
| 26 void ModulesInitializer::init() | 25 void ModulesInitializer::init() |
| 27 { | 26 { |
| 28 ASSERT(!isInitialized()); | 27 ASSERT(!isInitialized()); |
| 29 | 28 |
| 30 // Strings must be initialized before calling CoreInitializer::init(). | 29 // Strings must be initialized before calling CoreInitializer::init(). |
| 31 const unsigned modulesStaticStringsCount = EventNames::EventModulesNamesCoun
t | 30 const unsigned modulesStaticStringsCount = EventNames::EventModulesNamesCoun
t |
| 32 + EventTargetNames::EventTargetModulesNamesCount | 31 + EventTargetNames::EventTargetModulesNamesCount |
| 33 + IndexedDBNames::IndexedDBNamesCount; | 32 + IndexedDBNames::IndexedDBNamesCount; |
| 34 StringImpl::reserveStaticStringsCapacityForSize(modulesStaticStringsCount); | 33 StringImpl::reserveStaticStringsCapacityForSize(modulesStaticStringsCount); |
| 35 | 34 |
| 36 EventNames::initModules(); | 35 EventNames::initModules(); |
| 37 EventTargetNames::initModules(); | 36 EventTargetNames::initModules(); |
| 38 Document::registerEventFactory(EventModulesFactory::create()); | 37 Document::registerEventFactory(EventModulesFactory::create()); |
| 39 ModuleBindingsInitializer::init(); | 38 ModuleBindingsInitializer::init(); |
| 40 IndexedDBNames::init(); | 39 IndexedDBNames::init(); |
| 41 AXObjectCache::init(AXObjectCacheImpl::create); | 40 AXObjectCache::init(AXObjectCacheImpl::create); |
| 42 DraggedIsolatedFileSystem::init(DraggedIsolatedFileSystemImpl::prepareForDat
aObject); | 41 DraggedIsolatedFileSystem::init(DraggedIsolatedFileSystemImpl::prepareForDat
aObject); |
| 43 | 42 |
| 44 CoreInitializer::init(); | 43 CoreInitializer::init(); |
| 45 | 44 |
| 46 if (RuntimeEnabledFeatures::compositorWorkerEnabled()) | |
| 47 CompositorWorkerManager::initialize(); | |
| 48 | |
| 49 // Canvas context types must be registered with the HTMLCanvasElement. | 45 // Canvas context types must be registered with the HTMLCanvasElement. |
| 50 HTMLCanvasElement::registerRenderingContextFactory(adoptPtr(new CanvasRender
ingContext2D::Factory())); | 46 HTMLCanvasElement::registerRenderingContextFactory(adoptPtr(new CanvasRender
ingContext2D::Factory())); |
| 51 HTMLCanvasElement::registerRenderingContextFactory(adoptPtr(new WebGLRenderi
ngContext::Factory())); | 47 HTMLCanvasElement::registerRenderingContextFactory(adoptPtr(new WebGLRenderi
ngContext::Factory())); |
| 52 HTMLCanvasElement::registerRenderingContextFactory(adoptPtr(new WebGL2Render
ingContext::Factory())); | 48 HTMLCanvasElement::registerRenderingContextFactory(adoptPtr(new WebGL2Render
ingContext::Factory())); |
| 53 | 49 |
| 54 ASSERT(isInitialized()); | 50 ASSERT(isInitialized()); |
| 55 } | 51 } |
| 56 | 52 |
| 57 void ModulesInitializer::terminateThreads() | 53 void ModulesInitializer::terminateThreads() |
| 58 { | 54 { |
| 59 if (RuntimeEnabledFeatures::compositorWorkerEnabled()) | |
| 60 CompositorWorkerManager::shutdown(); | |
| 61 DatabaseManager::terminateDatabaseThread(); | 55 DatabaseManager::terminateDatabaseThread(); |
| 62 } | 56 } |
| 63 | 57 |
| 64 } // namespace blink | 58 } // namespace blink |
| OLD | NEW |