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

Side by Side Diff: google_apis/drive/files_list_request_runner.cc

Issue 1873663002: Convert //google_apis from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "google_apis/drive/files_list_request_runner.h" 5 #include "google_apis/drive/files_list_request_runner.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 DCHECK(!cancel_callback->is_null()); 56 DCHECK(!cancel_callback->is_null());
57 cancel_callback->Run(); 57 cancel_callback->Run();
58 } 58 }
59 59
60 void FilesListRequestRunner::OnCompleted(int max_results, 60 void FilesListRequestRunner::OnCompleted(int max_results,
61 const std::string& q, 61 const std::string& q,
62 const std::string& fields, 62 const std::string& fields,
63 const FileListCallback& callback, 63 const FileListCallback& callback,
64 CancelCallback* cancel_callback, 64 CancelCallback* cancel_callback,
65 DriveApiErrorCode error, 65 DriveApiErrorCode error,
66 scoped_ptr<FileList> entry) { 66 std::unique_ptr<FileList> entry) {
67 if (!request_completed_callback_for_testing_.is_null()) 67 if (!request_completed_callback_for_testing_.is_null())
68 request_completed_callback_for_testing_.Run(); 68 request_completed_callback_for_testing_.Run();
69 69
70 UMA_HISTOGRAM_SPARSE_SLOWLY( 70 UMA_HISTOGRAM_SPARSE_SLOWLY(
71 "Drive.FilesListRequestRunner.ApiErrorCode", error); 71 "Drive.FilesListRequestRunner.ApiErrorCode", error);
72 72
73 if (error == google_apis::DRIVE_RESPONSE_TOO_LARGE && max_results > 1) { 73 if (error == google_apis::DRIVE_RESPONSE_TOO_LARGE && max_results > 1) {
74 CreateAndStartWithSizeBackoff(max_results / 2, q, fields, callback); 74 CreateAndStartWithSizeBackoff(max_results / 2, q, fields, callback);
75 return; 75 return;
76 } 76 }
77 77
78 callback.Run(error, std::move(entry)); 78 callback.Run(error, std::move(entry));
79 } 79 }
80 80
81 void FilesListRequestRunner::SetRequestCompletedCallbackForTesting( 81 void FilesListRequestRunner::SetRequestCompletedCallbackForTesting(
82 const base::Closure& callback) { 82 const base::Closure& callback) {
83 request_completed_callback_for_testing_ = callback; 83 request_completed_callback_for_testing_ = callback;
84 } 84 }
85 85
86 } // namespace google_apis 86 } // namespace google_apis
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698