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

Unified Diff: Source/core/Init.cpp

Issue 305723002: Use method registration approach for creating events on core and modules. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebaseline 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/Init.h ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/Init.cpp
diff --git a/Source/core/Init.cpp b/Source/core/Init.cpp
index 178dbde9bf0d2f4f3ba93379fd18cd9d930335db..bacf2b37b672a319b04b04ee85b109b0cf88b797 100644
--- a/Source/core/Init.cpp
+++ b/Source/core/Init.cpp
@@ -46,6 +46,8 @@
#include "XLinkNames.h"
#include "XMLNSNames.h"
#include "XMLNames.h"
+#include "core/dom/Document.h"
+#include "core/events/EventFactory.h"
#include "core/html/parser/HTMLParserThread.h"
#include "platform/EventTracer.h"
#include "platform/Partitions.h"
@@ -65,6 +67,16 @@ void CoreInitializer::initEventTargetNames()
EventTargetNames::init();
}
+void CoreInitializer::registerEventFactory()
+{
+ static bool isRegistered = false;
+ if (isRegistered)
+ return;
+ isRegistered = true;
+
+ Document::registerEventFactory(new EventFactory());
+}
+
void CoreInitializer::init()
{
if (m_isInited)
@@ -96,6 +108,8 @@ void CoreInitializer::init()
Partitions::init();
EventTracer::initialize();
+ registerEventFactory();
+
// Ensure that the main thread's thread-local data is initialized before
// starting any worker threads.
PlatformThreadData::current();
« no previous file with comments | « Source/core/Init.h ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698