Roll src/third_party/WebKit a3b4a2e:7441784 (svn 202551:202552)
[chromium-blink-merge.git] / extensions / browser / api / dns / host_resolver_wrapper.cc
blob1b3e6a354146c4e7cf3af84e8e69a2b155972a7c
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "extensions/browser/api/dns/host_resolver_wrapper.h"
7 #include "content/public/browser/resource_context.h"
8 #include "net/dns/host_resolver.h"
10 namespace extensions {
12 HostResolverWrapper::HostResolverWrapper() : resolver_(NULL) {}
14 // static
15 HostResolverWrapper* HostResolverWrapper::GetInstance() {
16 return base::Singleton<extensions::HostResolverWrapper>::get();
19 net::HostResolver* HostResolverWrapper::GetHostResolver(
20 content::ResourceContext* context) {
21 return resolver_ ? resolver_ : context->GetHostResolver();
24 void HostResolverWrapper::SetHostResolverForTesting(
25 net::HostResolver* mock_resolver) {
26 resolver_ = mock_resolver;
29 } // namespace extensions