| 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 "components/drive/sync/entry_update_performer.h" | 5 #include "components/drive/sync/entry_update_performer.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include <set> | 9 #include <set> |
| 8 | 10 |
| 9 #include "base/callback_helpers.h" | 11 #include "base/callback_helpers.h" |
| 10 #include "base/files/file_util.h" | 12 #include "base/files/file_util.h" |
| 11 #include "components/drive/change_list_loader.h" | 13 #include "components/drive/change_list_loader.h" |
| 12 #include "components/drive/drive.pb.h" | 14 #include "components/drive/drive.pb.h" |
| 13 #include "components/drive/file_cache.h" | 15 #include "components/drive/file_cache.h" |
| 14 #include "components/drive/file_change.h" | 16 #include "components/drive/file_change.h" |
| 15 #include "components/drive/file_system/operation_delegate.h" | 17 #include "components/drive/file_system/operation_delegate.h" |
| 16 #include "components/drive/file_system_core_util.h" | 18 #include "components/drive/file_system_core_util.h" |
| 17 #include "components/drive/job_scheduler.h" | 19 #include "components/drive/job_scheduler.h" |
| 18 #include "components/drive/resource_metadata.h" | 20 #include "components/drive/resource_metadata.h" |
| 19 #include "components/drive/sync/entry_revert_performer.h" | 21 #include "components/drive/sync/entry_revert_performer.h" |
| 20 #include "components/drive/sync/remove_performer.h" | 22 #include "components/drive/sync/remove_performer.h" |
| 21 #include "google_apis/drive/drive_api_parser.h" | 23 #include "google_apis/drive/drive_api_parser.h" |
| 22 | 24 |
| 23 namespace drive { | 25 namespace drive { |
| 24 namespace internal { | 26 namespace internal { |
| 25 | 27 |
| 26 struct EntryUpdatePerformer::LocalState { | 28 struct EntryUpdatePerformer::LocalState { |
| 27 LocalState() : cache_file_size(0), should_content_update(false) {} | 29 LocalState() : cache_file_size(0), should_content_update(false) {} |
| 28 | 30 |
| 29 ResourceEntry entry; | 31 ResourceEntry entry; |
| 30 ResourceEntry parent_entry; | 32 ResourceEntry parent_entry; |
| 31 base::FilePath drive_file_path; | 33 base::FilePath drive_file_path; |
| 32 base::FilePath cache_file_path; | 34 base::FilePath cache_file_path; |
| 33 int64 cache_file_size; | 35 int64_t cache_file_size; |
| 34 bool should_content_update; | 36 bool should_content_update; |
| 35 }; | 37 }; |
| 36 | 38 |
| 37 namespace { | 39 namespace { |
| 38 | 40 |
| 39 struct PropertyCompare { | 41 struct PropertyCompare { |
| 40 bool operator()(const drive::Property& x, const drive::Property& y) const { | 42 bool operator()(const drive::Property& x, const drive::Property& y) const { |
| 41 if (x.key() < y.key()) | 43 if (x.key() < y.key()) |
| 42 return true; | 44 return true; |
| 43 if (x.key() > y.key()) | 45 if (x.key() > y.key()) |
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 FileError error) { | 443 FileError error) { |
| 442 DCHECK(thread_checker_.CalledOnValidThread()); | 444 DCHECK(thread_checker_.CalledOnValidThread()); |
| 443 DCHECK(!callback.is_null()); | 445 DCHECK(!callback.is_null()); |
| 444 | 446 |
| 445 delegate_->OnFileChangedByOperation(*changed_files); | 447 delegate_->OnFileChangedByOperation(*changed_files); |
| 446 callback.Run(error); | 448 callback.Run(error); |
| 447 } | 449 } |
| 448 | 450 |
| 449 } // namespace internal | 451 } // namespace internal |
| 450 } // namespace drive | 452 } // namespace drive |
| OLD | NEW |