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

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

Issue 407073003: [SyncFS] Add completion callback to PromoteDemotedChanges (1/3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/fake_sync_worker.h" 5 #include "chrome/browser/sync_file_system/drive_backend/fake_sync_worker.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants. h" 8 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_constants. h"
9 #include "chrome/browser/sync_file_system/drive_backend/sync_engine_context.h" 9 #include "chrome/browser/sync_file_system/drive_backend/sync_engine_context.h"
10 #include "chrome/browser/sync_file_system/sync_status_code.h" 10 #include "chrome/browser/sync_file_system/sync_status_code.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 void FakeSyncWorker::SetSyncEnabled(bool enabled) { 123 void FakeSyncWorker::SetSyncEnabled(bool enabled) {
124 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); 124 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
125 sync_enabled_ = enabled; 125 sync_enabled_ = enabled;
126 126
127 if (enabled) 127 if (enabled)
128 UpdateServiceState(REMOTE_SERVICE_OK, "Set FakeSyncWorker enabled."); 128 UpdateServiceState(REMOTE_SERVICE_OK, "Set FakeSyncWorker enabled.");
129 else 129 else
130 UpdateServiceState(REMOTE_SERVICE_DISABLED, "Disabled FakeSyncWorker."); 130 UpdateServiceState(REMOTE_SERVICE_DISABLED, "Disabled FakeSyncWorker.");
131 } 131 }
132 132
133 void FakeSyncWorker::PromoteDemotedChanges() { 133 void FakeSyncWorker::PromoteDemotedChanges(const base::Closure& callback) {
134 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); 134 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
135 FOR_EACH_OBSERVER( 135 FOR_EACH_OBSERVER(
136 Observer, 136 Observer,
137 observers_, 137 observers_,
138 OnPendingFileListUpdated(10)); 138 OnPendingFileListUpdated(10));
139 callback.Run();
139 } 140 }
140 141
141 void FakeSyncWorker::ApplyLocalChange( 142 void FakeSyncWorker::ApplyLocalChange(
142 const FileChange& local_change, 143 const FileChange& local_change,
143 const base::FilePath& local_path, 144 const base::FilePath& local_path,
144 const SyncFileMetadata& local_metadata, 145 const SyncFileMetadata& local_metadata,
145 const fileapi::FileSystemURL& url, 146 const fileapi::FileSystemURL& url,
146 const SyncStatusCallback& callback) { 147 const SyncStatusCallback& callback) {
147 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); 148 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
148 callback.Run(SYNC_STATUS_OK); 149 callback.Run(SYNC_STATUS_OK);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 const std::string& description) { 197 const std::string& description) {
197 DCHECK(sequence_checker_.CalledOnValidSequencedThread()); 198 DCHECK(sequence_checker_.CalledOnValidSequencedThread());
198 199
199 FOR_EACH_OBSERVER( 200 FOR_EACH_OBSERVER(
200 Observer, observers_, 201 Observer, observers_,
201 UpdateServiceState(state, description)); 202 UpdateServiceState(state, description));
202 } 203 }
203 204
204 } // namespace drive_backend 205 } // namespace drive_backend
205 } // namespace sync_file_system 206 } // namespace sync_file_system
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698