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

Side by Side Diff: Source/modules/InitModules.cpp

Issue 464043002: Refactor module initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed one-line functions and added isInitialized Created 6 years, 4 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
« Source/modules/InitModules.h ('K') | « Source/modules/InitModules.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 // 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 "modules/EventModulesFactory.h" 11 #include "modules/EventModulesFactory.h"
12 #include "modules/EventModulesNames.h" 12 #include "modules/EventModulesNames.h"
13 #include "modules/EventTargetModulesNames.h" 13 #include "modules/EventTargetModulesNames.h"
14 14
15 namespace blink { 15 namespace blink {
16 16
17 void ModulesInitializer::initEventNames() 17 void ModulesInitializer::init()
18 { 18 {
19 EventNames::init(); 19 ASSERT(!isInitialized());
20
21 // Strings must be initialized before calling CoreInitializer::init().
20 EventNames::initModules(); 22 EventNames::initModules();
21 } 23 EventTargetNames::initModules();
24 Document::registerEventFactory(EventModulesFactory::create());
25 ModuleBindingsInitializer::init();
22 26
23 void ModulesInitializer::initEventTargetNames() 27 CoreInitializer::init();
24 {
25 EventTargetNames::init();
26 EventTargetNames::initModules();
27 }
28 28
29 void ModulesInitializer::registerEventFactory() 29 ASSERT(isInitialized());
30 {
31 CoreInitializer::registerEventFactory();
32 Document::registerEventFactory(EventModulesFactory::create());
33 }
34
35 void ModulesInitializer::initBindings()
36 {
37 ModuleBindingsInitializer::init();
38 } 30 }
39 31
40 } // namespace blink 32 } // namespace blink
OLDNEW
« Source/modules/InitModules.h ('K') | « Source/modules/InitModules.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698