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

Unified Diff: third_party/WebKit/Source/platform/network/NetworkHints.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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/network/NetworkHints.cpp
diff --git a/third_party/WebKit/Source/platform/network/NetworkHints.cpp b/third_party/WebKit/Source/platform/network/NetworkHints.cpp
index c2c99f7c232bf9945552c288d0cd6cb31acfedc8..088d0c7b46baedb9cd301727afa3f95a08f768a7 100644
--- a/third_party/WebKit/Source/platform/network/NetworkHints.cpp
+++ b/third_party/WebKit/Source/platform/network/NetworkHints.cpp
@@ -26,23 +26,27 @@
#include "platform/network/NetworkHints.h"
+#include "platform/PlatformMojoServices.h"
#include "public/platform/Platform.h"
#include "public/platform/WebPrescientNetworking.h"
namespace blink {
-void prefetchDNS(const String& hostname)
+void speculativePrefetchDNS(const String& hostname)
{
if (WebPrescientNetworking* prescientNetworking = Platform::current()->prescientNetworking())
prescientNetworking->prefetchDNS(hostname);
}
+void prefetchDNS(const KURL& url)
+{
+ Platform::current()->mojoServices()->resourceHintsHandler()->Preresolve(url);
+}
+
void preconnect(const KURL& url, const CrossOriginAttributeValue crossOrigin)
{
- if (WebPrescientNetworking* prescientNetworking = Platform::current()->prescientNetworking()) {
- bool allowCredentials = (crossOrigin != CrossOriginAttributeAnonymous);
- prescientNetworking->preconnect(url, allowCredentials);
- }
+ bool allowCredentials = (crossOrigin != CrossOriginAttributeAnonymous);
+ Platform::current()->mojoServices()->resourceHintsHandler()->Preconnect(url, allowCredentials, 1);
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698