| 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 37399f545ca475db1e18cd29ce91cdf00fed7e81..3e90beee8eacb41d69208bac01aa871b946bbcec 100644
|
| --- a/third_party/WebKit/Source/platform/heap/Persistent.h
|
| +++ b/third_party/WebKit/Source/platform/heap/Persistent.h
|
| @@ -224,6 +224,14 @@ private:
|
|
|
| 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(m_persistentNode);
|
|
|