Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / Source / core / Init.cpp
blob1576624f3cc92f5dd3eb838cbed00ca14ecfa38f
1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
6 * met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above
11 * copyright notice, this list of conditions and the following disclaimer
12 * in the documentation and/or other materials provided with the
13 * distribution.
14 * * Neither the name of Google Inc. nor the names of its
15 * contributors may be used to endorse or promote products derived from
16 * this software without specific prior written permission.
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 #include "config.h"
32 #include "Init.h"
34 #include "bindings/core/v8/ScriptStreamerThread.h"
35 #include "core/EventNames.h"
36 #include "core/EventTargetNames.h"
37 #include "core/EventTypeNames.h"
38 #include "core/HTMLNames.h"
39 #include "core/HTMLTokenizerNames.h"
40 #include "core/InputTypeNames.h"
41 #include "core/MathMLNames.h"
42 #include "core/MediaFeatureNames.h"
43 #include "core/MediaTypeNames.h"
44 #include "core/SVGNames.h"
45 #include "core/XLinkNames.h"
46 #include "core/XMLNSNames.h"
47 #include "core/XMLNames.h"
48 #include "core/css/parser/CSSParserTokenRange.h"
49 #include "core/dom/Document.h"
50 #include "core/dom/StyleChangeReason.h"
51 #include "core/events/EventFactory.h"
52 #include "core/fetch/FetchInitiatorTypeNames.h"
53 #include "core/html/canvas/CanvasRenderingContextFactory.h"
54 #include "core/html/parser/HTMLParserThread.h"
55 #include "core/workers/WorkerThread.h"
56 #include "platform/EventTracer.h"
57 #include "platform/FontFamilyNames.h"
58 #include "platform/weborigin/KURL.h"
59 #include "platform/weborigin/SecurityPolicy.h"
60 #include "wtf/Partitions.h"
61 #include "wtf/text/StringStatics.h"
63 namespace blink {
65 void CoreInitializer::registerEventFactory()
67 static bool isRegistered = false;
68 if (isRegistered)
69 return;
70 isRegistered = true;
72 Document::registerEventFactory(EventFactory::create());
75 void CoreInitializer::init()
77 ASSERT(!m_isInited);
78 m_isInited = true;
80 HTMLNames::init();
81 SVGNames::init();
82 XLinkNames::init();
83 MathMLNames::init();
84 XMLNSNames::init();
85 XMLNames::init();
87 EventNames::init();
88 EventTargetNames::init();
89 EventTypeNames::init();
90 FetchInitiatorTypeNames::init();
91 FontFamilyNames::init();
92 HTMLTokenizerNames::init();
93 InputTypeNames::init();
94 MediaFeatureNames::init();
95 MediaTypeNames::init();
97 CSSPrimitiveValue::initUnitTable();
98 CSSParserTokenRange::initStaticEOFToken();
100 // It would make logical sense to do this in WTF::initialize() but there are
101 // ordering dependencies, e.g. about "xmlns".
102 WTF::StringStatics::init();
104 StyleChangeExtraData::init();
106 QualifiedName::init();
107 EventTracer::initialize();
108 KURL::initialize();
109 SecurityPolicy::init();
111 registerEventFactory();
113 StringImpl::freezeStaticStrings();
115 // Creates HTMLParserThread::shared and ScriptStreamerThread::shared, but
116 // does not start the threads.
117 HTMLParserThread::init();
118 ScriptStreamerThread::init();
121 void CoreInitializer::shutdown()
123 // Make sure we stop the HTMLParserThread before Platform::current() is
124 // cleared.
125 HTMLParserThread::shutdown();
128 } // namespace blink