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

Unified Diff: Source/core/inspector/AsyncCallTracker.cpp

Issue 821643004: Clean up the fix of DevTools crashing in AsyncCallTracker. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 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 | « LayoutTests/inspector/sources/debugger/async-callstack-reload-no-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « LayoutTests/inspector/sources/debugger/async-callstack-reload-no-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698