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

Side by Side Diff: android_webview/browser/net/android_stream_reader_url_request_job.cc

Issue 2258823002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 (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 "android_webview/browser/net/android_stream_reader_url_request_job.h" 5 #include "android_webview/browser/net/android_stream_reader_url_request_job.h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "android_webview/browser/input_stream.h" 10 #include "android_webview/browser/input_stream.h"
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 154 }
155 155
156 void AndroidStreamReaderURLRequestJob::Kill() { 156 void AndroidStreamReaderURLRequestJob::Kill() {
157 DCHECK(thread_checker_.CalledOnValidThread()); 157 DCHECK(thread_checker_.CalledOnValidThread());
158 weak_factory_.InvalidateWeakPtrs(); 158 weak_factory_.InvalidateWeakPtrs();
159 URLRequestJob::Kill(); 159 URLRequestJob::Kill();
160 } 160 }
161 161
162 std::unique_ptr<InputStreamReader> 162 std::unique_ptr<InputStreamReader>
163 AndroidStreamReaderURLRequestJob::CreateStreamReader(InputStream* stream) { 163 AndroidStreamReaderURLRequestJob::CreateStreamReader(InputStream* stream) {
164 return base::WrapUnique(new InputStreamReader(stream)); 164 return base::MakeUnique<InputStreamReader>(stream);
165 } 165 }
166 166
167 void AndroidStreamReaderURLRequestJob::OnInputStreamOpened( 167 void AndroidStreamReaderURLRequestJob::OnInputStreamOpened(
168 std::unique_ptr<Delegate> returned_delegate, 168 std::unique_ptr<Delegate> returned_delegate,
169 std::unique_ptr<android_webview::InputStream> input_stream) { 169 std::unique_ptr<android_webview::InputStream> input_stream) {
170 DCHECK(thread_checker_.CalledOnValidThread()); 170 DCHECK(thread_checker_.CalledOnValidThread());
171 DCHECK(returned_delegate); 171 DCHECK(returned_delegate);
172 delegate_ = std::move(returned_delegate); 172 delegate_ = std::move(returned_delegate);
173 173
174 if (!input_stream) { 174 if (!input_stream) {
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 byte_range_ = ranges[0]; 375 byte_range_ = ranges[0];
376 } else { 376 } else {
377 // We don't support multiple range requests in one single URL request, 377 // We don't support multiple range requests in one single URL request,
378 // because we need to do multipart encoding here. 378 // because we need to do multipart encoding here.
379 range_parse_result_ = net::ERR_REQUEST_RANGE_NOT_SATISFIABLE; 379 range_parse_result_ = net::ERR_REQUEST_RANGE_NOT_SATISFIABLE;
380 } 380 }
381 } 381 }
382 } 382 }
383 383
384 } // namespace android_webview 384 } // namespace android_webview
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698