OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/renderer/net/prescient_networking_dispatcher.h" | 5 #include "chrome/renderer/net/prescient_networking_dispatcher.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | |
7 #include "chrome/common/render_messages.h" | 8 #include "chrome/common/render_messages.h" |
9 #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
| |
8 #include "content/public/renderer/render_thread.h" | 10 #include "content/public/renderer/render_thread.h" |
9 | 11 |
10 using WebKit::WebPrescientNetworking; | 12 using WebKit::WebPrescientNetworking; |
11 | 13 |
12 PrescientNetworkingDispatcher::~PrescientNetworkingDispatcher() { | 14 PrescientNetworkingDispatcher::~PrescientNetworkingDispatcher() { |
13 } | 15 } |
14 | 16 |
17 void PrescientNetworkingDispatcher::prefetchDNS( | |
18 const WebKit::WebString& hostname) { | |
19 if (hostname.isEmpty()) | |
20 return; | |
21 | |
22 std::string hostname_utf8; | |
23 UTF16ToUTF8(hostname.data(), hostname.length(), &hostname_utf8); | |
24 net_predictor_.Resolve(hostname_utf8.data(), hostname_utf8.length()); | |
25 } | |
26 | |
15 void PrescientNetworkingDispatcher::preconnect( | 27 void PrescientNetworkingDispatcher::preconnect( |
16 const WebKit::WebURL& url, | 28 const WebKit::WebURL& url, |
17 WebKit::WebPreconnectMotivation motivation) { | 29 WebKit::WebPreconnectMotivation motivation) { |
18 // FIXME(kouhei) actual pre-connecting is currently disabled. | 30 // FIXME(kouhei) actual pre-connecting is currently disabled. |
19 // This should shortly be enabled via Finch field trials in upcoming patch. | 31 // This should shortly be enabled via Finch field trials in upcoming patch. |
20 // content::RenderThread::Get()->Send(new ChromeViewHostMsg_Preconnect(url)); | 32 // content::RenderThread::Get()->Send(new ChromeViewHostMsg_Preconnect(url)); |
21 } | 33 } |
22 | 34 |
OLD | NEW |