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

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

Issue 2043753002: Declarative resource hints go through mojo IPC to //content Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/loader/LinkLoader.h" 5 #include "core/loader/LinkLoader.h"
6 6
7 #include "core/fetch/MemoryCache.h" 7 #include "core/fetch/MemoryCache.h"
8 #include "core/fetch/ResourceFetcher.h" 8 #include "core/fetch/ResourceFetcher.h"
9 #include "core/frame/Settings.h" 9 #include "core/frame/Settings.h"
10 #include "core/html/LinkRelAttribute.h" 10 #include "core/html/LinkRelAttribute.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 }; 53 };
54 54
55 class NetworkHintsMock : public NetworkHintsInterface { 55 class NetworkHintsMock : public NetworkHintsInterface {
56 public: 56 public:
57 NetworkHintsMock() 57 NetworkHintsMock()
58 : m_didDnsPrefetch(false) 58 : m_didDnsPrefetch(false)
59 , m_didPreconnect(false) 59 , m_didPreconnect(false)
60 { 60 {
61 } 61 }
62 62
63 void dnsPrefetchHost(const String& host) const override 63 void dnsPrefetchHost(const KURL& host) const override
64 { 64 {
65 m_didDnsPrefetch = true; 65 m_didDnsPrefetch = true;
66 } 66 }
67 67
68 void preconnectHost(const KURL& host, const CrossOriginAttributeValue crossO rigin) const override 68 void preconnectHost(const KURL& host, const CrossOriginAttributeValue crossO rigin) const override
69 { 69 {
70 m_didPreconnect = true; 70 m_didPreconnect = true;
71 m_isHTTPS = host.protocolIs("https"); 71 m_isHTTPS = host.protocolIs("https");
72 m_isCrossOrigin = (crossOrigin == CrossOriginAttributeAnonymous); 72 m_isCrossOrigin = (crossOrigin == CrossOriginAttributeAnonymous);
73 } 73 }
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 hrefURL, 240 hrefURL,
241 dummyPageHolder->document(), 241 dummyPageHolder->document(),
242 networkHints); 242 networkHints);
243 ASSERT_EQ(testCase.shouldLoad, networkHints.didPreconnect()); 243 ASSERT_EQ(testCase.shouldLoad, networkHints.didPreconnect());
244 ASSERT_EQ(testCase.isHTTPS, networkHints.isHTTPS()); 244 ASSERT_EQ(testCase.isHTTPS, networkHints.isHTTPS());
245 ASSERT_EQ(testCase.isCrossOrigin, networkHints.isCrossOrigin()); 245 ASSERT_EQ(testCase.isCrossOrigin, networkHints.isCrossOrigin());
246 } 246 }
247 } 247 }
248 248
249 } // namespace blink 249 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698