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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLAnchorElement.cpp

Issue 2043753002: Declarative resource hints go through mojo IPC to //content Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use unique_ptr to avoid memory leaks in unit tests Created 4 years, 6 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 * (C) 2000 Simon Hausmann <hausmann@kde.org> 4 * (C) 2000 Simon Hausmann <hausmann@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 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 17 matching lines...) Expand all
28 #include "core/frame/FrameHost.h" 28 #include "core/frame/FrameHost.h"
29 #include "core/frame/Settings.h" 29 #include "core/frame/Settings.h"
30 #include "core/frame/UseCounter.h" 30 #include "core/frame/UseCounter.h"
31 #include "core/html/HTMLImageElement.h" 31 #include "core/html/HTMLImageElement.h"
32 #include "core/html/parser/HTMLParserIdioms.h" 32 #include "core/html/parser/HTMLParserIdioms.h"
33 #include "core/layout/LayoutBox.h" 33 #include "core/layout/LayoutBox.h"
34 #include "core/loader/FrameLoadRequest.h" 34 #include "core/loader/FrameLoadRequest.h"
35 #include "core/loader/FrameLoaderClient.h" 35 #include "core/loader/FrameLoaderClient.h"
36 #include "core/loader/PingLoader.h" 36 #include "core/loader/PingLoader.h"
37 #include "core/page/ChromeClient.h" 37 #include "core/page/ChromeClient.h"
38 #include "platform/network/NetworkHints.h"
39 #include "platform/weborigin/SecurityPolicy.h" 38 #include "platform/weborigin/SecurityPolicy.h"
39 #include "public/platform/Platform.h"
40 40
41 namespace blink { 41 namespace blink {
42 42
43 using namespace HTMLNames; 43 using namespace HTMLNames;
44 44
45 HTMLAnchorElement::HTMLAnchorElement(const QualifiedName& tagName, Document& doc ument) 45 HTMLAnchorElement::HTMLAnchorElement(const QualifiedName& tagName, Document& doc ument)
46 : HTMLElement(tagName, document) 46 : HTMLElement(tagName, document)
47 , m_linkRelations(0) 47 , m_linkRelations(0)
48 , m_cachedVisitedLinkHash(0) 48 , m_cachedVisitedLinkHash(0)
49 , m_wasFocusedByMouse(false) 49 , m_wasFocusedByMouse(false)
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 191 }
192 if (wasLink && !isLink() && adjustedFocusedElementInTreeScope() == this) { 192 if (wasLink && !isLink() && adjustedFocusedElementInTreeScope() == this) {
193 // We might want to call blur(), but it's dangerous to dispatch 193 // We might want to call blur(), but it's dangerous to dispatch
194 // events here. 194 // events here.
195 document().setNeedsFocusedElementCheck(); 195 document().setNeedsFocusedElementCheck();
196 } 196 }
197 if (isLink()) { 197 if (isLink()) {
198 String parsedURL = stripLeadingAndTrailingHTMLSpaces(value); 198 String parsedURL = stripLeadingAndTrailingHTMLSpaces(value);
199 if (document().isDNSPrefetchEnabled()) { 199 if (document().isDNSPrefetchEnabled()) {
200 if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "http s") || parsedURL.startsWith("//")) 200 if (protocolIs(parsedURL, "http") || protocolIs(parsedURL, "http s") || parsedURL.startsWith("//"))
201 prefetchDNS(document().completeURL(parsedURL).host()); 201 Platform::current()->speculativePreresolve(document().comple teURL(parsedURL));
202 } 202 }
203 } 203 }
204 invalidateCachedVisitedLinkHash(); 204 invalidateCachedVisitedLinkHash();
205 logUpdateAttributeIfIsolatedWorldAndInDocument("a", hrefAttr, oldValue, value); 205 logUpdateAttributeIfIsolatedWorldAndInDocument("a", hrefAttr, oldValue, value);
206 } else if (name == nameAttr || name == titleAttr) { 206 } else if (name == nameAttr || name == titleAttr) {
207 // Do nothing. 207 // Do nothing.
208 } else if (name == relAttr) { 208 } else if (name == relAttr) {
209 setRel(value); 209 setRel(value);
210 } else { 210 } else {
211 HTMLElement::parseAttribute(name, oldValue, value); 211 HTMLElement::parseAttribute(name, oldValue, value);
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 } 390 }
391 391
392 Node::InsertionNotificationRequest HTMLAnchorElement::insertedInto(ContainerNode * insertionPoint) 392 Node::InsertionNotificationRequest HTMLAnchorElement::insertedInto(ContainerNode * insertionPoint)
393 { 393 {
394 InsertionNotificationRequest request = HTMLElement::insertedInto(insertionPo int); 394 InsertionNotificationRequest request = HTMLElement::insertedInto(insertionPo int);
395 logAddElementIfIsolatedWorldAndInDocument("a", hrefAttr); 395 logAddElementIfIsolatedWorldAndInDocument("a", hrefAttr);
396 return request; 396 return request;
397 } 397 }
398 398
399 } // namespace blink 399 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698