| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/mock_host_resolver.h" | 5 #include "net/base/mock_host_resolver.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/platform_thread.h" | 8 #include "base/platform_thread.h" |
| 9 #include "base/ref_counted.h" | 9 #include "base/ref_counted.h" |
| 10 #include "googleurl/src/url_canon_ip.h" | 10 #include "googleurl/src/url_canon_ip.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 return OK; | 35 return OK; |
| 36 } | 36 } |
| 37 | 37 |
| 38 } // namespace | 38 } // namespace |
| 39 | 39 |
| 40 MockHostResolverBase::MockHostResolverBase(bool use_caching) | 40 MockHostResolverBase::MockHostResolverBase(bool use_caching) |
| 41 : use_caching_(use_caching) { | 41 : use_caching_(use_caching) { |
| 42 Reset(NULL); | 42 Reset(NULL); |
| 43 } | 43 } |
| 44 | 44 |
| 45 int MockHostResolverBase::Resolve(const RequestInfo& info, | 45 int MockHostResolverBase::Resolve(LoadLog* load_log, |
| 46 const RequestInfo& info, |
| 46 AddressList* addresses, | 47 AddressList* addresses, |
| 47 CompletionCallback* callback, | 48 CompletionCallback* callback, |
| 48 RequestHandle* out_req) { | 49 RequestHandle* out_req) { |
| 49 if (synchronous_mode_) { | 50 if (synchronous_mode_) { |
| 50 callback = NULL; | 51 callback = NULL; |
| 51 out_req = NULL; | 52 out_req = NULL; |
| 52 } | 53 } |
| 53 return impl_->Resolve(info, addresses, callback, out_req); | 54 return impl_->Resolve(load_log, info, addresses, callback, out_req); |
| 54 } | 55 } |
| 55 | 56 |
| 56 void MockHostResolverBase::CancelRequest(RequestHandle req) { | 57 void MockHostResolverBase::CancelRequest(RequestHandle req) { |
| 57 impl_->CancelRequest(req); | 58 impl_->CancelRequest(req); |
| 58 } | 59 } |
| 59 | 60 |
| 60 void MockHostResolverBase::AddObserver(Observer* observer) { | 61 void MockHostResolverBase::AddObserver(Observer* observer) { |
| 61 impl_->AddObserver(observer); | 62 impl_->AddObserver(observer); |
| 62 } | 63 } |
| 63 | 64 |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 CHECK(old_proc == current_proc_); | 206 CHECK(old_proc == current_proc_); |
| 206 } | 207 } |
| 207 | 208 |
| 208 void ScopedDefaultHostResolverProc::Init(HostResolverProc* proc) { | 209 void ScopedDefaultHostResolverProc::Init(HostResolverProc* proc) { |
| 209 current_proc_ = proc; | 210 current_proc_ = proc; |
| 210 previous_proc_ = HostResolverProc::SetDefault(current_proc_); | 211 previous_proc_ = HostResolverProc::SetDefault(current_proc_); |
| 211 current_proc_->set_previous_proc(previous_proc_); | 212 current_proc_->set_previous_proc(previous_proc_); |
| 212 } | 213 } |
| 213 | 214 |
| 214 } // namespace net | 215 } // namespace net |
| OLD | NEW |