Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1283)

Side by Side Diff: net/url_request/url_request_test_util.cc

Issue 10299002: Stop refcounting URLRequestContext. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More fixes Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698