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 <utility> |
| 8 |
7 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
8 #include "base/location.h" | 10 #include "base/location.h" |
9 #include "base/logging.h" | 11 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
11 #include "base/single_thread_task_runner.h" | 13 #include "base/single_thread_task_runner.h" |
12 #include "base/thread_task_runner_handle.h" | 14 #include "base/thread_task_runner_handle.h" |
13 #include "base/threading/thread.h" | 15 #include "base/threading/thread.h" |
14 #include "base/threading/worker_pool.h" | 16 #include "base/threading/worker_pool.h" |
15 #include "net/base/host_port_pair.h" | 17 #include "net/base/host_port_pair.h" |
16 #include "net/cert/cert_verifier.h" | 18 #include "net/cert/cert_verifier.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 138 |
137 TestURLRequestContextGetter::TestURLRequestContextGetter( | 139 TestURLRequestContextGetter::TestURLRequestContextGetter( |
138 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner) | 140 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner) |
139 : network_task_runner_(network_task_runner) { | 141 : network_task_runner_(network_task_runner) { |
140 DCHECK(network_task_runner_.get()); | 142 DCHECK(network_task_runner_.get()); |
141 } | 143 } |
142 | 144 |
143 TestURLRequestContextGetter::TestURLRequestContextGetter( | 145 TestURLRequestContextGetter::TestURLRequestContextGetter( |
144 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner, | 146 const scoped_refptr<base::SingleThreadTaskRunner>& network_task_runner, |
145 scoped_ptr<TestURLRequestContext> context) | 147 scoped_ptr<TestURLRequestContext> context) |
146 : network_task_runner_(network_task_runner), context_(context.Pass()) { | 148 : network_task_runner_(network_task_runner), context_(std::move(context)) { |
147 DCHECK(network_task_runner_.get()); | 149 DCHECK(network_task_runner_.get()); |
148 } | 150 } |
149 | 151 |
150 TestURLRequestContextGetter::~TestURLRequestContextGetter() {} | 152 TestURLRequestContextGetter::~TestURLRequestContextGetter() {} |
151 | 153 |
152 TestURLRequestContext* TestURLRequestContextGetter::GetURLRequestContext() { | 154 TestURLRequestContext* TestURLRequestContextGetter::GetURLRequestContext() { |
153 if (!context_.get()) | 155 if (!context_.get()) |
154 context_.reset(new TestURLRequestContext); | 156 context_.reset(new TestURLRequestContext); |
155 return context_.get(); | 157 return context_.get(); |
156 } | 158 } |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 URLRequest* request, | 648 URLRequest* request, |
647 NetworkDelegate* network_delegate) const { | 649 NetworkDelegate* network_delegate) const { |
648 return main_intercept_job_.release(); | 650 return main_intercept_job_.release(); |
649 } | 651 } |
650 | 652 |
651 void TestJobInterceptor::set_main_intercept_job(scoped_ptr<URLRequestJob> job) { | 653 void TestJobInterceptor::set_main_intercept_job(scoped_ptr<URLRequestJob> job) { |
652 main_intercept_job_ = std::move(job); | 654 main_intercept_job_ = std::move(job); |
653 } | 655 } |
654 | 656 |
655 } // namespace net | 657 } // namespace net |
OLD | NEW |