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

Unified Diff: third_party/WebKit/Source/platform/heap/Handle.h

Issue 1964013002: Handle overlapping CrossThreadPersistent<> releases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: drop unneeded PLATFORM_EXPORTs Created 4 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/PersistentNode.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/Handle.h
diff --git a/third_party/WebKit/Source/platform/heap/Handle.h b/third_party/WebKit/Source/platform/heap/Handle.h
index a60b141b6359139a0ae41507565753b612ebf294..69cb7575950ac9f977932624164767e83a43e6da 100644
--- a/third_party/WebKit/Source/platform/heap/Handle.h
+++ b/third_party/WebKit/Source/platform/heap/Handle.h
@@ -227,15 +227,15 @@ private:
TraceCallback traceCallback = TraceMethodDelegate<PersistentBase<T, weaknessConfiguration, crossThreadnessConfiguration>, &PersistentBase<T, weaknessConfiguration, crossThreadnessConfiguration>::trace>::trampoline;
if (crossThreadnessConfiguration == CrossThreadPersistentConfiguration) {
- m_persistentNode = ProcessHeap::crossThreadPersistentRegion().allocatePersistentNode(this, traceCallback);
- } else {
- ThreadState* state = ThreadStateFor<ThreadingTrait<T>::Affinity>::state();
- ASSERT(state->checkThread());
- m_persistentNode = state->getPersistentRegion()->allocatePersistentNode(this, traceCallback);
+ ProcessHeap::crossThreadPersistentRegion().allocatePersistentNode(m_persistentNode, this, traceCallback);
+ return;
+ }
+ ThreadState* state = ThreadStateFor<ThreadingTrait<T>::Affinity>::state();
+ ASSERT(state->checkThread());
+ m_persistentNode = state->getPersistentRegion()->allocatePersistentNode(this, traceCallback);
#if ENABLE(ASSERT)
- m_state = state;
+ m_state = state;
#endif
- }
}
void uninitialize()
@@ -245,13 +245,13 @@ private:
if (crossThreadnessConfiguration == CrossThreadPersistentConfiguration) {
ProcessHeap::crossThreadPersistentRegion().freePersistentNode(m_persistentNode);
- } else {
- ThreadState* state = ThreadStateFor<ThreadingTrait<T>::Affinity>::state();
- ASSERT(state->checkThread());
- // Persistent handle must be created and destructed in the same thread.
- ASSERT(m_state == state);
- state->freePersistentNode(m_persistentNode);
+ return;
}
+ ThreadState* state = ThreadStateFor<ThreadingTrait<T>::Affinity>::state();
+ ASSERT(state->checkThread());
+ // Persistent handle must be created and destructed in the same thread.
+ ASSERT(m_state == state);
+ state->freePersistentNode(m_persistentNode);
m_persistentNode = nullptr;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/platform/heap/PersistentNode.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698