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

Side by Side Diff: third_party/WebKit/Source/core/loader/LinkLoader.cpp

Issue 2043753002: Declarative resource hints go through mojo IPC to //content Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove gmocking + add another browser test 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 if (relAttribute.isDNSPrefetch()) { 141 if (relAttribute.isDNSPrefetch()) {
142 UseCounter::count(document, UseCounter::LinkRelDnsPrefetch); 142 UseCounter::count(document, UseCounter::LinkRelDnsPrefetch);
143 if (caller == LinkCalledFromHeader) 143 if (caller == LinkCalledFromHeader)
144 UseCounter::count(document, UseCounter::LinkHeaderDnsPrefetch); 144 UseCounter::count(document, UseCounter::LinkHeaderDnsPrefetch);
145 Settings* settings = document.settings(); 145 Settings* settings = document.settings();
146 // FIXME: The href attribute of the link element can be in "//hostname" form, and we shouldn't attempt 146 // FIXME: The href attribute of the link element can be in "//hostname" form, and we shouldn't attempt
147 // to complete that as URL <https://bugs.webkit.org/show_bug.cgi?id=4885 7>. 147 // to complete that as URL <https://bugs.webkit.org/show_bug.cgi?id=4885 7>.
148 if (settings && settings->dnsPrefetchingEnabled() && href.isValid() && ! href.isEmpty()) { 148 if (settings && settings->dnsPrefetchingEnabled() && href.isValid() && ! href.isEmpty()) {
149 if (settings->logDnsPrefetchAndPreconnect()) 149 if (settings->logDnsPrefetchAndPreconnect())
150 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSo urce, DebugMessageLevel, String("DNS prefetch triggered for " + href.host()))); 150 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSo urce, DebugMessageLevel, String("DNS prefetch triggered for " + href.host())));
151 networkHintsInterface.dnsPrefetchHost(href.host()); 151 networkHintsInterface.dnsPrefetchHost(href);
152 } 152 }
153 } 153 }
154 } 154 }
155 155
156 static void preconnectIfNeeded(const LinkRelAttribute& relAttribute, const KURL& href, Document& document, const CrossOriginAttributeValue crossOrigin, const Ne tworkHintsInterface& networkHintsInterface, LinkCaller caller) 156 static void preconnectIfNeeded(const LinkRelAttribute& relAttribute, const KURL& href, Document& document, const CrossOriginAttributeValue crossOrigin, const Ne tworkHintsInterface& networkHintsInterface, LinkCaller caller)
157 { 157 {
158 if (relAttribute.isPreconnect() && href.isValid() && href.protocolIsInHTTPFa mily()) { 158 if (relAttribute.isPreconnect() && href.isValid() && href.protocolIsInHTTPFa mily()) {
159 UseCounter::count(document, UseCounter::LinkRelPreconnect); 159 UseCounter::count(document, UseCounter::LinkRelPreconnect);
160 if (caller == LinkCalledFromHeader) 160 if (caller == LinkCalledFromHeader)
161 UseCounter::count(document, UseCounter::LinkHeaderPreconnect); 161 UseCounter::count(document, UseCounter::LinkHeaderPreconnect);
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 DEFINE_TRACE(LinkLoader) 393 DEFINE_TRACE(LinkLoader)
394 { 394 {
395 visitor->trace(m_client); 395 visitor->trace(m_client);
396 visitor->trace(m_prerender); 396 visitor->trace(m_prerender);
397 visitor->trace(m_linkPreloadResourceClient); 397 visitor->trace(m_linkPreloadResourceClient);
398 ResourceOwner<Resource, ResourceClient>::trace(visitor); 398 ResourceOwner<Resource, ResourceClient>::trace(visitor);
399 PrerenderClient::trace(visitor); 399 PrerenderClient::trace(visitor);
400 } 400 }
401 401
402 } // namespace blink 402 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698