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

Side by Side Diff: chrome/browser/sync_file_system/drive_backend/register_app_task.cc

Issue 558603002: [SyncFS] Make MetadataDatabase operations synchronous (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@01_create
Patch Set: +TODO Created 6 years, 3 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 "chrome/browser/sync_file_system/drive_backend/register_app_task.h" 5 #include "chrome/browser/sync_file_system/drive_backend/register_app_task.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "chrome/browser/drive/drive_api_util.h" 9 #include "chrome/browser/drive/drive_api_util.h"
10 #include "chrome/browser/drive/drive_service_interface.h" 10 #include "chrome/browser/drive/drive_service_interface.h"
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 if (!oldest_tracker) 161 if (!oldest_tracker)
162 return false; 162 return false;
163 163
164 *candidate = *oldest_tracker; 164 *candidate = *oldest_tracker;
165 return true; 165 return true;
166 } 166 }
167 167
168 void RegisterAppTask::RegisterAppIntoDatabase( 168 void RegisterAppTask::RegisterAppIntoDatabase(
169 const FileTracker& tracker, 169 const FileTracker& tracker,
170 const SyncStatusCallback& callback) { 170 const SyncStatusCallback& callback) {
171 metadata_database()->RegisterApp( 171 SyncStatusCode status =
172 app_id_, tracker.file_id(), callback); 172 metadata_database()->RegisterApp(app_id_, tracker.file_id());
173 callback.Run(status);
173 } 174 }
174 175
175 MetadataDatabase* RegisterAppTask::metadata_database() { 176 MetadataDatabase* RegisterAppTask::metadata_database() {
176 return sync_context_->GetMetadataDatabase(); 177 return sync_context_->GetMetadataDatabase();
177 } 178 }
178 179
179 drive::DriveServiceInterface* RegisterAppTask::drive_service() { 180 drive::DriveServiceInterface* RegisterAppTask::drive_service() {
180 return sync_context_->GetDriveService(); 181 return sync_context_->GetDriveService();
181 } 182 }
182 183
183 } // namespace drive_backend 184 } // namespace drive_backend
184 } // namespace sync_file_system 185 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698