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

Unified Diff: third_party/WebKit/Source/core/dom/Document.cpp

Issue 2174563003: Clear all preloads when document is detached (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix issues inside clearPreloads and add tests Created 4 years, 4 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
Index: third_party/WebKit/Source/core/dom/Document.cpp
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 0255c592c1a641e206e04344b65f7d043af09c30..f33136c7184a5ab7a9c35da6623145c00076260c 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -2225,8 +2225,10 @@ void Document::detachLayoutTree(const AttachContext& context)
// to the DocumentLoader when possible also prevents prematurely clearing
// the context in the case where multiple Documents end up associated with
// a single DocumentLoader (e.g., navigating to a javascript: url).
- if (!loader())
+ if (!loader()) {
+ m_fetcher->clearPreloads(ResourceFetcher::ClearAllPreloads);
Charlie Harrison 2016/08/04 18:10:26 tentative: can we do this in clearContext()?
Yoav Weiss 2016/08/04 20:26:14 sure. moved
m_fetcher->clearContext();
+ }
// If this document is the master for an HTMLImportsController, sever that
// relationship. This ensures that we don't leave import loads in flight,
// thinking they should have access to a valid frame when they don't.

Powered by Google App Engine
This is Rietveld 408576698