| OLD | NEW |
| 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 Loading... |
| 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 | |
| 213 // currentThread() is null if we are running on a thread without a message l
oop. | 198 // currentThread() is null if we are running on a thread without a message l
oop. |
| 214 if (Platform::current()->currentThread()) { | 199 if (Platform::current()->currentThread()) { |
| 215 Platform::current()->unregisterMemoryDumpProvider(WebCacheMemoryDumpProv
ider::instance()); | 200 Platform::current()->unregisterMemoryDumpProvider(WebCacheMemoryDumpProv
ider::instance()); |
| 216 | 201 |
| 217 // We don't need to (cannot) remove s_endOfTaskRunner from the current | 202 // We don't need to (cannot) remove s_endOfTaskRunner from the current |
| 218 // message loop, because the message loop is already destructed before | 203 // message loop, because the message loop is already destructed before |
| 219 // the shutdown() is called. | 204 // the shutdown() is called. |
| 220 delete s_endOfTaskRunner; | 205 delete s_endOfTaskRunner; |
| 221 s_endOfTaskRunner = nullptr; | 206 s_endOfTaskRunner = nullptr; |
| 222 | 207 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 ASSERT(!reloadPages); | 295 ASSERT(!reloadPages); |
| 311 Page::refreshPlugins(); | 296 Page::refreshPlugins(); |
| 312 } | 297 } |
| 313 | 298 |
| 314 void decommitFreeableMemory() | 299 void decommitFreeableMemory() |
| 315 { | 300 { |
| 316 WTF::Partitions::decommitFreeableMemory(); | 301 WTF::Partitions::decommitFreeableMemory(); |
| 317 } | 302 } |
| 318 | 303 |
| 319 } // namespace blink | 304 } // namespace blink |
| OLD | NEW |