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

Side by Side Diff: chrome/browser/sync_file_system/sync_file_system_service.cc

Issue 453673003: [SyncFS] Promote demoted changes in default remote side backend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix test expectation Created 6 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/sync_file_system_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/sync_file_system_service.h" 5 #include "chrome/browser/sync_file_system/sync_file_system_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/format_macros.h" 10 #include "base/format_macros.h"
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 iter != remote_sync_runners_.end(); ++iter) 361 iter != remote_sync_runners_.end(); ++iter)
362 remote_changes += (*iter)->pending_changes(); 362 remote_changes += (*iter)->pending_changes();
363 if (remote_changes == 0) 363 if (remote_changes == 0)
364 local_service_->PromoteDemotedChanges(NoopClosure()); 364 local_service_->PromoteDemotedChanges(NoopClosure());
365 365
366 int64 local_changes = 0; 366 int64 local_changes = 0;
367 for (ScopedVector<SyncProcessRunner>::iterator iter = 367 for (ScopedVector<SyncProcessRunner>::iterator iter =
368 local_sync_runners_.begin(); 368 local_sync_runners_.begin();
369 iter != local_sync_runners_.end(); ++iter) 369 iter != local_sync_runners_.end(); ++iter)
370 local_changes += (*iter)->pending_changes(); 370 local_changes += (*iter)->pending_changes();
371 if (local_changes == 0 && v2_remote_service_) 371 if (local_changes == 0) {
372 v2_remote_service_->PromoteDemotedChanges(NoopClosure()); 372 remote_service_->PromoteDemotedChanges(NoopClosure());
373 if (v2_remote_service_)
374 v2_remote_service_->PromoteDemotedChanges(NoopClosure());
375 }
373 } 376 }
374 377
375 SyncServiceState SyncFileSystemService::GetSyncServiceState() { 378 SyncServiceState SyncFileSystemService::GetSyncServiceState() {
376 // For now we always query the state from the main RemoteFileSyncService. 379 // For now we always query the state from the main RemoteFileSyncService.
377 return RemoteStateToSyncServiceState(remote_service_->GetCurrentState()); 380 return RemoteStateToSyncServiceState(remote_service_->GetCurrentState());
378 } 381 }
379 382
380 SyncFileSystemService* SyncFileSystemService::GetSyncService() { 383 SyncFileSystemService* SyncFileSystemService::GetSyncService() {
381 return this; 384 return this;
382 } 385 }
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
759 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get()); 762 v2_remote_service_->AddServiceObserver(v2_remote_syncer.get());
760 v2_remote_service_->AddFileStatusObserver(this); 763 v2_remote_service_->AddFileStatusObserver(this);
761 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get()); 764 v2_remote_service_->SetRemoteChangeProcessor(local_service_.get());
762 v2_remote_service_->SetSyncEnabled(sync_enabled_); 765 v2_remote_service_->SetSyncEnabled(sync_enabled_);
763 remote_sync_runners_.push_back(v2_remote_syncer.release()); 766 remote_sync_runners_.push_back(v2_remote_syncer.release());
764 } 767 }
765 return v2_remote_service_.get(); 768 return v2_remote_service_.get();
766 } 769 }
767 770
768 } // namespace sync_file_system 771 } // namespace sync_file_system
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync_file_system/sync_file_system_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698