Don't add an aura tooltip to bubble close buttons on Windows.
[chromium-blink-merge.git] / net / dns / host_resolver_mojo.h
blobbe3a4785ce2911acd809fc084fee9beac0c0c2fb
1 // Copyright 2015 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 #ifndef NET_DNS_HOST_RESOLVER_MOJO_H_
6 #define NET_DNS_HOST_RESOLVER_MOJO_H_
8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h"
10 #include "base/threading/thread_checker.h"
11 #include "net/dns/host_cache.h"
12 #include "net/dns/host_resolver.h"
13 #include "net/interfaces/host_resolver_service.mojom.h"
14 #include "third_party/mojo/src/mojo/public/cpp/bindings/error_handler.h"
16 namespace net {
17 class AddressList;
18 class BoundNetLog;
20 // A HostResolver implementation that delegates to an interfaces::HostResolver
21 // mojo interface.
22 class HostResolverMojo : public HostResolver, public mojo::ErrorHandler {
23 public:
24 HostResolverMojo(interfaces::HostResolverPtr resolver,
25 const base::Closure& disconnect_callback);
26 ~HostResolverMojo() override;
28 // HostResolver overrides.
29 int Resolve(const RequestInfo& info,
30 RequestPriority priority,
31 AddressList* addresses,
32 const CompletionCallback& callback,
33 RequestHandle* request_handle,
34 const BoundNetLog& source_net_log) override;
35 int ResolveFromCache(const RequestInfo& info,
36 AddressList* addresses,
37 const BoundNetLog& source_net_log) override;
38 void CancelRequest(RequestHandle req) override;
39 HostCache* GetHostCache() override;
41 private:
42 class Job;
44 // mojo::ErrorHandler override.
45 void OnConnectionError() override;
47 int ResolveFromCacheInternal(const RequestInfo& info,
48 const HostCache::Key& key,
49 AddressList* addresses);
51 interfaces::HostResolverPtr resolver_;
53 const base::Closure disconnect_callback_;
55 scoped_ptr<HostCache> host_cache_;
56 base::WeakPtrFactory<HostCache> host_cache_weak_factory_;
58 base::ThreadChecker thread_checker_;
60 DISALLOW_COPY_AND_ASSIGN(HostResolverMojo);
63 } // namespace net
65 #endif // NET_DNS_HOST_RESOLVER_MOJO_H_