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

Unified Diff: Source/platform/heap/ThreadState.h

Issue 1257723002: Simplify ownership of a ThreadState's interruptors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Switch addInterruptor() to take a PassOwnPtr<> Created 5 years, 5 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 | « Source/platform/heap/SafePoint.cpp ('k') | Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/ThreadState.h
diff --git a/Source/platform/heap/ThreadState.h b/Source/platform/heap/ThreadState.h
index 7c4b7a4c474887f99aed495e2f1f1f47320651ad..c098f13abb01baaeb028f556f20bbfca355640a8 100644
--- a/Source/platform/heap/ThreadState.h
+++ b/Source/platform/heap/ThreadState.h
@@ -445,12 +445,9 @@ public:
void onInterrupted();
};
- void addInterruptor(Interruptor*);
+ void addInterruptor(PassOwnPtr<Interruptor>);
void removeInterruptor(Interruptor*);
- // Should only be called under protection of threadAttachMutex().
- const Vector<Interruptor*>& interruptors() const { return m_interruptors; }
-
void recordStackEnd(intptr_t* endOfStack)
{
m_endOfStack = endOfStack;
@@ -717,6 +714,11 @@ private:
void clearHeapAges();
int heapIndexOfVectorHeapLeastRecentlyExpanded(int beginHeapIndex, int endHeapIndex);
+ using InterruptorVector = Vector<OwnPtr<Interruptor>>;
+
+ // Should only be called under protection of threadAttachMutex().
+ const InterruptorVector& interruptors() const { return m_interruptors; }
+
friend class SafePointAwareMutexLocker;
friend class SafePointBarrier;
friend class SafePointScope;
@@ -743,7 +745,7 @@ private:
void* m_safePointScopeMarker;
Vector<Address> m_safePointStackCopy;
bool m_atSafePoint;
- Vector<Interruptor*> m_interruptors;
+ InterruptorVector m_interruptors;
bool m_sweepForbidden;
size_t m_noAllocationCount;
size_t m_gcForbiddenCount;
« no previous file with comments | « Source/platform/heap/SafePoint.cpp ('k') | Source/platform/heap/ThreadState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698