| 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/local/local_file_change_tracker.h" | 5 #include "chrome/browser/sync_file_system/local/local_file_change_tracker.h" |
| 6 | 6 |
| 7 #include <queue> | 7 #include <queue> |
| 8 | 8 |
| 9 #include "base/location.h" | 9 #include "base/location.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 } | 408 } |
| 409 return SYNC_STATUS_OK; | 409 return SYNC_STATUS_OK; |
| 410 } | 410 } |
| 411 | 411 |
| 412 void LocalFileChangeTracker::RecordChange( | 412 void LocalFileChangeTracker::RecordChange( |
| 413 const FileSystemURL& url, const FileChange& change) { | 413 const FileSystemURL& url, const FileChange& change) { |
| 414 DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); | 414 DCHECK(file_task_runner_->RunsTasksOnCurrentThread()); |
| 415 int change_seq = current_change_seq_number_++; | 415 int change_seq = current_change_seq_number_++; |
| 416 if (ContainsKey(demoted_changes_, url)) { | 416 if (ContainsKey(demoted_changes_, url)) { |
| 417 RecordChangeToChangeMaps(url, change, change_seq, | 417 RecordChangeToChangeMaps(url, change, change_seq, |
| 418 &demoted_changes_, NULL); | 418 &demoted_changes_, nullptr); |
| 419 } else { | 419 } else { |
| 420 RecordChangeToChangeMaps(url, change, change_seq, &changes_, &change_seqs_); | 420 RecordChangeToChangeMaps(url, change, change_seq, &changes_, &change_seqs_); |
| 421 } | 421 } |
| 422 if (ContainsKey(mirror_changes_, url)) | 422 if (ContainsKey(mirror_changes_, url)) { |
| 423 RecordChangeToChangeMaps(url, change, change_seq, &mirror_changes_, NULL); | 423 RecordChangeToChangeMaps(url, change, change_seq, &mirror_changes_, |
| 424 nullptr); |
| 425 } |
| 424 UpdateNumChanges(); | 426 UpdateNumChanges(); |
| 425 } | 427 } |
| 426 | 428 |
| 427 // static | 429 // static |
| 428 void LocalFileChangeTracker::RecordChangeToChangeMaps( | 430 void LocalFileChangeTracker::RecordChangeToChangeMaps( |
| 429 const FileSystemURL& url, | 431 const FileSystemURL& url, |
| 430 const FileChange& change, | 432 const FileChange& change, |
| 431 int new_change_seq, | 433 int new_change_seq, |
| 432 FileChangeMap* changes, | 434 FileChangeMap* changes, |
| 433 ChangeSeqMap* change_seqs) { | 435 ChangeSeqMap* change_seqs) { |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 if (!status.ok() && !status.IsNotFound()) { | 609 if (!status.ok() && !status.IsNotFound()) { |
| 608 HandleError(FROM_HERE, status); | 610 HandleError(FROM_HERE, status); |
| 609 db_status_ = LevelDBStatusToSyncStatusCode(status); | 611 db_status_ = LevelDBStatusToSyncStatusCode(status); |
| 610 db_.reset(); | 612 db_.reset(); |
| 611 return db_status_; | 613 return db_status_; |
| 612 } | 614 } |
| 613 return SYNC_STATUS_OK; | 615 return SYNC_STATUS_OK; |
| 614 } | 616 } |
| 615 | 617 |
| 616 } // namespace sync_file_system | 618 } // namespace sync_file_system |
| OLD | NEW |