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/url_request/url_request_test_util.h" | 5 #include "net/url_request/url_request_test_util.h" |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/threading/thread.h" | 10 #include "base/threading/thread.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 168 |
169 TestURLRequestContextGetter::TestURLRequestContextGetter( | 169 TestURLRequestContextGetter::TestURLRequestContextGetter( |
170 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy) | 170 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy) |
171 : io_message_loop_proxy_(io_message_loop_proxy) { | 171 : io_message_loop_proxy_(io_message_loop_proxy) { |
172 DCHECK(io_message_loop_proxy.get()); | 172 DCHECK(io_message_loop_proxy.get()); |
173 } | 173 } |
174 | 174 |
175 TestURLRequestContextGetter::~TestURLRequestContextGetter() {} | 175 TestURLRequestContextGetter::~TestURLRequestContextGetter() {} |
176 | 176 |
177 TestURLRequestContext* TestURLRequestContextGetter::GetURLRequestContext() { | 177 TestURLRequestContext* TestURLRequestContextGetter::GetURLRequestContext() { |
178 if (!context_) | 178 if (!context_.get()) |
179 context_ = new TestURLRequestContext(); | 179 context_.reset(new TestURLRequestContext); |
180 return context_.get(); | 180 return context_.get(); |
181 } | 181 } |
182 | 182 |
183 scoped_refptr<base::MessageLoopProxy> | 183 scoped_refptr<base::MessageLoopProxy> |
184 TestURLRequestContextGetter::GetIOMessageLoopProxy() const { | 184 TestURLRequestContextGetter::GetIOMessageLoopProxy() const { |
185 return io_message_loop_proxy_; | 185 return io_message_loop_proxy_; |
186 } | 186 } |
187 | 187 |
188 TestDelegate::TestDelegate() | 188 TestDelegate::TestDelegate() |
189 : cancel_in_rr_(false), | 189 : cancel_in_rr_(false), |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 | 537 |
538 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() { | 538 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() { |
539 DCHECK_EQ(value_, new_value_); | 539 DCHECK_EQ(value_, new_value_); |
540 value_ = old_value_; | 540 value_ = old_value_; |
541 } | 541 } |
542 | 542 |
543 // static | 543 // static |
544 const std::string& ScopedCustomUrlRequestTestHttpHost::value() { | 544 const std::string& ScopedCustomUrlRequestTestHttpHost::value() { |
545 return value_; | 545 return value_; |
546 } | 546 } |
OLD | NEW |