OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |