OLD | NEW |
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> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/metrics/histogram_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
9 #include "base/metrics/sparse_histogram.h" | 11 #include "base/metrics/sparse_histogram.h" |
10 #include "google_apis/drive/drive_api_error_codes.h" | 12 #include "google_apis/drive/drive_api_error_codes.h" |
11 #include "google_apis/drive/drive_api_requests.h" | 13 #include "google_apis/drive/drive_api_requests.h" |
12 #include "google_apis/drive/request_sender.h" | 14 #include "google_apis/drive/request_sender.h" |
13 | 15 |
14 namespace google_apis { | 16 namespace google_apis { |
15 | 17 |
16 FilesListRequestRunner::FilesListRequestRunner( | 18 FilesListRequestRunner::FilesListRequestRunner( |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 request_completed_callback_for_testing_.Run(); | 68 request_completed_callback_for_testing_.Run(); |
67 | 69 |
68 UMA_HISTOGRAM_SPARSE_SLOWLY( | 70 UMA_HISTOGRAM_SPARSE_SLOWLY( |
69 "Drive.FilesListRequestRunner.ApiErrorCode", error); | 71 "Drive.FilesListRequestRunner.ApiErrorCode", error); |
70 | 72 |
71 if (error == google_apis::DRIVE_RESPONSE_TOO_LARGE && max_results > 1) { | 73 if (error == google_apis::DRIVE_RESPONSE_TOO_LARGE && max_results > 1) { |
72 CreateAndStartWithSizeBackoff(max_results / 2, q, fields, callback); | 74 CreateAndStartWithSizeBackoff(max_results / 2, q, fields, callback); |
73 return; | 75 return; |
74 } | 76 } |
75 | 77 |
76 callback.Run(error, entry.Pass()); | 78 callback.Run(error, std::move(entry)); |
77 } | 79 } |
78 | 80 |
79 void FilesListRequestRunner::SetRequestCompletedCallbackForTesting( | 81 void FilesListRequestRunner::SetRequestCompletedCallbackForTesting( |
80 const base::Closure& callback) { | 82 const base::Closure& callback) { |
81 request_completed_callback_for_testing_ = callback; | 83 request_completed_callback_for_testing_ = callback; |
82 } | 84 } |
83 | 85 |
84 } // namespace google_apis | 86 } // namespace google_apis |
OLD | NEW |