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

Unified Diff: Source/modules/InitModules.cpp

Issue 464043002: Refactor module initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« Source/core/Init.h ('K') | « Source/modules/InitModules.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/InitModules.cpp
diff --git a/Source/modules/InitModules.cpp b/Source/modules/InitModules.cpp
index b1b14e6a5fcb33e5b9580f7c24e04550a86839ec..329b473d036cbe6c6450c3e3fe3fec98cbbd0204 100644
--- a/Source/modules/InitModules.cpp
+++ b/Source/modules/InitModules.cpp
@@ -14,21 +14,31 @@
namespace blink {
+void ModulesInitializer::init()
+{
+ ASSERT(!m_isInited);
+
+ // Strings must be initialized before calling CoreInitializer::init().
+ initEventNames();
+ initEventTargetNames();
+ registerEventFactory();
+ initBindings();
+
+ CoreInitializer::init();
+}
abarth-chromium 2014/08/12 21:42:55 I'd add an ASSERT(m_isInited); at the end of this
cmumford 2014/08/12 22:26:35 Done.
+
void ModulesInitializer::initEventNames()
{
- EventNames::init();
EventNames::initModules();
}
void ModulesInitializer::initEventTargetNames()
{
- EventTargetNames::init();
EventTargetNames::initModules();
}
void ModulesInitializer::registerEventFactory()
{
- CoreInitializer::registerEventFactory();
Document::registerEventFactory(EventModulesFactory::create());
}
abarth-chromium 2014/08/12 21:42:55 Can you inline these functions into their one call
cmumford 2014/08/12 22:26:35 Done. Also took the liberty of doing the same with
« Source/core/Init.h ('K') | « Source/modules/InitModules.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698