| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef NET_DNS_HOST_RESOLVER_MOJO_H_ | 5 #ifndef NET_DNS_HOST_RESOLVER_MOJO_H_ |
| 6 #define NET_DNS_HOST_RESOLVER_MOJO_H_ | 6 #define NET_DNS_HOST_RESOLVER_MOJO_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // |impl| must outlive |this|. | 30 // |impl| must outlive |this|. |
| 31 explicit HostResolverMojo(Impl* impl); | 31 explicit HostResolverMojo(Impl* impl); |
| 32 ~HostResolverMojo() override; | 32 ~HostResolverMojo() override; |
| 33 | 33 |
| 34 // HostResolver overrides. | 34 // HostResolver overrides. |
| 35 // Note: |Resolve()| currently ignores |priority|. | 35 // Note: |Resolve()| currently ignores |priority|. |
| 36 int Resolve(const RequestInfo& info, | 36 int Resolve(const RequestInfo& info, |
| 37 RequestPriority priority, | 37 RequestPriority priority, |
| 38 AddressList* addresses, | 38 AddressList* addresses, |
| 39 const CompletionCallback& callback, | 39 const CompletionCallback& callback, |
| 40 RequestHandle* request_handle, | 40 std::unique_ptr<Request>* request, |
| 41 const BoundNetLog& source_net_log) override; | 41 const BoundNetLog& source_net_log) override; |
| 42 int ResolveFromCache(const RequestInfo& info, | 42 int ResolveFromCache(const RequestInfo& info, |
| 43 AddressList* addresses, | 43 AddressList* addresses, |
| 44 const BoundNetLog& source_net_log) override; | 44 const BoundNetLog& source_net_log) override; |
| 45 void ChangeRequestPriority(RequestHandle req, | |
| 46 RequestPriority priority) override; | |
| 47 void CancelRequest(RequestHandle req) override; | |
| 48 HostCache* GetHostCache() override; | 45 HostCache* GetHostCache() override; |
| 49 | 46 |
| 50 private: | 47 private: |
| 51 class Job; | 48 class Job; |
| 49 class RequestImpl; |
| 52 | 50 |
| 53 int ResolveFromCacheInternal(const RequestInfo& info, | 51 int ResolveFromCacheInternal(const RequestInfo& info, |
| 54 const HostCache::Key& key, | 52 const HostCache::Key& key, |
| 55 AddressList* addresses); | 53 AddressList* addresses); |
| 56 | 54 |
| 57 Impl* const impl_; | 55 Impl* const impl_; |
| 58 | 56 |
| 59 std::unique_ptr<HostCache> host_cache_; | 57 std::unique_ptr<HostCache> host_cache_; |
| 60 base::WeakPtrFactory<HostCache> host_cache_weak_factory_; | 58 base::WeakPtrFactory<HostCache> host_cache_weak_factory_; |
| 61 | 59 |
| 62 base::ThreadChecker thread_checker_; | 60 base::ThreadChecker thread_checker_; |
| 63 | 61 |
| 64 DISALLOW_COPY_AND_ASSIGN(HostResolverMojo); | 62 DISALLOW_COPY_AND_ASSIGN(HostResolverMojo); |
| 65 }; | 63 }; |
| 66 | 64 |
| 67 } // namespace net | 65 } // namespace net |
| 68 | 66 |
| 69 #endif // NET_DNS_HOST_RESOLVER_MOJO_H_ | 67 #endif // NET_DNS_HOST_RESOLVER_MOJO_H_ |
| OLD | NEW |