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

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

Issue 625583002: Properly suspend HTMLDocumentParser (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed wrong method called Created 6 years, 2 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 | « no previous file | Source/core/dom/ExecutionContext.cpp » ('j') | Source/core/dom/ExecutionContext.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 294185a12a2b6e91f08a183c19a0ff035727792c..3ce2009d9d4af5f8d24e742d97cc7664d55378fd 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -547,6 +547,12 @@ Document::Document(const DocumentInit& initializer, DocumentClassFlags documentC
// m_fetcher.
m_styleEngine = StyleEngine::create(*this);
+ // The parent's parser should be suspended together with all the other objects,
+ // else this new Document would have a new ExecutionContext which suspended state
+ // would not match the one from the parent, and could start loading resources
+ // ignoring the defersLoading flag.
+ ASSERT(!parentDocument() || !parentDocument()->activeDOMObjectsAreSuspended());
+
#ifndef NDEBUG
liveDocumentSet().add(this);
#endif
« no previous file with comments | « no previous file | Source/core/dom/ExecutionContext.cpp » ('j') | Source/core/dom/ExecutionContext.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698