| Index: third_party/WebKit/Source/platform/heap/Persistent.h
|
| diff --git a/third_party/WebKit/Source/platform/heap/Persistent.h b/third_party/WebKit/Source/platform/heap/Persistent.h
|
| index 36539c7efee59f111a0f3b4660e7ed5291eaf188..d75044be3019b76d627e3c72f133a09d1f9e3b25 100644
|
| --- a/third_party/WebKit/Source/platform/heap/Persistent.h
|
| +++ b/third_party/WebKit/Source/platform/heap/Persistent.h
|
| @@ -227,6 +227,14 @@ class PersistentBase {
|
| }
|
|
|
| void uninitialize() {
|
| + // TODO(haraken): This is a short-term hack to prevent use-after-frees
|
| + // during a shutdown sequence.
|
| + // 1) blink::shutdown() frees the underlying storage for persistent nodes.
|
| + // 2) ~MessageLoop() destructs some Chromium-side objects that hold
|
| + // Persistent. It touches the underlying storage and crashes.
|
| + if (WTF::isShutdown())
|
| + return;
|
| +
|
| if (crossThreadnessConfiguration == CrossThreadPersistentConfiguration) {
|
| if (acquireLoad(reinterpret_cast<void* volatile*>(&m_persistentNode)))
|
| ProcessHeap::crossThreadPersistentRegion().freePersistentNode(
|
|
|