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

Side by Side Diff: net/test/url_request/url_request_slow_download_job.cc

Issue 1893083002: Change scoped_ptr to std::unique_ptr in //net. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptr-net-all: iwyu Created 4 years, 8 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/test/url_request/url_request_mock_http_job.cc ('k') | net/tools/balsa/balsa_frame_test.cc » ('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/test/url_request/url_request_slow_download_job.h" 5 #include "net/test/url_request/url_request_slow_download_job.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/compiler_specific.h" 8 #include "base/compiler_specific.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 base::ThreadTaskRunnerHandle::Get()->PostTask( 65 base::ThreadTaskRunnerHandle::Get()->PostTask(
66 FROM_HERE, base::Bind(&URLRequestSlowDownloadJob::StartAsync, 66 FROM_HERE, base::Bind(&URLRequestSlowDownloadJob::StartAsync,
67 weak_factory_.GetWeakPtr())); 67 weak_factory_.GetWeakPtr()));
68 } 68 }
69 69
70 // static 70 // static
71 void URLRequestSlowDownloadJob::AddUrlHandler() { 71 void URLRequestSlowDownloadJob::AddUrlHandler() {
72 URLRequestFilter* filter = URLRequestFilter::GetInstance(); 72 URLRequestFilter* filter = URLRequestFilter::GetInstance();
73 filter->AddUrlInterceptor( 73 filter->AddUrlInterceptor(
74 GURL(kUnknownSizeUrl), 74 GURL(kUnknownSizeUrl),
75 scoped_ptr<URLRequestInterceptor>(new Interceptor())); 75 std::unique_ptr<URLRequestInterceptor>(new Interceptor()));
76 filter->AddUrlInterceptor( 76 filter->AddUrlInterceptor(
77 GURL(kKnownSizeUrl), 77 GURL(kKnownSizeUrl),
78 scoped_ptr<URLRequestInterceptor>(new Interceptor())); 78 std::unique_ptr<URLRequestInterceptor>(new Interceptor()));
79 filter->AddUrlInterceptor( 79 filter->AddUrlInterceptor(
80 GURL(kFinishDownloadUrl), 80 GURL(kFinishDownloadUrl),
81 scoped_ptr<URLRequestInterceptor>(new Interceptor())); 81 std::unique_ptr<URLRequestInterceptor>(new Interceptor()));
82 filter->AddUrlInterceptor( 82 filter->AddUrlInterceptor(
83 GURL(kErrorDownloadUrl), 83 GURL(kErrorDownloadUrl),
84 scoped_ptr<URLRequestInterceptor>(new Interceptor())); 84 std::unique_ptr<URLRequestInterceptor>(new Interceptor()));
85 } 85 }
86 86
87 // static 87 // static
88 size_t URLRequestSlowDownloadJob::NumberOutstandingRequests() { 88 size_t URLRequestSlowDownloadJob::NumberOutstandingRequests() {
89 return pending_requests_.Get().size(); 89 return pending_requests_.Get().size();
90 } 90 }
91 91
92 // static 92 // static
93 void URLRequestSlowDownloadJob::FinishPendingRequests() { 93 void URLRequestSlowDownloadJob::FinishPendingRequests() {
94 typedef std::set<URLRequestSlowDownloadJob*> JobList; 94 typedef std::set<URLRequestSlowDownloadJob*> JobList;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 info->headers = new HttpResponseHeaders(raw_headers); 272 info->headers = new HttpResponseHeaders(raw_headers);
273 } 273 }
274 274
275 bool URLRequestSlowDownloadJob::GetMimeType(std::string* mime_type) const { 275 bool URLRequestSlowDownloadJob::GetMimeType(std::string* mime_type) const {
276 HttpResponseInfo info; 276 HttpResponseInfo info;
277 GetResponseInfoConst(&info); 277 GetResponseInfoConst(&info);
278 return info.headers.get() && info.headers->GetMimeType(mime_type); 278 return info.headers.get() && info.headers->GetMimeType(mime_type);
279 } 279 }
280 280
281 } // namespace net 281 } // namespace net
OLDNEW
« no previous file with comments | « net/test/url_request/url_request_mock_http_job.cc ('k') | net/tools/balsa/balsa_frame_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698