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

Side by Side Diff: sky/engine/core/Init.cpp

Issue 879743004: Remove the EventFactory machinery. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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
« no previous file with comments | « sky/engine/core/Init.h ('k') | sky/engine/core/core.gni » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 22 matching lines...) Expand all
33 33
34 #include "gen/sky/core/EventNames.h" 34 #include "gen/sky/core/EventNames.h"
35 #include "gen/sky/core/EventTargetNames.h" 35 #include "gen/sky/core/EventTargetNames.h"
36 #include "gen/sky/core/EventTypeNames.h" 36 #include "gen/sky/core/EventTypeNames.h"
37 #include "gen/sky/core/FetchInitiatorTypeNames.h" 37 #include "gen/sky/core/FetchInitiatorTypeNames.h"
38 #include "gen/sky/core/HTMLNames.h" 38 #include "gen/sky/core/HTMLNames.h"
39 #include "gen/sky/core/MediaFeatureNames.h" 39 #include "gen/sky/core/MediaFeatureNames.h"
40 #include "gen/sky/core/MediaTypeNames.h" 40 #include "gen/sky/core/MediaTypeNames.h"
41 #include "gen/sky/platform/FontFamilyNames.h" 41 #include "gen/sky/platform/FontFamilyNames.h"
42 #include "sky/engine/core/dom/Document.h" 42 #include "sky/engine/core/dom/Document.h"
43 #include "sky/engine/core/events/EventFactory.h"
44 #include "sky/engine/core/html/parser/HTMLParserThread.h" 43 #include "sky/engine/core/html/parser/HTMLParserThread.h"
45 #include "sky/engine/platform/EventTracer.h" 44 #include "sky/engine/platform/EventTracer.h"
46 #include "sky/engine/platform/Partitions.h" 45 #include "sky/engine/platform/Partitions.h"
47 #include "sky/engine/platform/PlatformThreadData.h" 46 #include "sky/engine/platform/PlatformThreadData.h"
48 #include "sky/engine/wtf/text/StringStatics.h" 47 #include "sky/engine/wtf/text/StringStatics.h"
49 48
50 namespace blink { 49 namespace blink {
51 50
52 void CoreInitializer::registerEventFactory()
53 {
54 static bool isRegistered = false;
55 if (isRegistered)
56 return;
57 isRegistered = true;
58
59 Document::registerEventFactory(EventFactory::create());
60 }
61
62 void CoreInitializer::init() 51 void CoreInitializer::init()
63 { 52 {
64 ASSERT(!m_isInited); 53 ASSERT(!m_isInited);
65 m_isInited = true; 54 m_isInited = true;
66 55
67 HTMLNames::init(); 56 HTMLNames::init();
68 57
69 EventNames::init(); 58 EventNames::init();
70 EventTargetNames::init(); 59 EventTargetNames::init();
71 EventTypeNames::init(); 60 EventTypeNames::init();
72 FetchInitiatorTypeNames::init(); 61 FetchInitiatorTypeNames::init();
73 FontFamilyNames::init(); 62 FontFamilyNames::init();
74 MediaFeatureNames::init(); 63 MediaFeatureNames::init();
75 MediaTypeNames::init(); 64 MediaTypeNames::init();
76 65
77 // It would make logical sense to do this in WTF::initialize() but there are 66 // It would make logical sense to do this in WTF::initialize() but there are
78 // ordering dependencies, e.g. about "xmlns". 67 // ordering dependencies, e.g. about "xmlns".
79 WTF::StringStatics::init(); 68 WTF::StringStatics::init();
80 69
81 QualifiedName::init(); 70 QualifiedName::init();
82 Partitions::init(); 71 Partitions::init();
83 EventTracer::initialize(); 72 EventTracer::initialize();
84 73
85 registerEventFactory();
86
87 // Ensure that the main thread's thread-local data is initialized before 74 // Ensure that the main thread's thread-local data is initialized before
88 // starting any worker threads. 75 // starting any worker threads.
89 PlatformThreadData::current(); 76 PlatformThreadData::current();
90 77
91 StringImpl::freezeStaticStrings(); 78 StringImpl::freezeStaticStrings();
92 79
93 HTMLParserThread::start(); 80 HTMLParserThread::start();
94 } 81 }
95 82
96 void CoreInitializer::shutdown() 83 void CoreInitializer::shutdown()
97 { 84 {
98 HTMLParserThread::stop(); 85 HTMLParserThread::stop();
99 Partitions::shutdown(); 86 Partitions::shutdown();
100 } 87 }
101 88
102 } // namespace blink 89 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/core/Init.h ('k') | sky/engine/core/core.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698