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

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

Issue 656723005: Use C++11 features in core/html (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: mike's comments Created 6 years, 1 month 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/HTMLLegendElement.cpp ('k') | Source/core/html/HTMLMapElement.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 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 5 * Copyright (C) 2003, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com) 6 * Copyright (C) 2009 Rob Buis (rwlbuis@gmail.com)
7 * Copyright (C) 2011 Google Inc. All rights reserved. 7 * Copyright (C) 2011 Google Inc. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 bool HTMLLinkElement::loadLink(const String& type, const KURL& url) 198 bool HTMLLinkElement::loadLink(const String& type, const KURL& url)
199 { 199 {
200 return m_linkLoader.loadLink(m_relAttribute, fastGetAttribute(HTMLNames::cro ssoriginAttr), type, url, document()); 200 return m_linkLoader.loadLink(m_relAttribute, fastGetAttribute(HTMLNames::cro ssoriginAttr), type, url, document());
201 } 201 }
202 202
203 LinkResource* HTMLLinkElement::linkResourceToProcess() 203 LinkResource* HTMLLinkElement::linkResourceToProcess()
204 { 204 {
205 bool visible = inDocument() && !m_isInShadowTree; 205 bool visible = inDocument() && !m_isInShadowTree;
206 if (!visible) { 206 if (!visible) {
207 ASSERT(!linkStyle() || !linkStyle()->hasSheet()); 207 ASSERT(!linkStyle() || !linkStyle()->hasSheet());
208 return 0; 208 return nullptr;
209 } 209 }
210 210
211 if (!m_link) { 211 if (!m_link) {
212 if (m_relAttribute.isImport()) { 212 if (m_relAttribute.isImport()) {
213 m_link = LinkImport::create(this); 213 m_link = LinkImport::create(this);
214 } else if (m_relAttribute.isManifest()) { 214 } else if (m_relAttribute.isManifest()) {
215 m_link = LinkManifest::create(this); 215 m_link = LinkManifest::create(this);
216 } else { 216 } else {
217 OwnPtrWillBeRawPtr<LinkStyle> link = LinkStyle::create(this); 217 OwnPtrWillBeRawPtr<LinkStyle> link = LinkStyle::create(this);
218 if (fastHasAttribute(disabledAttr) || m_relAttribute.isTransitionExi tingStylesheet()) 218 if (fastHasAttribute(disabledAttr) || m_relAttribute.isTransitionExi tingStylesheet())
219 link->setDisabledState(true); 219 link->setDisabledState(true);
220 m_link = link.release(); 220 m_link = link.release();
221 } 221 }
222 } 222 }
223 223
224 return m_link.get(); 224 return m_link.get();
225 } 225 }
226 226
227 LinkStyle* HTMLLinkElement::linkStyle() const 227 LinkStyle* HTMLLinkElement::linkStyle() const
228 { 228 {
229 if (!m_link || m_link->type() != LinkResource::Style) 229 if (!m_link || m_link->type() != LinkResource::Style)
230 return 0; 230 return nullptr;
231 return static_cast<LinkStyle*>(m_link.get()); 231 return static_cast<LinkStyle*>(m_link.get());
232 } 232 }
233 233
234 LinkImport* HTMLLinkElement::linkImport() const 234 LinkImport* HTMLLinkElement::linkImport() const
235 { 235 {
236 if (!m_link || m_link->type() != LinkResource::Import) 236 if (!m_link || m_link->type() != LinkResource::Import)
237 return 0; 237 return nullptr;
238 return static_cast<LinkImport*>(m_link.get()); 238 return static_cast<LinkImport*>(m_link.get());
239 } 239 }
240 240
241 Document* HTMLLinkElement::import() const 241 Document* HTMLLinkElement::import() const
242 { 242 {
243 if (LinkImport* link = linkImport()) 243 if (LinkImport* link = linkImport())
244 return link->importedDocument(); 244 return link->importedDocument();
245 return 0; 245 return nullptr;
246 } 246 }
247 247
248 void HTMLLinkElement::process() 248 void HTMLLinkElement::process()
249 { 249 {
250 if (LinkResource* link = linkResourceToProcess()) 250 if (LinkResource* link = linkResourceToProcess())
251 link->process(); 251 link->process();
252 } 252 }
253 253
254 void HTMLLinkElement::enableIfExitTransitionStyle() 254 void HTMLLinkElement::enableIfExitTransitionStyle()
255 { 255 {
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
749 removePendingSheet(); 749 removePendingSheet();
750 } 750 }
751 751
752 void LinkStyle::trace(Visitor* visitor) 752 void LinkStyle::trace(Visitor* visitor)
753 { 753 {
754 visitor->trace(m_sheet); 754 visitor->trace(m_sheet);
755 LinkResource::trace(visitor); 755 LinkResource::trace(visitor);
756 } 756 }
757 757
758 } // namespace blink 758 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/html/HTMLLegendElement.cpp ('k') | Source/core/html/HTMLMapElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698