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

Unified Diff: chrome/renderer/net/prescient_networking_dispatcher.cc

Issue 15963006: Implement WebPrescientNetworking::prefetchDNS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: prefetchHostName -> prefetchDNS Created 7 years, 7 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
« no previous file with comments | « chrome/renderer/net/prescient_networking_dispatcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/net/prescient_networking_dispatcher.cc
diff --git a/chrome/renderer/net/prescient_networking_dispatcher.cc b/chrome/renderer/net/prescient_networking_dispatcher.cc
index e97c167e39d2301a6e52c016912eda82c3b9a9d2..446fe0af73c14ed23300fb3587d8f02a0770d314 100644
--- a/chrome/renderer/net/prescient_networking_dispatcher.cc
+++ b/chrome/renderer/net/prescient_networking_dispatcher.cc
@@ -4,7 +4,9 @@
#include "chrome/renderer/net/prescient_networking_dispatcher.h"
+#include "base/strings/utf_string_conversions.h"
#include "chrome/common/render_messages.h"
+#include "content/public/common/content_client.h"
Nico 2013/05/30 00:44:57 What do you need this for?
kouhei (in TOK) 2013/05/30 00:54:08 We don't need this. Thank you for pointing this o
#include "content/public/renderer/render_thread.h"
using WebKit::WebPrescientNetworking;
@@ -12,6 +14,16 @@ using WebKit::WebPrescientNetworking;
PrescientNetworkingDispatcher::~PrescientNetworkingDispatcher() {
}
+void PrescientNetworkingDispatcher::prefetchDNS(
+ const WebKit::WebString& hostname) {
+ if (hostname.isEmpty())
+ return;
+
+ std::string hostname_utf8;
+ UTF16ToUTF8(hostname.data(), hostname.length(), &hostname_utf8);
+ net_predictor_.Resolve(hostname_utf8.data(), hostname_utf8.length());
+}
+
void PrescientNetworkingDispatcher::preconnect(
const WebKit::WebURL& url,
WebKit::WebPreconnectMotivation motivation) {
« no previous file with comments | « chrome/renderer/net/prescient_networking_dispatcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698