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

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

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 years, 7 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
« no previous file with comments | « net/url_request/url_fetcher.h ('k') | net/url_request/url_fetcher_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_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
OLDNEW
« no previous file with comments | « net/url_request/url_fetcher.h ('k') | net/url_request/url_fetcher_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698