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

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

Issue 1491253004: Release Oilpan heap singletons prior to LSan leak detection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address non-LSan Oilpan compilation failure Created 5 years 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 } 188 }
189 189
190 DEFINE_STATIC_LOCAL(ModulesInitializer, initializer, ()); 190 DEFINE_STATIC_LOCAL(ModulesInitializer, initializer, ());
191 initializer.init(); 191 initializer.init();
192 192
193 setIndexedDBClientCreateFunction(IndexedDBClientImpl::create); 193 setIndexedDBClientCreateFunction(IndexedDBClientImpl::create);
194 } 194 }
195 195
196 void shutdown() 196 void shutdown()
197 { 197 {
198 #if defined(LEAK_SANITIZER)
199 // If LSan is about to perform leak detection, release all the registered
200 // static Persistent<> root references to global caches that Blink keeps,
201 // followed by GCs to clear out all they referred to. A full v8 GC cycle
202 // is needed to flush out all garbage.
203 //
204 // This is not needed for caches over non-Oilpan objects, as they're
205 // not scanned by LSan due to being held in non-global storage
206 // ("static" references inside functions/methods.)
207 if (ThreadState* threadState = ThreadState::current()) {
208 threadState->releaseStaticPersistentNodes();
209 Heap::collectAllGarbage();
210 }
211 #endif
212
198 // currentThread() is null if we are running on a thread without a message l oop. 213 // currentThread() is null if we are running on a thread without a message l oop.
199 if (Platform::current()->currentThread()) { 214 if (Platform::current()->currentThread()) {
200 Platform::current()->unregisterMemoryDumpProvider(WebCacheMemoryDumpProv ider::instance()); 215 Platform::current()->unregisterMemoryDumpProvider(WebCacheMemoryDumpProv ider::instance());
201 216
202 // We don't need to (cannot) remove s_endOfTaskRunner from the current 217 // We don't need to (cannot) remove s_endOfTaskRunner from the current
203 // message loop, because the message loop is already destructed before 218 // message loop, because the message loop is already destructed before
204 // the shutdown() is called. 219 // the shutdown() is called.
205 delete s_endOfTaskRunner; 220 delete s_endOfTaskRunner;
206 s_endOfTaskRunner = nullptr; 221 s_endOfTaskRunner = nullptr;
207 222
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 ASSERT(!reloadPages); 310 ASSERT(!reloadPages);
296 Page::refreshPlugins(); 311 Page::refreshPlugins();
297 } 312 }
298 313
299 void decommitFreeableMemory() 314 void decommitFreeableMemory()
300 { 315 {
301 WTF::Partitions::decommitFreeableMemory(); 316 WTF::Partitions::decommitFreeableMemory();
302 } 317 }
303 318
304 } // namespace blink 319 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/heap/ThreadState.cpp ('k') | third_party/WebKit/Source/wtf/BitVector.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698