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

Unified Diff: Source/WebCore/html/parser/HTMLResourcePreloader.h

Issue 13945017: External Stylesheets preloaded according to their media attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 8 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
Index: Source/WebCore/html/parser/HTMLResourcePreloader.h
diff --git a/Source/WebCore/html/parser/HTMLResourcePreloader.h b/Source/WebCore/html/parser/HTMLResourcePreloader.h
index 22eaa3a0031c8cb47917207d18ef5fc399e27a62..b5232e7e5d3b3e586b0251118e6ef4de5549362a 100644
--- a/Source/WebCore/html/parser/HTMLResourcePreloader.h
+++ b/Source/WebCore/html/parser/HTMLResourcePreloader.h
@@ -33,9 +33,14 @@ namespace WebCore {
class PreloadRequest {
public:
+ static PassOwnPtr<PreloadRequest> create(const String& initiator, const String& resourceURL, const KURL& baseURL, CachedResource::Type resourceType, const String& mediaAttribute)
+ {
+ return adoptPtr(new PreloadRequest(initiator, resourceURL, baseURL, resourceType, mediaAttribute));
+ }
+
static PassOwnPtr<PreloadRequest> create(const String& initiator, const String& resourceURL, const KURL& baseURL, CachedResource::Type resourceType)
{
- return adoptPtr(new PreloadRequest(initiator, resourceURL, baseURL, resourceType));
+ return adoptPtr(new PreloadRequest(initiator, resourceURL, baseURL, resourceType, ""));
}
bool isSafeToSendToAnotherThread() const;
@@ -43,16 +48,18 @@ public:
CachedResourceRequest resourceRequest(Document*);
const String& charset() const { return m_charset; }
+ const String& media() const { return m_mediaAttribute; }
void setCharset(const String& charset) { m_charset = charset.isolatedCopy(); }
void setCrossOriginModeAllowsCookies(bool allowsCookies) { m_crossOriginModeAllowsCookies = allowsCookies; }
CachedResource::Type resourceType() const { return m_resourceType; }
private:
- PreloadRequest(const String& initiator, const String& resourceURL, const KURL& baseURL, CachedResource::Type resourceType)
+ PreloadRequest(const String& initiator, const String& resourceURL, const KURL& baseURL, CachedResource::Type resourceType, const String& mediaAttribute)
: m_initiator(initiator)
, m_resourceURL(resourceURL.isolatedCopy())
, m_baseURL(baseURL.copy())
, m_resourceType(resourceType)
+ , m_mediaAttribute(mediaAttribute.isolatedCopy())
, m_crossOriginModeAllowsCookies(false)
{
}
@@ -64,6 +71,7 @@ private:
KURL m_baseURL;
String m_charset;
CachedResource::Type m_resourceType;
+ String m_mediaAttribute;
bool m_crossOriginModeAllowsCookies;
};
« no previous file with comments | « Source/WebCore/html/parser/HTMLPreloadScanner.cpp ('k') | Source/WebCore/html/parser/HTMLResourcePreloader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698