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

Side by Side Diff: chrome/browser/safe_browsing/download_feedback_service.cc

Issue 1870003002: Convert //chrome/browser/safe_browsing from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and address comments 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/safe_browsing/download_feedback_service.h" 5 #include "chrome/browser/safe_browsing/download_feedback_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 DCHECK(!active_feedback_.empty()); 180 DCHECK(!active_feedback_.empty());
181 active_feedback_.front()->Start(base::Bind( 181 active_feedback_.front()->Start(base::Bind(
182 &DownloadFeedbackService::FeedbackComplete, base::Unretained(this))); 182 &DownloadFeedbackService::FeedbackComplete, base::Unretained(this)));
183 } 183 }
184 184
185 void DownloadFeedbackService::BeginFeedback( 185 void DownloadFeedbackService::BeginFeedback(
186 const std::string& ping_request, 186 const std::string& ping_request,
187 const std::string& ping_response, 187 const std::string& ping_response,
188 const base::FilePath& path) { 188 const base::FilePath& path) {
189 DCHECK(CalledOnValidThread()); 189 DCHECK(CalledOnValidThread());
190 scoped_ptr<DownloadFeedback> feedback( 190 std::unique_ptr<DownloadFeedback> feedback(DownloadFeedback::Create(
191 DownloadFeedback::Create(request_context_getter_.get(), 191 request_context_getter_.get(), file_task_runner_.get(), path,
192 file_task_runner_.get(), 192 ping_request, ping_response));
193 path,
194 ping_request,
195 ping_response));
196 active_feedback_.push_back(std::move(feedback)); 193 active_feedback_.push_back(std::move(feedback));
197 UMA_HISTOGRAM_COUNTS_100("SBDownloadFeedback.ActiveFeedbacks", 194 UMA_HISTOGRAM_COUNTS_100("SBDownloadFeedback.ActiveFeedbacks",
198 active_feedback_.size()); 195 active_feedback_.size());
199 196
200 if (active_feedback_.size() == 1) 197 if (active_feedback_.size() == 1)
201 StartPendingFeedback(); 198 StartPendingFeedback();
202 } 199 }
203 200
204 void DownloadFeedbackService::FeedbackComplete() { 201 void DownloadFeedbackService::FeedbackComplete() {
205 DVLOG(1) << __FUNCTION__; 202 DVLOG(1) << __FUNCTION__;
206 DCHECK(CalledOnValidThread()); 203 DCHECK(CalledOnValidThread());
207 DCHECK(!active_feedback_.empty()); 204 DCHECK(!active_feedback_.empty());
208 active_feedback_.erase(active_feedback_.begin()); 205 active_feedback_.erase(active_feedback_.begin());
209 if (!active_feedback_.empty()) 206 if (!active_feedback_.empty())
210 StartPendingFeedback(); 207 StartPendingFeedback();
211 } 208 }
212 209
213 } // namespace safe_browsing 210 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/download_feedback_service.h ('k') | chrome/browser/safe_browsing/download_protection_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698