| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "net/proxy/sync_host_resolver_bridge.h" | 5 #include "net/proxy/sync_host_resolver_bridge.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 bool HasShutdown() const { | 30 bool HasShutdown() const { |
| 31 base::AutoLock l(lock_); | 31 base::AutoLock l(lock_); |
| 32 return HasShutdownLocked(); | 32 return HasShutdownLocked(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 // Called on |host_resolver_loop_|. | 35 // Called on |host_resolver_loop_|. |
| 36 void Shutdown(); | 36 void Shutdown(); |
| 37 | 37 |
| 38 private: | 38 private: |
| 39 friend class base::RefCountedThreadSafe<SyncHostResolverBridge::Core>; | 39 friend class base::RefCountedThreadSafe<SyncHostResolverBridge::Core>; |
| 40 ~Core() {} |
| 40 | 41 |
| 41 bool HasShutdownLocked() const { | 42 bool HasShutdownLocked() const { |
| 42 return has_shutdown_; | 43 return has_shutdown_; |
| 43 } | 44 } |
| 44 | 45 |
| 45 // Called on |host_resolver_loop_|. | 46 // Called on |host_resolver_loop_|. |
| 46 void StartResolve(const HostResolver::RequestInfo& info, | 47 void StartResolve(const HostResolver::RequestInfo& info, |
| 47 AddressList* addresses, | 48 AddressList* addresses, |
| 48 const BoundNetLog& net_log); | 49 const BoundNetLog& net_log); |
| 49 | 50 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 const BoundNetLog& net_log) { | 168 const BoundNetLog& net_log) { |
| 168 return core_->ResolveSynchronously(info, addresses, net_log); | 169 return core_->ResolveSynchronously(info, addresses, net_log); |
| 169 } | 170 } |
| 170 | 171 |
| 171 void SyncHostResolverBridge::Shutdown() { | 172 void SyncHostResolverBridge::Shutdown() { |
| 172 DCHECK_EQ(MessageLoop::current(), host_resolver_loop_); | 173 DCHECK_EQ(MessageLoop::current(), host_resolver_loop_); |
| 173 core_->Shutdown(); | 174 core_->Shutdown(); |
| 174 } | 175 } |
| 175 | 176 |
| 176 } // namespace net | 177 } // namespace net |
| OLD | NEW |