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_fetcher.h" | 5 #include "net/url_request/url_fetcher.h" |
6 | 6 |
7 #include "net/url_request/url_fetcher_factory.h" | 7 #include "net/url_request/url_fetcher_factory.h" |
8 #include "net/url_request/url_fetcher_impl.h" | 8 #include "net/url_request/url_fetcher_impl.h" |
9 | 9 |
10 namespace net { | 10 namespace net { |
(...skipping 14 matching lines...) Expand all Loading... |
25 const GURL& url, | 25 const GURL& url, |
26 URLFetcher::RequestType request_type, | 26 URLFetcher::RequestType request_type, |
27 URLFetcherDelegate* d) { | 27 URLFetcherDelegate* d) { |
28 URLFetcherFactory* factory = URLFetcherImpl::factory(); | 28 URLFetcherFactory* factory = URLFetcherImpl::factory(); |
29 return factory ? factory->CreateURLFetcher(id, url, request_type, d) | 29 return factory ? factory->CreateURLFetcher(id, url, request_type, d) |
30 : std::unique_ptr<URLFetcher>( | 30 : std::unique_ptr<URLFetcher>( |
31 new URLFetcherImpl(url, request_type, d)); | 31 new URLFetcherImpl(url, request_type, d)); |
32 } | 32 } |
33 | 33 |
34 // static | 34 // static |
| 35 std::unique_ptr<URLFetcher> URLFetcher::Create( |
| 36 const GURL& url, |
| 37 URLFetcher::RequestType request_type, |
| 38 URLFetcherDelegate* d, |
| 39 NetworkTrafficAnnotationTag traffic_annotation) { |
| 40 return URLFetcher::Create(0, url, request_type, d, traffic_annotation); |
| 41 } |
| 42 |
| 43 // static |
| 44 std::unique_ptr<URLFetcher> URLFetcher::Create( |
| 45 int id, |
| 46 const GURL& url, |
| 47 URLFetcher::RequestType request_type, |
| 48 URLFetcherDelegate* d, |
| 49 NetworkTrafficAnnotationTag traffic_annotation) { |
| 50 // traffic_annotation is just a tag that is extracted during static |
| 51 // code analysis and can be ignored here. |
| 52 return Create(id, url, request_type, d); |
| 53 } |
| 54 |
| 55 // static |
35 void URLFetcher::CancelAll() { | 56 void URLFetcher::CancelAll() { |
36 URLFetcherImpl::CancelAll(); | 57 URLFetcherImpl::CancelAll(); |
37 } | 58 } |
38 | 59 |
39 // static | 60 // static |
40 void URLFetcher::SetIgnoreCertificateRequests(bool ignored) { | 61 void URLFetcher::SetIgnoreCertificateRequests(bool ignored) { |
41 URLFetcherImpl::SetIgnoreCertificateRequests(ignored); | 62 URLFetcherImpl::SetIgnoreCertificateRequests(ignored); |
42 } | 63 } |
43 | 64 |
44 } // namespace net | 65 } // namespace net |
OLD | NEW |