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

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: Use decoded text for scanning. Created 6 years, 4 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 15 matching lines...) Expand all
26 26
27 #include "core/css/CSSStyleSheet.h" 27 #include "core/css/CSSStyleSheet.h"
28 #include "core/dom/DOMSettableTokenList.h" 28 #include "core/dom/DOMSettableTokenList.h"
29 #include "core/dom/IconURL.h" 29 #include "core/dom/IconURL.h"
30 #include "core/fetch/ResourceOwner.h" 30 #include "core/fetch/ResourceOwner.h"
31 #include "core/fetch/StyleSheetResource.h" 31 #include "core/fetch/StyleSheetResource.h"
32 #include "core/fetch/StyleSheetResourceClient.h" 32 #include "core/fetch/StyleSheetResourceClient.h"
33 #include "core/html/HTMLElement.h" 33 #include "core/html/HTMLElement.h"
34 #include "core/html/LinkRelAttribute.h" 34 #include "core/html/LinkRelAttribute.h"
35 #include "core/html/LinkResource.h" 35 #include "core/html/LinkResource.h"
36 #include "core/html/parser/CSSPreloadScanner.h"
36 #include "core/loader/LinkLoader.h" 37 #include "core/loader/LinkLoader.h"
37 #include "core/loader/LinkLoaderClient.h" 38 #include "core/loader/LinkLoaderClient.h"
39 #include "platform/text/SegmentedString.h"
38 40
39 namespace blink { 41 namespace blink {
40 42
41 class DocumentFragment; 43 class DocumentFragment;
42 class HTMLLinkElement; 44 class HTMLLinkElement;
43 class KURL; 45 class KURL;
44 class LinkImport; 46 class LinkImport;
45 47
46 template<typename T> class EventSender; 48 template<typename T> class EventSender;
47 typedef EventSender<HTMLLinkElement> LinkEventSender; 49 typedef EventSender<HTMLLinkElement> LinkEventSender;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 bool hasSheet() const { return m_sheet; } 82 bool hasSheet() const { return m_sheet; }
81 bool isDisabled() const { return m_disabledState == Disabled; } 83 bool isDisabled() const { return m_disabledState == Disabled; }
82 bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript ; } 84 bool isEnabledViaScript() const { return m_disabledState == EnabledViaScript ; }
83 bool isUnset() const { return m_disabledState == Unset; } 85 bool isUnset() const { return m_disabledState == Unset; }
84 86
85 CSSStyleSheet* sheet() const { return m_sheet.get(); } 87 CSSStyleSheet* sheet() const { return m_sheet.get(); }
86 88
87 private: 89 private:
88 // From StyleSheetResourceClient 90 // From StyleSheetResourceClient
89 virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CSSStyleSheetResource*) OVERRIDE; 91 virtual void setCSSStyleSheet(const String& href, const KURL& baseURL, const String& charset, const CSSStyleSheetResource*) OVERRIDE;
92 virtual void dataReceived(const CSSStyleSheetResource* cachedStyleSheet) OVE RRIDE;
90 93
91 enum DisabledState { 94 enum DisabledState {
92 Unset, 95 Unset,
93 EnabledViaScript, 96 EnabledViaScript,
94 Disabled 97 Disabled
95 }; 98 };
96 99
97 enum PendingSheetType { 100 enum PendingSheetType {
98 None, 101 None,
99 NonBlocking, 102 NonBlocking,
100 Blocking 103 Blocking
101 }; 104 };
102 105
103 void clearSheet(); 106 void clearSheet();
104 void addPendingSheet(PendingSheetType); 107 void addPendingSheet(PendingSheetType);
105 void removePendingSheet(); 108 void removePendingSheet();
106 Document& document(); 109 Document& document();
107 110
108 RefPtrWillBeMember<CSSStyleSheet> m_sheet; 111 RefPtrWillBeMember<CSSStyleSheet> m_sheet;
112 OwnPtr<CSSPreloadScanner> m_preloadScanner;
113 OwnPtr<SegmentedString> m_preloadInput;
114 unsigned m_preloadLength;
109 DisabledState m_disabledState; 115 DisabledState m_disabledState;
110 PendingSheetType m_pendingSheetType; 116 PendingSheetType m_pendingSheetType;
111 bool m_loading; 117 bool m_loading;
112 bool m_firedLoad; 118 bool m_firedLoad;
113 bool m_loadedSheet; 119 bool m_loadedSheet;
114 }; 120 };
115 121
116 122
117 class HTMLLinkElement FINAL : public HTMLElement, public LinkLoaderClient { 123 class HTMLLinkElement FINAL : public HTMLElement, public LinkLoaderClient {
118 public: 124 public:
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 Vector<IntSize> m_iconSizes; 214 Vector<IntSize> m_iconSizes;
209 LinkRelAttribute m_relAttribute; 215 LinkRelAttribute m_relAttribute;
210 216
211 bool m_createdByParser; 217 bool m_createdByParser;
212 bool m_isInShadowTree; 218 bool m_isInShadowTree;
213 }; 219 };
214 220
215 } //namespace 221 } //namespace
216 222
217 #endif 223 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698