OLD | NEW |
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 "components/drive/chromeos/file_system/search_operation.h" | 5 #include "components/drive/chromeos/file_system/search_operation.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 19 matching lines...) Expand all Loading... |
30 // and stores to |result|, by using |resource_metadata|. If the metadata is not | 30 // and stores to |result|, by using |resource_metadata|. If the metadata is not |
31 // up to date and did not contain an item, adds the item to "drive/other" for | 31 // up to date and did not contain an item, adds the item to "drive/other" for |
32 // temporally assigning a path. | 32 // temporally assigning a path. |
33 FileError ResolveSearchResultOnBlockingPool( | 33 FileError ResolveSearchResultOnBlockingPool( |
34 internal::ResourceMetadata* resource_metadata, | 34 internal::ResourceMetadata* resource_metadata, |
35 std::unique_ptr<google_apis::FileList> file_list, | 35 std::unique_ptr<google_apis::FileList> file_list, |
36 std::vector<SearchResultInfo>* result) { | 36 std::vector<SearchResultInfo>* result) { |
37 DCHECK(resource_metadata); | 37 DCHECK(resource_metadata); |
38 DCHECK(result); | 38 DCHECK(result); |
39 | 39 |
40 const ScopedVector<google_apis::FileResource>& entries = file_list->items(); | 40 const std::vector<std::unique_ptr<google_apis::FileResource>>& entries = |
| 41 file_list->items(); |
41 result->reserve(entries.size()); | 42 result->reserve(entries.size()); |
42 for (size_t i = 0; i < entries.size(); ++i) { | 43 for (size_t i = 0; i < entries.size(); ++i) { |
43 std::string local_id; | 44 std::string local_id; |
44 FileError error = resource_metadata->GetIdByResourceId( | 45 FileError error = resource_metadata->GetIdByResourceId( |
45 entries[i]->file_id(), &local_id); | 46 entries[i]->file_id(), &local_id); |
46 | 47 |
47 ResourceEntry entry; | 48 ResourceEntry entry; |
48 if (error == FILE_ERROR_OK) | 49 if (error == FILE_ERROR_OK) |
49 error = resource_metadata->GetResourceEntryById(local_id, &entry); | 50 error = resource_metadata->GetResourceEntryById(local_id, &entry); |
50 | 51 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 callback.Run(error, GURL(), | 171 callback.Run(error, GURL(), |
171 std::unique_ptr<std::vector<SearchResultInfo>>()); | 172 std::unique_ptr<std::vector<SearchResultInfo>>()); |
172 return; | 173 return; |
173 } | 174 } |
174 | 175 |
175 callback.Run(error, next_link, std::move(result)); | 176 callback.Run(error, next_link, std::move(result)); |
176 } | 177 } |
177 | 178 |
178 } // namespace file_system | 179 } // namespace file_system |
179 } // namespace drive | 180 } // namespace drive |
OLD | NEW |