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

Unified Diff: third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp

Issue 2553803003: Refactor HTMLLinkElement
Patch Set: a 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/html/imports/HTMLImportsController.cpp
diff --git a/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp b/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp
index 76192bc40505fe648c8f12b47a864f279cfbd41a..230c4300d35ad472132a531f19cb84ccf57563ae 100644
--- a/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp
+++ b/third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp
@@ -34,6 +34,7 @@
#include "core/fetch/ResourceFetcher.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/UseCounter.h"
+#include "core/html/imports/HTMLImport.h"
#include "core/html/imports/HTMLImportChild.h"
#include "core/html/imports/HTMLImportChildClient.h"
#include "core/html/imports/HTMLImportLoader.h"
@@ -86,14 +87,15 @@ HTMLImportChild* HTMLImportsController::createChild(
return root()->add(child);
}
-HTMLImportChild* HTMLImportsController::load(HTMLImport* parent,
- HTMLImportChildClient* client,
+HTMLImportChild* HTMLImportsController::load(HTMLImportChildClient* client,
FetchRequest request) {
DCHECK(!request.url().isEmpty());
DCHECK(request.url().isValid());
- DCHECK(parent == root() ||
- toHTMLImportChild(parent)->loader()->isFirstImport(
- toHTMLImportChild(parent)));
+
+ HTMLImportLoader* loader = loaderFor(*master());
+ HTMLImport* parent = loader ? static_cast<HTMLImport*>(loader->firstImport())
+ : static_cast<HTMLImport*>(root());
+ DCHECK(parent);
if (HTMLImportChild* childToShareWith = root()->find(request.url())) {
HTMLImportLoader* loader = childToShareWith->loader();
@@ -110,7 +112,7 @@ HTMLImportChild* HTMLImportsController::load(HTMLImport* parent,
if (!resource)
return nullptr;
- HTMLImportLoader* loader = createLoader();
+ loader = createLoader();
HTMLImportChild* child = createChild(request.url(), loader, parent, client);
// We set resource after the import tree is built since
// Resource::addClient() immediately calls back to feed the bytes when the

Powered by Google App Engine
This is Rietveld 408576698