| 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 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 | 480 |
| 481 DCHECK(remote_metadata_); | 481 DCHECK(remote_metadata_); |
| 482 DCHECK(remote_metadata_->has_details()); | 482 DCHECK(remote_metadata_->has_details()); |
| 483 DCHECK(!remote_metadata_->details().deleted()); | 483 DCHECK(!remote_metadata_->details().deleted()); |
| 484 | 484 |
| 485 DCHECK_EQ(dirty_tracker_->synced_details().file_kind(), | 485 DCHECK_EQ(dirty_tracker_->synced_details().file_kind(), |
| 486 remote_metadata_->details().file_kind()); | 486 remote_metadata_->details().file_kind()); |
| 487 DCHECK_NE(dirty_tracker_->synced_details().title(), | 487 DCHECK_NE(dirty_tracker_->synced_details().title(), |
| 488 remote_metadata_->details().title()); | 488 remote_metadata_->details().title()); |
| 489 | 489 |
| 490 NOTIMPLEMENTED(); | 490 Prepare(base::Bind(&RemoteToLocalSyncer::DidPrepareForDeletion, |
| 491 callback.Run(SYNC_STATUS_FAILED); | 491 weak_ptr_factory_.GetWeakPtr(), callback)); |
| 492 } | 492 } |
| 493 | 493 |
| 494 void RemoteToLocalSyncer::HandleReorganize( | 494 void RemoteToLocalSyncer::HandleReorganize( |
| 495 const SyncStatusCallback& callback) { | 495 const SyncStatusCallback& callback) { |
| 496 DCHECK(dirty_tracker_); | 496 DCHECK(dirty_tracker_); |
| 497 DCHECK(dirty_tracker_->active()); | 497 DCHECK(dirty_tracker_->active()); |
| 498 DCHECK(!HasDisabledAppRoot(metadata_database(), *dirty_tracker_)); | 498 DCHECK(!HasDisabledAppRoot(metadata_database(), *dirty_tracker_)); |
| 499 DCHECK(dirty_tracker_->has_synced_details()); | 499 DCHECK(dirty_tracker_->has_synced_details()); |
| 500 DCHECK(!dirty_tracker_->synced_details().deleted()); | 500 DCHECK(!dirty_tracker_->synced_details().deleted()); |
| 501 | 501 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 } | 589 } |
| 590 | 590 |
| 591 if (status != SYNC_STATUS_OK) { | 591 if (status != SYNC_STATUS_OK) { |
| 592 callback.Run(status); | 592 callback.Run(status); |
| 593 return; | 593 return; |
| 594 } | 594 } |
| 595 | 595 |
| 596 DCHECK(dirty_tracker_); | 596 DCHECK(dirty_tracker_); |
| 597 DCHECK(remote_metadata_); | 597 DCHECK(remote_metadata_); |
| 598 DCHECK(remote_metadata_->has_details()); | 598 DCHECK(remote_metadata_->has_details()); |
| 599 |
| 599 metadata_database()->UpdateTracker(dirty_tracker_->tracker_id(), | 600 metadata_database()->UpdateTracker(dirty_tracker_->tracker_id(), |
| 600 remote_metadata_->details(), | 601 remote_metadata_->details(), |
| 601 callback); | 602 callback); |
| 602 } | 603 } |
| 603 | 604 |
| 604 void RemoteToLocalSyncer::Prepare(const SyncStatusCallback& callback) { | 605 void RemoteToLocalSyncer::Prepare(const SyncStatusCallback& callback) { |
| 605 bool should_success = BuildFileSystemURL( | 606 bool should_success = BuildFileSystemURL( |
| 606 metadata_database(), *dirty_tracker_, &url_); | 607 metadata_database(), *dirty_tracker_, &url_); |
| 607 DCHECK(should_success); | 608 DCHECK(should_success); |
| 608 DCHECK(url_.is_valid()); | 609 DCHECK(url_.is_valid()); |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 769 return sync_context_->GetMetadataDatabase(); | 770 return sync_context_->GetMetadataDatabase(); |
| 770 } | 771 } |
| 771 | 772 |
| 772 RemoteChangeProcessor* RemoteToLocalSyncer::remote_change_processor() { | 773 RemoteChangeProcessor* RemoteToLocalSyncer::remote_change_processor() { |
| 773 DCHECK(sync_context_->GetRemoteChangeProcessor()); | 774 DCHECK(sync_context_->GetRemoteChangeProcessor()); |
| 774 return sync_context_->GetRemoteChangeProcessor(); | 775 return sync_context_->GetRemoteChangeProcessor(); |
| 775 } | 776 } |
| 776 | 777 |
| 777 } // namespace drive_backend | 778 } // namespace drive_backend |
| 778 } // namespace sync_file_system | 779 } // namespace sync_file_system |
| OLD | NEW |