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

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

Issue 2547843002: Refactor setImportsController() to clarify invariants (Closed)
Patch Set: Rebase Created 4 years 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 dd47f2aa3a69bae0508d3521d70c7ca0cc2cefc1..e2ffcd3d20a2427deb069f79eb4b543818d453ce 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -904,13 +904,17 @@ V0CustomElementMicrotaskRunQueue* Document::customElementMicrotaskRunQueue() {
return m_customElementMicrotaskRunQueue.get();
}
-void Document::setImportsController(HTMLImportsController* controller) {
- DCHECK(!m_importsController || !controller);
- m_importsController = controller;
- if (!m_importsController && !loader())
+void Document::clearImportsController() {
+ m_importsController = nullptr;
+ if (!loader())
m_fetcher->clearContext();
}
+void Document::createImportsController() {
+ DCHECK(!m_importsController);
+ m_importsController = HTMLImportsController::create(*this);
+}
+
HTMLImportLoader* Document::importLoader() const {
if (!m_importsController)
return 0;
@@ -2480,7 +2484,7 @@ void Document::shutdown() {
// thinking they should have access to a valid frame when they don't.
if (m_importsController) {
m_importsController->dispose();
- setImportsController(nullptr);
+ clearImportsController();
}
m_timers.setTimerTaskRunner(Platform::current()
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.h ('k') | third_party/WebKit/Source/core/html/imports/HTMLImportLoader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698