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

Unified Diff: third_party/WebKit/Source/core/html/LinkResource.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/LinkResource.h ('k') | third_party/WebKit/Source/core/html/LinkStyle.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/html/LinkResource.cpp
diff --git a/third_party/WebKit/Source/core/html/LinkResource.cpp b/third_party/WebKit/Source/core/html/LinkResource.cpp
index 7b14b00a4432f33baed9ef0da7f09a04fe2a42c7..49c79e07e207c9d200f4c28dc04381036f28d607 100644
--- a/third_party/WebKit/Source/core/html/LinkResource.cpp
+++ b/third_party/WebKit/Source/core/html/LinkResource.cpp
@@ -30,50 +30,16 @@
#include "core/html/LinkResource.h"
-#include "core/HTMLNames.h"
-#include "core/dom/Document.h"
#include "core/html/HTMLLinkElement.h"
-#include "core/html/imports/HTMLImportsController.h"
namespace blink {
-using namespace HTMLNames;
-
LinkResource::LinkResource(HTMLLinkElement* owner) : m_owner(owner) {}
LinkResource::~LinkResource() {}
-bool LinkResource::shouldLoadResource() const {
- return m_owner->document().frame() || m_owner->document().importsController();
-}
-
-LocalFrame* LinkResource::loadingFrame() const {
- HTMLImportsController* importsController =
- m_owner->document().importsController();
- if (!importsController)
- return m_owner->document().frame();
- return importsController->master()->frame();
-}
-
DEFINE_TRACE(LinkResource) {
visitor->trace(m_owner);
}
-LinkRequestBuilder::LinkRequestBuilder(HTMLLinkElement* owner)
- : m_owner(owner), m_url(owner->getNonEmptyURLAttribute(hrefAttr)) {
- m_charset = m_owner->getAttribute(charsetAttr);
- if (m_charset.isEmpty() && m_owner->document().frame())
- m_charset = m_owner->document().characterSet();
-}
-
-FetchRequest LinkRequestBuilder::build(bool lowPriority) const {
- FetchRequest request(ResourceRequest(m_owner->document().completeURL(m_url)),
- m_owner->localName(), m_charset);
- if (lowPriority)
- request.setDefer(FetchRequest::LazyLoad);
- request.setContentSecurityPolicyNonce(
- m_owner->fastGetAttribute(HTMLNames::nonceAttr));
- return request;
-}
-
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/html/LinkResource.h ('k') | third_party/WebKit/Source/core/html/LinkStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698