| OLD | NEW |
| 1 // Copyright (c) 2011 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/threading/thread.h" | 7 #include "base/threading/thread.h" |
| 8 #include "base/synchronization/waitable_event.h" | 8 #include "base/synchronization/waitable_event.h" |
| 9 #include "net/base/address_list.h" | 9 #include "net/base/address_list.h" |
| 10 #include "net/base/net_errors.h" | 10 #include "net/base/net_errors.h" |
| 11 #include "net/base/net_log.h" | 11 #include "net/base/net_log.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 ProxyInfo* results, | 85 ProxyInfo* results, |
| 86 const CompletionCallback& callback, | 86 const CompletionCallback& callback, |
| 87 RequestHandle* request, | 87 RequestHandle* request, |
| 88 const BoundNetLog& net_log) { | 88 const BoundNetLog& net_log) { |
| 89 EXPECT_FALSE(!callback.is_null()); | 89 EXPECT_FALSE(!callback.is_null()); |
| 90 EXPECT_FALSE(request); | 90 EXPECT_FALSE(request); |
| 91 | 91 |
| 92 // Do a synchronous host resolve. | 92 // Do a synchronous host resolve. |
| 93 HostResolver::RequestInfo info(HostPortPair::FromURL(url)); | 93 HostResolver::RequestInfo info(HostPortPair::FromURL(url)); |
| 94 AddressList addresses; | 94 AddressList addresses; |
| 95 int rv = host_resolver_->Resolve(info, &addresses); | 95 int rv = host_resolver_->Resolve(info, &addresses, net_log); |
| 96 | 96 |
| 97 EXPECT_EQ(ERR_ABORTED, rv); | 97 EXPECT_EQ(ERR_ABORTED, rv); |
| 98 | 98 |
| 99 return rv; | 99 return rv; |
| 100 } | 100 } |
| 101 | 101 |
| 102 virtual void CancelRequest(RequestHandle request) OVERRIDE { | 102 virtual void CancelRequest(RequestHandle request) OVERRIDE { |
| 103 NOTREACHED(); | 103 NOTREACHED(); |
| 104 } | 104 } |
| 105 | 105 |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 // stop the IOThread, which will in turn delete the | 235 // stop the IOThread, which will in turn delete the |
| 236 // SingleThreadedProxyResolver, which in turn will stop its internal | 236 // SingleThreadedProxyResolver, which in turn will stop its internal |
| 237 // PAC thread (which is currently blocked waiting on the host resolve which | 237 // PAC thread (which is currently blocked waiting on the host resolve which |
| 238 // is running on IOThread). The IOThread::Cleanup() will verify that after | 238 // is running on IOThread). The IOThread::Cleanup() will verify that after |
| 239 // the PAC thread is stopped, it cancels the request on the HostResolver. | 239 // the PAC thread is stopped, it cancels the request on the HostResolver. |
| 240 } | 240 } |
| 241 | 241 |
| 242 } // namespace | 242 } // namespace |
| 243 | 243 |
| 244 } // namespace net | 244 } // namespace net |
| OLD | NEW |