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

Side by Side Diff: Source/core/html/HTMLLinkElement.h

Issue 166633002: Prefetch @import files from CSS files. Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Prefetching now handled just like for other resources. Created 6 years, 9 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2008, 2010 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2008, 2010 Apple Inc. All rights reserved.
5 * Copyright (C) 2011 Google Inc. All rights reserved. 5 * Copyright (C) 2011 Google Inc. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 bool hasSheet() const { return m_sheet; } 79 bool hasSheet() const { return m_sheet; }
80 bool isDisabled() const { return m_disabledState == Disabled; } 80 bool isDisabled() const { return m_disabledState == Disabled; }
81 bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript ; } 81 bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript ; }
82 bool isUnset() const { return m_disabledState == Unset; } 82 bool isUnset() const { return m_disabledState == Unset; }
83 83
84 CSSStyleSheet* sheet() const { return m_sheet.get(); } 84 CSSStyleSheet* sheet() const { return m_sheet.get(); }
85 85
86 private: 86 private:
87 // From StyleSheetResourceClient 87 // From StyleSheetResourceClient
88 virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CSSStyleSheetResource*) OVERRIDE; 88 virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CSSStyleSheetResource*) OVERRIDE;
89 virtual void dataReceived(const CSSStyleSheetResource* cachedStyleSheet, con st char* data, int length) OVERRIDE;
89 90
90 enum DisabledState { 91 enum DisabledState {
91 Unset, 92 Unset,
92 EnabledViaScript, 93 EnabledViaScript,
93 Disabled 94 Disabled
94 }; 95 };
95 96
96 enum PendingSheetType { 97 enum PendingSheetType {
97 None, 98 None,
98 NonBlocking, 99 NonBlocking,
99 Blocking 100 Blocking
100 }; 101 };
101 102
102 enum RemovePendingSheetNotificationType { 103 enum RemovePendingSheetNotificationType {
103 RemovePendingSheetNotifyImmediately, 104 RemovePendingSheetNotifyImmediately,
104 RemovePendingSheetNotifyLater 105 RemovePendingSheetNotifyLater
105 }; 106 };
106 107
107 void clearSheet(); 108 void clearSheet();
108 void addPendingSheet(PendingSheetType); 109 void addPendingSheet(PendingSheetType);
109 void removePendingSheet(RemovePendingSheetNotificationType = RemovePendingSh eetNotifyImmediately); 110 void removePendingSheet(RemovePendingSheetNotificationType = RemovePendingSh eetNotifyImmediately);
110 Document& document(); 111 Document& document();
111 112
112 RefPtr<CSSStyleSheet> m_sheet; 113 RefPtr<CSSStyleSheet> m_sheet;
113 DisabledState m_disabledState; 114 DisabledState m_disabledState;
114 PendingSheetType m_pendingSheetType; 115 PendingSheetType m_pendingSheetType;
115 bool m_loading; 116 bool m_loading;
116 bool m_firedLoad; 117 bool m_firedLoad;
117 bool m_loadedSheet; 118 bool m_loadedSheet;
119 bool m_isPreloadScanning;
118 }; 120 };
119 121
120 122
121 class HTMLLinkElement FINAL : public HTMLElement, public LinkLoaderClient { 123 class HTMLLinkElement FINAL : public HTMLElement, public LinkLoaderClient {
122 public: 124 public:
123 static PassRefPtr<HTMLLinkElement> create(Document&, bool createdByParser); 125 static PassRefPtr<HTMLLinkElement> create(Document&, bool createdByParser);
124 virtual ~HTMLLinkElement(); 126 virtual ~HTMLLinkElement();
125 127
126 KURL href() const; 128 KURL href() const;
127 const AtomicString& rel() const; 129 const AtomicString& rel() const;
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 LinkRelAttribute m_relAttribute; 202 LinkRelAttribute m_relAttribute;
201 203
202 bool m_createdByParser; 204 bool m_createdByParser;
203 bool m_isInShadowTree; 205 bool m_isInShadowTree;
204 int m_beforeLoadRecurseCount; 206 int m_beforeLoadRecurseCount;
205 }; 207 };
206 208
207 } //namespace 209 } //namespace
208 210
209 #endif 211 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698