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

Side by Side Diff: third_party/WebKit/Source/web/WebKit.cpp

Issue 1773273004: Move code to register/unregister memory dump provider from blink::initialize/shutdown (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
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 modulesInitializer().init(); 105 modulesInitializer().init();
106 setIndexedDBClientCreateFunction(IndexedDBClientImpl::create); 106 setIndexedDBClientCreateFunction(IndexedDBClientImpl::create);
107 107
108 V8Initializer::initializeMainThread(); 108 V8Initializer::initializeMainThread();
109 109
110 // currentThread is null if we are running on a thread without a message loo p. 110 // currentThread is null if we are running on a thread without a message loo p.
111 if (WebThread* currentThread = platform->currentThread()) { 111 if (WebThread* currentThread = platform->currentThread()) {
112 ASSERT(!s_endOfTaskRunner); 112 ASSERT(!s_endOfTaskRunner);
113 s_endOfTaskRunner = new EndOfTaskRunner; 113 s_endOfTaskRunner = new EndOfTaskRunner;
114 currentThread->addTaskObserver(s_endOfTaskRunner); 114 currentThread->addTaskObserver(s_endOfTaskRunner);
115
116 // Register web cache dump provider for tracing.
117 platform->registerMemoryDumpProvider(WebCacheMemoryDumpProvider::instanc e(), "MemoryCache");
118 platform->registerMemoryDumpProvider(FontCacheMemoryDumpProvider::instan ce(), "FontCaches");
119 } 115 }
120 } 116 }
121 117
122 v8::Isolate* mainThreadIsolate() 118 v8::Isolate* mainThreadIsolate()
123 { 119 {
124 return V8PerIsolateData::mainThreadIsolate(); 120 return V8PerIsolateData::mainThreadIsolate();
125 } 121 }
126 122
127 static void maxObservedSizeFunction(size_t sizeInMB) 123 static void maxObservedSizeFunction(size_t sizeInMB)
128 { 124 {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // not scanned by LSan due to being held in non-global storage 175 // not scanned by LSan due to being held in non-global storage
180 // ("static" references inside functions/methods.) 176 // ("static" references inside functions/methods.)
181 if (ThreadState* threadState = ThreadState::current()) { 177 if (ThreadState* threadState = ThreadState::current()) {
182 threadState->releaseStaticPersistentNodes(); 178 threadState->releaseStaticPersistentNodes();
183 Heap::collectAllGarbage(); 179 Heap::collectAllGarbage();
184 } 180 }
185 #endif 181 #endif
186 182
187 // currentThread() is null if we are running on a thread without a message l oop. 183 // currentThread() is null if we are running on a thread without a message l oop.
188 if (Platform::current()->currentThread()) { 184 if (Platform::current()->currentThread()) {
189 Platform::current()->unregisterMemoryDumpProvider(WebCacheMemoryDumpProv ider::instance());
190 Platform::current()->unregisterMemoryDumpProvider(FontCacheMemoryDumpPro vider::instance());
191
192 // We don't need to (cannot) remove s_endOfTaskRunner from the current 185 // We don't need to (cannot) remove s_endOfTaskRunner from the current
193 // message loop, because the message loop is already destructed before 186 // message loop, because the message loop is already destructed before
194 // the shutdown() is called. 187 // the shutdown() is called.
195 delete s_endOfTaskRunner; 188 delete s_endOfTaskRunner;
196 s_endOfTaskRunner = nullptr; 189 s_endOfTaskRunner = nullptr;
197 } 190 }
198 191
199 // Shutdown V8-related background threads before V8 is ramped down. Note 192 // Shutdown V8-related background threads before V8 is ramped down. Note
200 // that this will wait the thread to stop its operations. 193 // that this will wait the thread to stop its operations.
201 ScriptStreamerThread::shutdown(); 194 ScriptStreamerThread::shutdown();
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 ASSERT(!reloadPages); 274 ASSERT(!reloadPages);
282 Page::refreshPlugins(); 275 Page::refreshPlugins();
283 } 276 }
284 277
285 void decommitFreeableMemory() 278 void decommitFreeableMemory()
286 { 279 {
287 WTF::Partitions::decommitFreeableMemory(); 280 WTF::Partitions::decommitFreeableMemory();
288 } 281 }
289 282
290 } // namespace blink 283 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698