OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_intercepting_job_factory.h" | 5 #include "net/url_request/url_request_intercepting_job_factory.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/logging.h" | 9 #include "base/logging.h" |
8 #include "net/url_request/url_request_interceptor.h" | 10 #include "net/url_request/url_request_interceptor.h" |
9 | 11 |
10 namespace net { | 12 namespace net { |
11 | 13 |
12 URLRequestInterceptingJobFactory::URLRequestInterceptingJobFactory( | 14 URLRequestInterceptingJobFactory::URLRequestInterceptingJobFactory( |
13 scoped_ptr<URLRequestJobFactory> job_factory, | 15 scoped_ptr<URLRequestJobFactory> job_factory, |
14 scoped_ptr<URLRequestInterceptor> interceptor) | 16 scoped_ptr<URLRequestInterceptor> interceptor) |
15 : job_factory_(job_factory.Pass()), | 17 : job_factory_(std::move(job_factory)), |
16 interceptor_(interceptor.Pass()) { | 18 interceptor_(std::move(interceptor)) {} |
17 } | |
18 | 19 |
19 URLRequestInterceptingJobFactory::~URLRequestInterceptingJobFactory() {} | 20 URLRequestInterceptingJobFactory::~URLRequestInterceptingJobFactory() {} |
20 | 21 |
21 URLRequestJob* URLRequestInterceptingJobFactory:: | 22 URLRequestJob* URLRequestInterceptingJobFactory:: |
22 MaybeCreateJobWithProtocolHandler( | 23 MaybeCreateJobWithProtocolHandler( |
23 const std::string& scheme, | 24 const std::string& scheme, |
24 URLRequest* request, | 25 URLRequest* request, |
25 NetworkDelegate* network_delegate) const { | 26 NetworkDelegate* network_delegate) const { |
26 DCHECK(CalledOnValidThread()); | 27 DCHECK(CalledOnValidThread()); |
27 URLRequestJob* job = interceptor_->MaybeInterceptRequest(request, | 28 URLRequestJob* job = interceptor_->MaybeInterceptRequest(request, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 bool URLRequestInterceptingJobFactory::IsHandledURL(const GURL& url) const { | 68 bool URLRequestInterceptingJobFactory::IsHandledURL(const GURL& url) const { |
68 return job_factory_->IsHandledURL(url); | 69 return job_factory_->IsHandledURL(url); |
69 } | 70 } |
70 | 71 |
71 bool URLRequestInterceptingJobFactory::IsSafeRedirectTarget( | 72 bool URLRequestInterceptingJobFactory::IsSafeRedirectTarget( |
72 const GURL& location) const { | 73 const GURL& location) const { |
73 return job_factory_->IsSafeRedirectTarget(location); | 74 return job_factory_->IsSafeRedirectTarget(location); |
74 } | 75 } |
75 | 76 |
76 } // namespace net | 77 } // namespace net |
OLD | NEW |