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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2785873002: Detached FrameLoader should not log snapshot trace events (Closed)
Patch Set: Use boolean flag, rebase Created 3 years, 9 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 | « third_party/WebKit/Source/core/loader/FrameLoader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 8e001981251379fc0a86ea15d51e8c2a2fb9457d..0e0560f4b55ba6693a536244a8cd4c9d10630466 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -201,15 +201,15 @@ FrameLoader::FrameLoader(LocalFrame* frame)
&FrameLoader::checkTimerFired),
m_forcedSandboxFlags(SandboxNone),
m_dispatchingDidClearWindowObjectInMainWorld(false),
- m_protectProvisionalLoader(false) {
+ m_protectProvisionalLoader(false),
+ m_detached(false) {
DCHECK(m_frame);
TRACE_EVENT_OBJECT_CREATED_WITH_ID("loading", "FrameLoader", this);
takeObjectSnapshot();
}
FrameLoader::~FrameLoader() {
- // Verify that this FrameLoader has been detached.
- DCHECK(!m_progressTracker);
+ DCHECK(m_detached);
}
DEFINE_TRACE(FrameLoader) {
@@ -1380,6 +1380,7 @@ void FrameLoader::detach() {
}
TRACE_EVENT_OBJECT_DELETED_WITH_ID("loading", "FrameLoader", this);
+ m_detached = true;
}
void FrameLoader::loadFailed(DocumentLoader* loader,
@@ -1884,6 +1885,10 @@ std::unique_ptr<TracedValue> FrameLoader::toTracedValue() const {
}
inline void FrameLoader::takeObjectSnapshot() const {
+ if (m_detached) {
+ // We already logged TRACE_EVENT_OBJECT_DELETED_WITH_ID in detach().
+ return;
+ }
TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID("loading", "FrameLoader", this,
toTracedValue());
}
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698