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

Unified Diff: Source/core/html/LinkResource.cpp

Issue 15856002: First step of HTMLImports (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed Mac build Created 7 years, 7 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 | « Source/core/html/LinkResource.h ('k') | Source/core/html/parser/HTMLDocumentParser.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/LinkResource.cpp
diff --git a/Source/core/css/CSSFontFaceLoadEvent.cpp b/Source/core/html/LinkResource.cpp
similarity index 66%
copy from Source/core/css/CSSFontFaceLoadEvent.cpp
copy to Source/core/html/LinkResource.cpp
index 80ca0c9b0a27dd55d75448736ed30f092f0f5385..c81063f490a622baed10585b764a25ec4aefa616 100644
--- a/Source/core/css/CSSFontFaceLoadEvent.cpp
+++ b/Source/core/html/LinkResource.cpp
@@ -29,38 +29,37 @@
*/
#include "config.h"
-#include "core/css/CSSFontFaceLoadEvent.h"
+#include "core/html/LinkResource.h"
+
+#include "HTMLNames.h"
+#include "core/html/HTMLLinkElement.h"
namespace WebCore {
-CSSFontFaceLoadEvent::CSSFontFaceLoadEvent()
-{
- ScriptWrappable::init(this);
-}
+using namespace HTMLNames;
-CSSFontFaceLoadEvent::CSSFontFaceLoadEvent(const AtomicString& type, PassRefPtr<CSSFontFaceRule> fontface, PassRefPtr<DOMError> error)
- : Event(type, false, false)
- , m_fontface(fontface)
- , m_error(error)
+LinkResource::LinkResource(HTMLLinkElement* owner)
+ : m_owner(owner)
{
- ScriptWrappable::init(this);
}
-CSSFontFaceLoadEvent::CSSFontFaceLoadEvent(const AtomicString& type, const CSSFontFaceLoadEventInit& initializer)
- : Event(type, initializer)
- , m_fontface(initializer.fontface)
- , m_error(initializer.error)
+LinkResource::~LinkResource()
{
- ScriptWrappable::init(this);
}
-CSSFontFaceLoadEvent::~CSSFontFaceLoadEvent()
+LinkRequestBuilder::LinkRequestBuilder(HTMLLinkElement* owner)
+ : m_owner(owner)
+ , m_url(m_owner->getNonEmptyURLAttribute(hrefAttr))
{
+ m_charset = m_owner->getAttribute(charsetAttr);
+ if (m_charset.isEmpty() && m_owner->document()->frame())
+ m_charset = m_owner->document()->charset();
}
-const AtomicString& CSSFontFaceLoadEvent::interfaceName() const
+CachedResourceRequest LinkRequestBuilder::build(bool blocking) const
{
- return eventNames().interfaceForCSSFontFaceLoadEvent;
+ ResourceLoadPriority priority = blocking ? ResourceLoadPriorityUnresolved : ResourceLoadPriorityVeryLow;
+ return CachedResourceRequest(ResourceRequest(m_owner->document()->completeURL(m_url)), m_owner->localName(), m_charset, priority);
}
} // namespace WebCore
« no previous file with comments | « Source/core/html/LinkResource.h ('k') | Source/core/html/parser/HTMLDocumentParser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698