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

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

Issue 1060863003: Add initial link preload support (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix uninit member :/ Created 5 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 unified diff | Download patch
« no previous file with comments | « Source/core/html/HTMLAttributeNames.in ('k') | Source/core/html/HTMLLinkElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 class HTMLLinkElement final : public HTMLElement, public LinkLoaderClient { 124 class HTMLLinkElement final : public HTMLElement, public LinkLoaderClient {
125 DEFINE_WRAPPERTYPEINFO(); 125 DEFINE_WRAPPERTYPEINFO();
126 public: 126 public:
127 static PassRefPtrWillBeRawPtr<HTMLLinkElement> create(Document&, bool create dByParser); 127 static PassRefPtrWillBeRawPtr<HTMLLinkElement> create(Document&, bool create dByParser);
128 virtual ~HTMLLinkElement(); 128 virtual ~HTMLLinkElement();
129 129
130 KURL href() const; 130 KURL href() const;
131 const AtomicString& rel() const; 131 const AtomicString& rel() const;
132 String media() const { return m_media; } 132 String media() const { return m_media; }
133 String typeValue() const { return m_type; } 133 String typeValue() const { return m_type; }
134 String asValue() const { return m_as; }
134 const LinkRelAttribute& relAttribute() const { return m_relAttribute; } 135 const LinkRelAttribute& relAttribute() const { return m_relAttribute; }
135 136
136 const AtomicString& type() const; 137 const AtomicString& type() const;
137 138
138 IconType iconType() const; 139 IconType iconType() const;
139 140
140 // the icon sizes as parsed from the HTML attribute 141 // the icon sizes as parsed from the HTML attribute
141 const Vector<IntSize>& iconSizes() const; 142 const Vector<IntSize>& iconSizes() const;
142 143
143 bool async() const; 144 bool async() const;
(...skipping 12 matching lines...) Expand all
156 157
157 void dispatchPendingEvent(LinkEventSender*); 158 void dispatchPendingEvent(LinkEventSender*);
158 void scheduleEvent(); 159 void scheduleEvent();
159 void dispatchEventImmediately(); 160 void dispatchEventImmediately();
160 static void dispatchPendingLoadEvents(); 161 static void dispatchPendingLoadEvents();
161 162
162 // From LinkLoaderClient 163 // From LinkLoaderClient
163 virtual bool shouldLoadLink() override; 164 virtual bool shouldLoadLink() override;
164 165
165 // For LinkStyle 166 // For LinkStyle
166 bool loadLink(const String& type, const KURL&); 167 bool loadLink(const String& type, const String& as, const KURL&);
167 bool isAlternate() const { return linkStyle()->isUnset() && m_relAttribute.i sAlternate(); } 168 bool isAlternate() const { return linkStyle()->isUnset() && m_relAttribute.i sAlternate(); }
168 bool shouldProcessStyle() { return linkResourceToProcess() && linkStyle(); } 169 bool shouldProcessStyle() { return linkResourceToProcess() && linkStyle(); }
169 bool isCreatedByParser() const { return m_createdByParser; } 170 bool isCreatedByParser() const { return m_createdByParser; }
170 171
171 // Parse the icon size attribute into |iconSizes|, make this method public 172 // Parse the icon size attribute into |iconSizes|, make this method public
172 // visible for testing purpose. 173 // visible for testing purpose.
173 static void parseSizesAttribute(const AtomicString& value, Vector<IntSize>& iconSizes); 174 static void parseSizesAttribute(const AtomicString& value, Vector<IntSize>& iconSizes);
174 175
175 DECLARE_VIRTUAL_TRACE(); 176 DECLARE_VIRTUAL_TRACE();
176 177
(...skipping 27 matching lines...) Expand all
204 virtual void didSendLoadForLinkPrerender() override; 205 virtual void didSendLoadForLinkPrerender() override;
205 virtual void didSendDOMContentLoadedForLinkPrerender() override; 206 virtual void didSendDOMContentLoadedForLinkPrerender() override;
206 207
207 private: 208 private:
208 HTMLLinkElement(Document&, bool createdByParser); 209 HTMLLinkElement(Document&, bool createdByParser);
209 210
210 OwnPtrWillBeMember<LinkResource> m_link; 211 OwnPtrWillBeMember<LinkResource> m_link;
211 LinkLoader m_linkLoader; 212 LinkLoader m_linkLoader;
212 213
213 String m_type; 214 String m_type;
215 String m_as;
214 String m_media; 216 String m_media;
215 RefPtrWillBeMember<DOMSettableTokenList> m_sizes; 217 RefPtrWillBeMember<DOMSettableTokenList> m_sizes;
216 Vector<IntSize> m_iconSizes; 218 Vector<IntSize> m_iconSizes;
217 LinkRelAttribute m_relAttribute; 219 LinkRelAttribute m_relAttribute;
218 220
219 bool m_createdByParser; 221 bool m_createdByParser;
220 bool m_isInShadowTree; 222 bool m_isInShadowTree;
221 }; 223 };
222 224
223 } // namespace blink 225 } // namespace blink
224 226
225 #endif // HTMLLinkElement_h 227 #endif // HTMLLinkElement_h
OLDNEW
« no previous file with comments | « Source/core/html/HTMLAttributeNames.in ('k') | Source/core/html/HTMLLinkElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698