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

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

Issue 501163002: Make URLRequest's constructor private, and make URLRequestContext a friend class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge yet again Created 6 years, 3 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
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/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/threading/thread.h" 10 #include "base/threading/thread.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 base::WorkerPool::GetTaskRunner(true))); 123 base::WorkerPool::GetTaskRunner(true)));
124 } 124 }
125 if (!http_user_agent_settings()) { 125 if (!http_user_agent_settings()) {
126 context_storage_.set_http_user_agent_settings( 126 context_storage_.set_http_user_agent_settings(
127 new StaticHttpUserAgentSettings("en-us,fr", std::string())); 127 new StaticHttpUserAgentSettings("en-us,fr", std::string()));
128 } 128 }
129 if (!job_factory()) 129 if (!job_factory())
130 context_storage_.set_job_factory(new URLRequestJobFactoryImpl); 130 context_storage_.set_job_factory(new URLRequestJobFactoryImpl);
131 } 131 }
132 132
133 TestURLRequest::TestURLRequest(const GURL& url,
134 RequestPriority priority,
135 Delegate* delegate,
136 TestURLRequestContext* context)
137 : URLRequest(url, priority, delegate, context, NULL, NULL) {}
138
139 TestURLRequest::~TestURLRequest() {
140 }
141
142 TestURLRequestContextGetter::TestURLRequestContextGetter( 133 TestURLRequestContextGetter::TestURLRequestContextGetter(
143 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner) 134 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner)
144 : network_task_runner_(network_task_runner) { 135 : network_task_runner_(network_task_runner) {
145 DCHECK(network_task_runner_.get()); 136 DCHECK(network_task_runner_.get());
146 } 137 }
147 138
148 TestURLRequestContextGetter::TestURLRequestContextGetter( 139 TestURLRequestContextGetter::TestURLRequestContextGetter(
149 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner, 140 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner,
150 scoped_ptr<TestURLRequestContext> context) 141 scoped_ptr<TestURLRequestContext> context)
151 : network_task_runner_(network_task_runner), context_(context.Pass()) { 142 : network_task_runner_(network_task_runner), context_(context.Pass()) {
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
642 URLRequestJob* job = main_intercept_job_; 633 URLRequestJob* job = main_intercept_job_;
643 main_intercept_job_ = NULL; 634 main_intercept_job_ = NULL;
644 return job; 635 return job;
645 } 636 }
646 637
647 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) { 638 void TestJobInterceptor::set_main_intercept_job(URLRequestJob* job) {
648 main_intercept_job_ = job; 639 main_intercept_job_ = job;
649 } 640 }
650 641
651 } // namespace net 642 } // namespace net
OLDNEW
« no previous file with comments | « net/url_request/url_request_test_util.h ('k') | net/url_request/url_request_throttler_simulation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698