| OLD | NEW |
| 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/remote_to_local_syncer.h
" | 5 #include "chrome/browser/sync_file_system/drive_backend/remote_to_local_syncer.h
" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 479 | 479 |
| 480 DCHECK(remote_metadata_); | 480 DCHECK(remote_metadata_); |
| 481 DCHECK(remote_metadata_->has_details()); | 481 DCHECK(remote_metadata_->has_details()); |
| 482 DCHECK(!remote_metadata_->details().deleted()); | 482 DCHECK(!remote_metadata_->details().deleted()); |
| 483 | 483 |
| 484 DCHECK_EQ(dirty_tracker_->synced_details().file_kind(), | 484 DCHECK_EQ(dirty_tracker_->synced_details().file_kind(), |
| 485 remote_metadata_->details().file_kind()); | 485 remote_metadata_->details().file_kind()); |
| 486 DCHECK_NE(dirty_tracker_->synced_details().title(), | 486 DCHECK_NE(dirty_tracker_->synced_details().title(), |
| 487 remote_metadata_->details().title()); | 487 remote_metadata_->details().title()); |
| 488 | 488 |
| 489 NOTIMPLEMENTED(); | 489 Prepare(base::Bind(&RemoteToLocalSyncer::DidPrepareForDeletion, |
| 490 callback.Run(SYNC_STATUS_FAILED); | 490 weak_ptr_factory_.GetWeakPtr(), callback)); |
| 491 } | 491 } |
| 492 | 492 |
| 493 void RemoteToLocalSyncer::HandleReorganize( | 493 void RemoteToLocalSyncer::HandleReorganize( |
| 494 const SyncStatusCallback& callback) { | 494 const SyncStatusCallback& callback) { |
| 495 DCHECK(dirty_tracker_); | 495 DCHECK(dirty_tracker_); |
| 496 DCHECK(dirty_tracker_->active()); | 496 DCHECK(dirty_tracker_->active()); |
| 497 DCHECK(!HasDisabledAppRoot(metadata_database(), *dirty_tracker_)); | 497 DCHECK(!HasDisabledAppRoot(metadata_database(), *dirty_tracker_)); |
| 498 DCHECK(dirty_tracker_->has_synced_details()); | 498 DCHECK(dirty_tracker_->has_synced_details()); |
| 499 DCHECK(!dirty_tracker_->synced_details().deleted()); | 499 DCHECK(!dirty_tracker_->synced_details().deleted()); |
| 500 | 500 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 588 } | 588 } |
| 589 | 589 |
| 590 if (status != SYNC_STATUS_OK) { | 590 if (status != SYNC_STATUS_OK) { |
| 591 callback.Run(status); | 591 callback.Run(status); |
| 592 return; | 592 return; |
| 593 } | 593 } |
| 594 | 594 |
| 595 DCHECK(dirty_tracker_); | 595 DCHECK(dirty_tracker_); |
| 596 DCHECK(remote_metadata_); | 596 DCHECK(remote_metadata_); |
| 597 DCHECK(remote_metadata_->has_details()); | 597 DCHECK(remote_metadata_->has_details()); |
| 598 |
| 598 metadata_database()->UpdateTracker(dirty_tracker_->tracker_id(), | 599 metadata_database()->UpdateTracker(dirty_tracker_->tracker_id(), |
| 599 remote_metadata_->details(), | 600 remote_metadata_->details(), |
| 600 callback); | 601 callback); |
| 601 } | 602 } |
| 602 | 603 |
| 603 void RemoteToLocalSyncer::Prepare(const SyncStatusCallback& callback) { | 604 void RemoteToLocalSyncer::Prepare(const SyncStatusCallback& callback) { |
| 604 bool should_success = BuildFileSystemURL( | 605 bool should_success = BuildFileSystemURL( |
| 605 metadata_database(), *dirty_tracker_, &url_); | 606 metadata_database(), *dirty_tracker_, &url_); |
| 606 DCHECK(should_success); | 607 DCHECK(should_success); |
| 607 DCHECK(url_.is_valid()); | 608 DCHECK(url_.is_valid()); |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 739 return sync_context_->GetMetadataDatabase(); | 740 return sync_context_->GetMetadataDatabase(); |
| 740 } | 741 } |
| 741 | 742 |
| 742 RemoteChangeProcessor* RemoteToLocalSyncer::remote_change_processor() { | 743 RemoteChangeProcessor* RemoteToLocalSyncer::remote_change_processor() { |
| 743 DCHECK(sync_context_->GetRemoteChangeProcessor()); | 744 DCHECK(sync_context_->GetRemoteChangeProcessor()); |
| 744 return sync_context_->GetRemoteChangeProcessor(); | 745 return sync_context_->GetRemoteChangeProcessor(); |
| 745 } | 746 } |
| 746 | 747 |
| 747 } // namespace drive_backend | 748 } // namespace drive_backend |
| 748 } // namespace sync_file_system | 749 } // namespace sync_file_system |
| OLD | NEW |