Index: Source/core/inspector/AsyncCallTracker.cpp |
diff --git a/Source/core/inspector/AsyncCallTracker.cpp b/Source/core/inspector/AsyncCallTracker.cpp |
index a35e842274a4b2156959358aea1d49d25cbd6471..fdfd8d50095f6ca3c76dacd2dc2e4841b5cc8a04 100644 |
--- a/Source/core/inspector/AsyncCallTracker.cpp |
+++ b/Source/core/inspector/AsyncCallTracker.cpp |
@@ -78,13 +78,17 @@ public: |
virtual void contextDestroyed() override |
haraken
2015/01/13 15:17:48
Who removes the ExecutionContextData from the obse
aandrey
2015/01/13 15:39:25
We could not unobserve from contextDestroyed() cal
|
{ |
ASSERT(executionContext()); |
- // It is possible that resetAsyncCallChains() is already called and thus |
- // this ExecutionContextData is removed from m_executionContextDataMap. |
OwnPtrWillBeRawPtr<ExecutionContextData> self = m_tracker->m_executionContextDataMap.take(executionContext()); |
- if (self) { |
- dispose(); |
- } |
+ ASSERT_UNUSED(self, self == this); |
ContextLifecycleObserver::contextDestroyed(); |
+ clearLifecycleContext(); |
+ disposeCallChains(); |
+ } |
+ |
+ void unobserve() |
+ { |
+ disposeCallChains(); |
+ dispose(); |
} |
int nextAsyncOperationUniqueId() |
@@ -112,17 +116,6 @@ public: |
ContextLifecycleObserver::trace(visitor); |
} |
- void dispose() |
- { |
- m_timerCallChains.dispose(); |
- m_animationFrameCallChains.dispose(); |
- m_eventCallChains.dispose(); |
- m_xhrCallChains.dispose(); |
- m_mutationObserverCallChains.dispose(); |
- m_executionContextTaskCallChains.dispose(); |
- m_asyncOperationCallChains.dispose(); |
- } |
- |
RawPtrWillBeMember<AsyncCallTracker> m_tracker; |
HashSet<int> m_intervalTimerIds; |
AsyncCallChainMap<int> m_timerCallChains; |
@@ -134,6 +127,17 @@ public: |
AsyncCallChainMap<int> m_asyncOperationCallChains; |
private: |
+ void disposeCallChains() |
+ { |
+ m_timerCallChains.dispose(); |
+ m_animationFrameCallChains.dispose(); |
+ m_eventCallChains.dispose(); |
+ m_xhrCallChains.dispose(); |
+ m_mutationObserverCallChains.dispose(); |
+ m_executionContextTaskCallChains.dispose(); |
+ m_asyncOperationCallChains.dispose(); |
+ } |
+ |
int m_circularSequentialId; |
}; |
@@ -166,7 +170,7 @@ void AsyncCallTracker::asyncCallTrackingStateChanged(bool tracking) |
void AsyncCallTracker::resetAsyncCallChains() |
{ |
for (auto& it : m_executionContextDataMap) |
- it.value->dispose(); |
+ it.value->unobserve(); |
m_executionContextDataMap.clear(); |
} |