| 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 { |
| 11 | 11 |
| 12 URLFetcher::~URLFetcher() {} | 12 URLFetcher::~URLFetcher() {} |
| 13 | 13 |
| 14 // static | 14 // static |
| 15 URLFetcher* URLFetcher::Create(const GURL& url, | 15 scoped_ptr<URLFetcher> URLFetcher::Create(const GURL& url, |
| 16 URLFetcher::RequestType request_type, | 16 URLFetcher::RequestType request_type, |
| 17 URLFetcherDelegate* d) { | 17 URLFetcherDelegate* d) { |
| 18 return URLFetcher::Create(0, url, request_type, d); | 18 return URLFetcher::Create(0, url, request_type, d); |
| 19 } | 19 } |
| 20 | 20 |
| 21 // static | 21 // static |
| 22 URLFetcher* URLFetcher::Create(int id, | 22 scoped_ptr<URLFetcher> URLFetcher::Create(int id, |
| 23 const GURL& url, | 23 const GURL& url, |
| 24 URLFetcher::RequestType request_type, | 24 URLFetcher::RequestType request_type, |
| 25 URLFetcherDelegate* d) { | 25 URLFetcherDelegate* d) { |
| 26 URLFetcherFactory* factory = URLFetcherImpl::factory(); | 26 URLFetcherFactory* factory = URLFetcherImpl::factory(); |
| 27 return factory ? factory->CreateURLFetcher(id, url, request_type, d) | 27 return factory |
| 28 : new URLFetcherImpl(url, request_type, d); | 28 ? factory->CreateURLFetcher(id, url, request_type, d) |
| 29 : scoped_ptr<URLFetcher>(new URLFetcherImpl(url, request_type, d)); |
| 29 } | 30 } |
| 30 | 31 |
| 31 // static | 32 // static |
| 32 void URLFetcher::CancelAll() { | 33 void URLFetcher::CancelAll() { |
| 33 URLFetcherImpl::CancelAll(); | 34 URLFetcherImpl::CancelAll(); |
| 34 } | 35 } |
| 35 | 36 |
| 36 // static | 37 // static |
| 37 void URLFetcher::SetIgnoreCertificateRequests(bool ignored) { | 38 void URLFetcher::SetIgnoreCertificateRequests(bool ignored) { |
| 38 URLFetcherImpl::SetIgnoreCertificateRequests(ignored); | 39 URLFetcherImpl::SetIgnoreCertificateRequests(ignored); |
| 39 } | 40 } |
| 40 | 41 |
| 41 } // namespace net | 42 } // namespace net |
| OLD | NEW |