| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/base/host_resolver_impl.h" | 5 #include "net/base/host_resolver_impl.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <ws2tcpip.h> | 8 #include <ws2tcpip.h> |
| 9 #include <wspiapi.h> | 9 #include <wspiapi.h> |
| 10 #elif defined(OS_POSIX) | 10 #elif defined(OS_POSIX) |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 std::vector<std::string> GetCaptureList() const { | 60 std::vector<std::string> GetCaptureList() const { |
| 61 std::vector<std::string> copy; | 61 std::vector<std::string> copy; |
| 62 { | 62 { |
| 63 AutoLock l(lock_); | 63 AutoLock l(lock_); |
| 64 copy = capture_list_; | 64 copy = capture_list_; |
| 65 } | 65 } |
| 66 return copy; | 66 return copy; |
| 67 } | 67 } |
| 68 | 68 |
| 69 private: | 69 private: |
| 70 ~CapturingHostResolverProc() {} |
| 71 |
| 70 std::vector<std::string> capture_list_; | 72 std::vector<std::string> capture_list_; |
| 71 mutable Lock lock_; | 73 mutable Lock lock_; |
| 72 base::WaitableEvent event_; | 74 base::WaitableEvent event_; |
| 73 }; | 75 }; |
| 74 | 76 |
| 75 // Helper that represents a single Resolve() result, used to inspect all the | 77 // Helper that represents a single Resolve() result, used to inspect all the |
| 76 // resolve results by forwarding them to Delegate. | 78 // resolve results by forwarding them to Delegate. |
| 77 class ResolveRequest { | 79 class ResolveRequest { |
| 78 public: | 80 public: |
| 79 // Delegate interface, for notification when the ResolveRequest completes. | 81 // Delegate interface, for notification when the ResolveRequest completes. |
| (...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 954 EXPECT_EQ(0U, observer.finish_log.size()); | 956 EXPECT_EQ(0U, observer.finish_log.size()); |
| 955 EXPECT_EQ(2U, observer.cancel_log.size()); | 957 EXPECT_EQ(2U, observer.cancel_log.size()); |
| 956 | 958 |
| 957 HostResolver::RequestInfo info("host2", 60); | 959 HostResolver::RequestInfo info("host2", 60); |
| 958 EXPECT_TRUE(observer.cancel_log[1] == | 960 EXPECT_TRUE(observer.cancel_log[1] == |
| 959 CapturingObserver::StartOrCancelEntry(1, info)); | 961 CapturingObserver::StartOrCancelEntry(1, info)); |
| 960 } | 962 } |
| 961 | 963 |
| 962 } // namespace | 964 } // namespace |
| 963 } // namespace net | 965 } // namespace net |
| OLD | NEW |