| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 if (settings && settings->dnsPrefetchingEnabled() && href.isValid() && !
href.isEmpty()) { | 124 if (settings && settings->dnsPrefetchingEnabled() && href.isValid() && !
href.isEmpty()) { |
| 125 if (settings->logDnsPrefetchAndPreconnect()) | 125 if (settings->logDnsPrefetchAndPreconnect()) |
| 126 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSo
urce, DebugMessageLevel, String("DNS prefetch triggered for " + href.host()))); | 126 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSo
urce, DebugMessageLevel, String("DNS prefetch triggered for " + href.host()))); |
| 127 prefetchDNS(href.host()); | 127 prefetchDNS(href.host()); |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 } | 130 } |
| 131 | 131 |
| 132 static void preconnectIfNeeded(const LinkRelAttribute& relAttribute, const KURL&
href, Document& document, const CrossOriginAttributeValue crossOrigin) | 132 static void preconnectIfNeeded(const LinkRelAttribute& relAttribute, const KURL&
href, Document& document, const CrossOriginAttributeValue crossOrigin) |
| 133 { | 133 { |
| 134 if (relAttribute.isPreconnect() && href.isValid()) { | 134 if (relAttribute.isPreconnect() && href.isValid() && href.protocolIsInHTTPFa
mily()) { |
| 135 ASSERT(RuntimeEnabledFeatures::linkPreconnectEnabled()); | 135 ASSERT(RuntimeEnabledFeatures::linkPreconnectEnabled()); |
| 136 Settings* settings = document.settings(); | 136 Settings* settings = document.settings(); |
| 137 if (settings && settings->logDnsPrefetchAndPreconnect()) { | 137 if (settings && settings->logDnsPrefetchAndPreconnect()) { |
| 138 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource
, DebugMessageLevel, String("Preconnect triggered for " + href.host()))); | 138 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSource
, DebugMessageLevel, String("Preconnect triggered for " + href.host()))); |
| 139 if (crossOrigin != CrossOriginAttributeNotSet) { | 139 if (crossOrigin != CrossOriginAttributeNotSet) { |
| 140 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSo
urce, DebugMessageLevel, | 140 document.addConsoleMessage(ConsoleMessage::create(OtherMessageSo
urce, DebugMessageLevel, |
| 141 String("Preconnect CORS setting is ") + String((crossOrigin
== CrossOriginAttributeAnonymous) ? "anonymous" : "use-credentials"))); | 141 String("Preconnect CORS setting is ") + String((crossOrigin
== CrossOriginAttributeAnonymous) ? "anonymous" : "use-credentials"))); |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 preconnect(href, crossOrigin); | 144 preconnect(href, crossOrigin); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 m_prerender.clear(); | 254 m_prerender.clear(); |
| 255 } | 255 } |
| 256 } | 256 } |
| 257 | 257 |
| 258 DEFINE_TRACE(LinkLoader) | 258 DEFINE_TRACE(LinkLoader) |
| 259 { | 259 { |
| 260 visitor->trace(m_prerender); | 260 visitor->trace(m_prerender); |
| 261 } | 261 } |
| 262 | 262 |
| 263 } | 263 } |
| OLD | NEW |