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

Side by Side Diff: third_party/WebKit/Source/core/Init.cpp

Issue 1761853002: Shut down all threads before the main thread shuts down (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 | « third_party/WebKit/Source/core/Init.h ('k') | third_party/WebKit/Source/modules/InitModules.h » ('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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 static bool isRegistered = false; 67 static bool isRegistered = false;
68 if (isRegistered) 68 if (isRegistered)
69 return; 69 return;
70 isRegistered = true; 70 isRegistered = true;
71 71
72 Document::registerEventFactory(EventFactory::create()); 72 Document::registerEventFactory(EventFactory::create());
73 } 73 }
74 74
75 void CoreInitializer::init() 75 void CoreInitializer::init()
76 { 76 {
77 ASSERT(!m_isInited); 77 ASSERT(!isInitialized());
78 m_isInited = true; 78 m_isInitialized = true;
79 // Note: in order to add core static strings for a new module (1) 79 // Note: in order to add core static strings for a new module (1)
80 // the value of 'coreStaticStringsCount' must be updated with the 80 // the value of 'coreStaticStringsCount' must be updated with the
81 // added strings count, (2) if the added strings are quialified names 81 // added strings count, (2) if the added strings are quialified names
82 // the 'qualifiedNamesCount' must be updated as well, (3) the strings 82 // the 'qualifiedNamesCount' must be updated as well, (3) the strings
83 // 'init()' function call must be added. 83 // 'init()' function call must be added.
84 // TODO(mikhail.pozdnyakov@intel.com): We should generate static strings ini tialization code. 84 // TODO(mikhail.pozdnyakov@intel.com): We should generate static strings ini tialization code.
85 const unsigned qualifiedNamesCount = HTMLNames::HTMLTagsCount + HTMLNames::H TMLAttrsCount 85 const unsigned qualifiedNamesCount = HTMLNames::HTMLTagsCount + HTMLNames::H TMLAttrsCount
86 + MathMLNames::MathMLTagsCount + MathMLNames::MathMLAttrsCount 86 + MathMLNames::MathMLTagsCount + MathMLNames::MathMLAttrsCount
87 + SVGNames::SVGTagsCount + SVGNames::SVGAttrsCount 87 + SVGNames::SVGTagsCount + SVGNames::SVGAttrsCount
88 + XLinkNames::XLinkAttrsCount 88 + XLinkNames::XLinkAttrsCount
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 registerEventFactory(); 136 registerEventFactory();
137 137
138 StringImpl::freezeStaticStrings(); 138 StringImpl::freezeStaticStrings();
139 139
140 // Creates HTMLParserThread::shared and ScriptStreamerThread::shared, but 140 // Creates HTMLParserThread::shared and ScriptStreamerThread::shared, but
141 // does not start the threads. 141 // does not start the threads.
142 HTMLParserThread::init(); 142 HTMLParserThread::init();
143 ScriptStreamerThread::init(); 143 ScriptStreamerThread::init();
144 } 144 }
145 145
146 void CoreInitializer::terminateThreads() 146 void CoreInitializer::shutdown()
147 { 147 {
148 // Make sure we stop the HTMLParserThread before Platform::current() is 148 // Make sure we stop the HTMLParserThread before Platform::current() is
149 // cleared. 149 // cleared.
150 ASSERT(Platform::current());
150 HTMLParserThread::shutdown(); 151 HTMLParserThread::shutdown();
151 152
152 WorkerThread::terminateAndWaitForAllWorkers(); 153 WorkerThread::terminateAndWaitForAllWorkers();
153 } 154 }
154 155
155 void CoreInitializer::shutdown()
156 {
157 }
158
159 } // namespace blink 156 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/Init.h ('k') | third_party/WebKit/Source/modules/InitModules.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698