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

Side by Side Diff: chrome/browser/chromeos/drive/file_system/search_operation.cc

Issue 278273002: drive: Change the return type of ResourceMetadata's methods to FileError (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
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/chromeos/drive/file_system/search_operation.h" 5 #include "chrome/browser/chromeos/drive/file_system/search_operation.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // directory in order to assign a path, which is needed to access the 60 // directory in order to assign a path, which is needed to access the
61 // file through FileSystem API. 61 // file through FileSystem API.
62 // 62 //
63 // It will be moved to the right place when the metadata gets synced 63 // It will be moved to the right place when the metadata gets synced
64 // in normal loading process in ChangeListProcessor. 64 // in normal loading process in ChangeListProcessor.
65 entry.set_parent_local_id(util::kDriveOtherDirLocalId); 65 entry.set_parent_local_id(util::kDriveOtherDirLocalId);
66 error = resource_metadata->AddEntry(entry, &local_id); 66 error = resource_metadata->AddEntry(entry, &local_id);
67 } 67 }
68 if (error != FILE_ERROR_OK) 68 if (error != FILE_ERROR_OK)
69 return error; 69 return error;
70 result->push_back( 70 base::FilePath path;
71 SearchResultInfo(resource_metadata->GetFilePath(local_id), 71 error = resource_metadata->GetFilePath(local_id, &path);
72 entry.file_info().is_directory())); 72 if (error != FILE_ERROR_OK)
73 return error;
74 result->push_back(SearchResultInfo(path, entry.file_info().is_directory()));
73 } 75 }
74 76
75 return FILE_ERROR_OK; 77 return FILE_ERROR_OK;
76 } 78 }
77 79
78 } // namespace 80 } // namespace
79 81
80 SearchOperation::SearchOperation( 82 SearchOperation::SearchOperation(
81 base::SequencedTaskRunner* blocking_task_runner, 83 base::SequencedTaskRunner* blocking_task_runner,
82 JobScheduler* scheduler, 84 JobScheduler* scheduler,
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 if (error != FILE_ERROR_OK) { 174 if (error != FILE_ERROR_OK) {
173 callback.Run(error, GURL(), scoped_ptr<std::vector<SearchResultInfo> >()); 175 callback.Run(error, GURL(), scoped_ptr<std::vector<SearchResultInfo> >());
174 return; 176 return;
175 } 177 }
176 178
177 callback.Run(error, next_link, result.Pass()); 179 callback.Run(error, next_link, result.Pass());
178 } 180 }
179 181
180 } // namespace file_system 182 } // namespace file_system
181 } // namespace drive 183 } // namespace drive
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/drive/file_system/remove_operation.cc ('k') | chrome/browser/chromeos/drive/resource_metadata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698