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

Unified Diff: third_party/WebKit/Source/core/html/imports/LinkImport.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
« no previous file with comments | « third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp ('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/html/imports/LinkImport.cpp
diff --git a/third_party/WebKit/Source/core/html/imports/LinkImport.cpp b/third_party/WebKit/Source/core/html/imports/LinkImport.cpp
index c6cc63a09662d64e7bd98bf4c7948e57eacac3c8..8dad36ee3485614500bcb4a00e41bacdedda01ee 100644
--- a/third_party/WebKit/Source/core/html/imports/LinkImport.cpp
+++ b/third_party/WebKit/Source/core/html/imports/LinkImport.cpp
@@ -30,12 +30,15 @@
#include "core/html/imports/LinkImport.h"
+#include "core/HTMLNames.h"
#include "core/dom/Document.h"
+#include "core/fetch/FetchRequest.h"
#include "core/html/HTMLLinkElement.h"
#include "core/html/imports/HTMLImportChild.h"
#include "core/html/imports/HTMLImportLoader.h"
#include "core/html/imports/HTMLImportTreeRoot.h"
#include "core/html/imports/HTMLImportsController.h"
+#include "platform/weborigin/KURL.h"
namespace blink {
@@ -61,27 +64,25 @@ void LinkImport::process() {
return;
if (!m_owner)
return;
- if (!shouldLoadResource())
- return;
if (!m_owner->document().importsController()) {
+ if (!m_owner->document().frame())
+ return;
+
// The document should be the master.
Document& master = m_owner->document();
DCHECK(master.frame());
master.createImportsController();
}
- LinkRequestBuilder builder(m_owner);
- if (!builder.isValid()) {
+ const KURL& url = m_owner->getNonEmptyURLAttribute(HTMLNames::hrefAttr);
+ if (url.isEmpty() || !url.isValid()) {
didFinish();
return;
}
HTMLImportsController* controller = m_owner->document().importsController();
- HTMLImportLoader* loader = m_owner->document().importLoader();
- HTMLImport* parent = loader ? static_cast<HTMLImport*>(loader->firstImport())
- : static_cast<HTMLImport*>(controller->root());
- m_child = controller->load(parent, this, builder.build(false));
+ m_child = controller->load(this, m_owner->createFetchRequest());
if (!m_child) {
didFinish();
return;
« no previous file with comments | « third_party/WebKit/Source/core/html/imports/HTMLImportsController.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698