190dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
290dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
390dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)// found in the LICENSE file.
490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)#include "chrome/renderer/net/prescient_networking_dispatcher.h"
690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
7868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)#include "base/strings/utf_string_conversions.h"
890dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
9f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)using blink::WebPrescientNetworking;
1090dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
11868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)PrescientNetworkingDispatcher::PrescientNetworkingDispatcher() {
12868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
13868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
1490dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)PrescientNetworkingDispatcher::~PrescientNetworkingDispatcher() {
1590dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)}
1690dce4d38c5ff5333bea97d859d4e484e27edf0cTorne (Richard Coles)
17868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)void PrescientNetworkingDispatcher::prefetchDNS(
18f2477e01787aa58f445919b809d89e252beef54fTorne (Richard Coles)    const blink::WebString& hostname) {
19868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  if (hostname.isEmpty())
20868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)    return;
21868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)
225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)  std::string hostname_utf8 = base::UTF16ToUTF8(hostname);
23868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)  net_predictor_.Resolve(hostname_utf8.data(), hostname_utf8.length());
24868fa2fe829687343ffae624259930155e16dbd8Torne (Richard Coles)}
25