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

Side by Side Diff: ios/chrome/browser/net/image_fetcher.mm

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
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #import "ios/chrome/browser/net/image_fetcher.h" 5 #import "ios/chrome/browser/net/image_fetcher.h"
6 6
7 #import <Foundation/Foundation.h> 7 #import <Foundation/Foundation.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 delete pair.first; 76 delete pair.first;
77 } 77 }
78 } 78 }
79 79
80 void ImageFetcher::StartDownload( 80 void ImageFetcher::StartDownload(
81 const GURL& url, 81 const GURL& url,
82 ImageFetchedCallback callback, 82 ImageFetchedCallback callback,
83 const std::string& referrer, 83 const std::string& referrer,
84 net::URLRequest::ReferrerPolicy referrer_policy) { 84 net::URLRequest::ReferrerPolicy referrer_policy) {
85 DCHECK(request_context_getter_.get()); 85 DCHECK(request_context_getter_.get());
86 net::URLFetcher* fetcher = net::URLFetcher::Create(url, 86 net::URLFetcher* fetcher =
87 net::URLFetcher::GET, 87 net::URLFetcher::Create(url, net::URLFetcher::GET, this).release();
88 this);
89 downloads_in_progress_[fetcher] = [callback copy]; 88 downloads_in_progress_[fetcher] = [callback copy];
90 fetcher->SetLoadFlags( 89 fetcher->SetLoadFlags(
91 net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES | 90 net::LOAD_DO_NOT_SEND_COOKIES | net::LOAD_DO_NOT_SAVE_COOKIES |
92 net::LOAD_DO_NOT_SEND_AUTH_DATA); 91 net::LOAD_DO_NOT_SEND_AUTH_DATA);
93 fetcher->SetRequestContext(request_context_getter_.get()); 92 fetcher->SetRequestContext(request_context_getter_.get());
94 fetcher->SetReferrer(referrer); 93 fetcher->SetReferrer(referrer);
95 fetcher->SetReferrerPolicy(referrer_policy); 94 fetcher->SetReferrerPolicy(referrer_policy);
96 fetcher->Start(); 95 fetcher->Start();
97 } 96 }
98 97
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 NSData* data) { 168 NSData* data) {
170 (callback.get())(url, http_response_code, data); 169 (callback.get())(url, http_response_code, data);
171 } 170 }
172 171
173 void ImageFetcher::SetRequestContextGetter( 172 void ImageFetcher::SetRequestContextGetter(
174 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter) { 173 const scoped_refptr<net::URLRequestContextGetter>& request_context_getter) {
175 request_context_getter_ = request_context_getter; 174 request_context_getter_ = request_context_getter;
176 } 175 }
177 176
178 } // namespace image_fetcher 177 } // namespace image_fetcher
OLDNEW
« no previous file with comments | « google_apis/gcm/engine/unregistration_request.cc ('k') | ios/chrome/browser/net/retryable_url_fetcher.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698