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

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

Issue 10440119: Introduce a delegate to avoid hardcoding "chrome-extension" in net/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge to LKGR Created 8 years, 6 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 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 TestURLRequest::TestURLRequest(const GURL& url, Delegate* delegate) 115 TestURLRequest::TestURLRequest(const GURL& url, Delegate* delegate)
116 : net::URLRequest(url, delegate), 116 : net::URLRequest(url, delegate),
117 context_(new TestURLRequestContext) { 117 context_(new TestURLRequestContext) {
118 set_context(context_.get()); 118 set_context(context_.get());
119 } 119 }
120 120
121 TestURLRequest::~TestURLRequest() { 121 TestURLRequest::~TestURLRequest() {
122 set_context(NULL); 122 set_context(NULL);
123 } 123 }
124 124
125 bool TestURLRequestThrottlerManagerDelegate::MayRejectRequest(
126 net::URLRequest* request) {
127 return true;
128 }
129
125 TestURLRequestContextGetter::TestURLRequestContextGetter( 130 TestURLRequestContextGetter::TestURLRequestContextGetter(
126 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy) 131 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy)
127 : io_message_loop_proxy_(io_message_loop_proxy) { 132 : io_message_loop_proxy_(io_message_loop_proxy) {
128 DCHECK(io_message_loop_proxy.get()); 133 DCHECK(io_message_loop_proxy.get());
129 } 134 }
130 135
131 TestURLRequestContextGetter::TestURLRequestContextGetter( 136 TestURLRequestContextGetter::TestURLRequestContextGetter(
132 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy, 137 const scoped_refptr<base::MessageLoopProxy>& io_message_loop_proxy,
133 scoped_ptr<TestURLRequestContext> context) 138 scoped_ptr<TestURLRequestContext> context)
134 : io_message_loop_proxy_(io_message_loop_proxy), context_(context.Pass()) { 139 : io_message_loop_proxy_(io_message_loop_proxy), context_(context.Pass()) {
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 510
506 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() { 511 ScopedCustomUrlRequestTestHttpHost::~ScopedCustomUrlRequestTestHttpHost() {
507 DCHECK_EQ(value_, new_value_); 512 DCHECK_EQ(value_, new_value_);
508 value_ = old_value_; 513 value_ = old_value_;
509 } 514 }
510 515
511 // static 516 // static
512 const std::string& ScopedCustomUrlRequestTestHttpHost::value() { 517 const std::string& ScopedCustomUrlRequestTestHttpHost::value() {
513 return value_; 518 return value_;
514 } 519 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698