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
) {}
15 HostResolverWrapper
* HostResolverWrapper::GetInstance() {
16 return 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