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/web/WebKit.cpp

Issue 1778773003: Change the order of Platform::initialize and WTF::initialize (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 | « no previous file | no next file » | 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 { 149 {
150 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(size); 150 v8::Isolate::GetCurrent()->AdjustAmountOfExternalAllocatedMemory(size);
151 } 151 }
152 152
153 void initializeWithoutV8(Platform* platform) 153 void initializeWithoutV8(Platform* platform)
154 { 154 {
155 ASSERT(!s_webKitInitialized); 155 ASSERT(!s_webKitInitialized);
156 s_webKitInitialized = true; 156 s_webKitInitialized = true;
157 157
158 WTF::Partitions::initialize(maxObservedSizeFunction); 158 WTF::Partitions::initialize(maxObservedSizeFunction);
159 ASSERT(platform); 159 ASSERT(platform);
sof 2016/03/09 19:07:52 nit: keep this assert alongside the platform init
160 Platform::initialize(platform);
161
162 WTF::initialize(adjustAmountOfExternalAllocatedMemory); 160 WTF::initialize(adjustAmountOfExternalAllocatedMemory);
163 WTF::initializeMainThread(callOnMainThreadFunction); 161 WTF::initializeMainThread(callOnMainThreadFunction);
162
163 Platform::initialize(platform);
164 Heap::init(); 164 Heap::init();
165 165
166 ThreadState::attachMainThread(); 166 ThreadState::attachMainThread();
167 // currentThread() is null if we are running on a thread without a message l oop. 167 // currentThread() is null if we are running on a thread without a message l oop.
168 if (WebThread* currentThread = platform->currentThread()) { 168 if (WebThread* currentThread = platform->currentThread()) {
169 ASSERT(!s_gcTaskRunner); 169 ASSERT(!s_gcTaskRunner);
170 s_gcTaskRunner = new GCTaskRunner(currentThread); 170 s_gcTaskRunner = new GCTaskRunner(currentThread);
171 } 171 }
172 } 172 }
173 173
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 delete s_gcTaskRunner; 222 delete s_gcTaskRunner;
223 s_gcTaskRunner = nullptr; 223 s_gcTaskRunner = nullptr;
224 } 224 }
225 225
226 // Detach the main thread before starting the shutdown sequence 226 // Detach the main thread before starting the shutdown sequence
227 // so that the main thread won't get involved in a GC during the shutdown. 227 // so that the main thread won't get involved in a GC during the shutdown.
228 ThreadState::detachMainThread(); 228 ThreadState::detachMainThread();
229 229
230 ASSERT(!s_endOfTaskRunner); 230 ASSERT(!s_endOfTaskRunner);
231 Heap::shutdown(); 231 Heap::shutdown();
232 Platform::shutdown();
233
232 WTF::shutdown(); 234 WTF::shutdown();
233 Platform::shutdown();
234 WebPrerenderingSupport::shutdown(); 235 WebPrerenderingSupport::shutdown();
235 WTF::Partitions::shutdown(); 236 WTF::Partitions::shutdown();
236 } 237 }
237 238
238 // TODO(tkent): The following functions to wrap LayoutTestSupport should be 239 // TODO(tkent): The following functions to wrap LayoutTestSupport should be
239 // moved to public/platform/. 240 // moved to public/platform/.
240 241
241 void setLayoutTestMode(bool value) 242 void setLayoutTestMode(bool value)
242 { 243 {
243 LayoutTestSupport::setIsRunningLayoutTest(value); 244 LayoutTestSupport::setIsRunningLayoutTest(value);
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 ASSERT(!reloadPages); 288 ASSERT(!reloadPages);
288 Page::refreshPlugins(); 289 Page::refreshPlugins();
289 } 290 }
290 291
291 void decommitFreeableMemory() 292 void decommitFreeableMemory()
292 { 293 {
293 WTF::Partitions::decommitFreeableMemory(); 294 WTF::Partitions::decommitFreeableMemory();
294 } 295 }
295 296
296 } // namespace blink 297 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698