| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 const BoundNetLog& net_log) OVERRIDE { | 52 const BoundNetLog& net_log) OVERRIDE { |
| 53 NOTIMPLEMENTED(); | 53 NOTIMPLEMENTED(); |
| 54 return ERR_UNEXPECTED; | 54 return ERR_UNEXPECTED; |
| 55 } | 55 } |
| 56 | 56 |
| 57 virtual void CancelRequest(RequestHandle req) OVERRIDE { | 57 virtual void CancelRequest(RequestHandle req) OVERRIDE { |
| 58 EXPECT_EQ(reinterpret_cast<RequestHandle*>(1), req); | 58 EXPECT_EQ(reinterpret_cast<RequestHandle*>(1), req); |
| 59 was_request_cancelled_ = true; | 59 was_request_cancelled_ = true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 virtual void AddObserver(Observer* observer) OVERRIDE { | |
| 63 NOTREACHED(); | |
| 64 } | |
| 65 | |
| 66 virtual void RemoveObserver(Observer* observer) OVERRIDE { | |
| 67 NOTREACHED(); | |
| 68 } | |
| 69 | |
| 70 // Waits until Resolve() has been called. | 62 // Waits until Resolve() has been called. |
| 71 void WaitUntilRequestIsReceived() { | 63 void WaitUntilRequestIsReceived() { |
| 72 event_.Wait(); | 64 event_.Wait(); |
| 73 } | 65 } |
| 74 | 66 |
| 75 bool was_request_cancelled() const { | 67 bool was_request_cancelled() const { |
| 76 return was_request_cancelled_; | 68 return was_request_cancelled_; |
| 77 } | 69 } |
| 78 | 70 |
| 79 private: | 71 private: |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 // stop the IOThread, which will in turn delete the | 234 // stop the IOThread, which will in turn delete the |
| 243 // SingleThreadedProxyResolver, which in turn will stop its internal | 235 // SingleThreadedProxyResolver, which in turn will stop its internal |
| 244 // PAC thread (which is currently blocked waiting on the host resolve which | 236 // PAC thread (which is currently blocked waiting on the host resolve which |
| 245 // is running on IOThread). The IOThread::Cleanup() will verify that after | 237 // is running on IOThread). The IOThread::Cleanup() will verify that after |
| 246 // the PAC thread is stopped, it cancels the request on the HostResolver. | 238 // the PAC thread is stopped, it cancels the request on the HostResolver. |
| 247 } | 239 } |
| 248 | 240 |
| 249 } // namespace | 241 } // namespace |
| 250 | 242 |
| 251 } // namespace net | 243 } // namespace net |
| OLD | NEW |