| 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 |
| 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 Loading... |
| 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 |
| OLD | NEW |