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

Side by Side Diff: components/drive/chromeos/file_system/search_operation.cc

Issue 2613223002: Remove ScopedVector from base::JSONValueConverter (Closed)
Patch Set: Created 3 years, 11 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 "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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698