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/conflict_resolver.h" | 5 #include "chrome/browser/sync_file_system/drive_backend/conflict_resolver.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include "base/callback.h" | 9 #include "base/callback.h" |
8 #include "base/format_macros.h" | 10 #include "base/format_macros.h" |
9 #include "base/location.h" | 11 #include "base/location.h" |
10 #include "base/logging.h" | 12 #include "base/logging.h" |
11 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
12 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h" | 14 #include "chrome/browser/sync_file_system/drive_backend/drive_backend_util.h" |
13 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" | 15 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.h" |
14 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.pb.h" | 16 #include "chrome/browser/sync_file_system/drive_backend/metadata_database.pb.h" |
15 #include "chrome/browser/sync_file_system/drive_backend/sync_engine_context.h" | 17 #include "chrome/browser/sync_file_system/drive_backend/sync_engine_context.h" |
16 #include "chrome/browser/sync_file_system/drive_backend/sync_task_manager.h" | 18 #include "chrome/browser/sync_file_system/drive_backend/sync_task_manager.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 } | 91 } |
90 parents_to_remove_.push_back(parent_tracker.file_id()); | 92 parents_to_remove_.push_back(parent_tracker.file_id()); |
91 } | 93 } |
92 DetachFromNonPrimaryParents(token.Pass()); | 94 DetachFromNonPrimaryParents(token.Pass()); |
93 return; | 95 return; |
94 } | 96 } |
95 | 97 |
96 if (metadata_database()->GetConflictingTrackers(&trackers)) { | 98 if (metadata_database()->GetConflictingTrackers(&trackers)) { |
97 target_file_id_ = PickPrimaryFile(trackers); | 99 target_file_id_ = PickPrimaryFile(trackers); |
98 DCHECK(!target_file_id_.empty()); | 100 DCHECK(!target_file_id_.empty()); |
99 int64 primary_tracker_id = -1; | 101 int64_t primary_tracker_id = -1; |
100 for (TrackerIDSet::const_iterator itr = trackers.begin(); | 102 for (TrackerIDSet::const_iterator itr = trackers.begin(); |
101 itr != trackers.end(); ++itr) { | 103 itr != trackers.end(); ++itr) { |
102 FileTracker tracker; | 104 FileTracker tracker; |
103 if (!metadata_database()->FindTrackerByTrackerID(*itr, &tracker)) { | 105 if (!metadata_database()->FindTrackerByTrackerID(*itr, &tracker)) { |
104 NOTREACHED(); | 106 NOTREACHED(); |
105 continue; | 107 continue; |
106 } | 108 } |
107 if (tracker.file_id() != target_file_id_) { | 109 if (tracker.file_id() != target_file_id_) { |
108 non_primary_file_ids_.push_back( | 110 non_primary_file_ids_.push_back( |
109 std::make_pair(tracker.file_id(), tracker.synced_details().etag())); | 111 std::make_pair(tracker.file_id(), tracker.synced_details().etag())); |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 set_used_network(true); | 321 set_used_network(true); |
320 return sync_context_->GetDriveService(); | 322 return sync_context_->GetDriveService(); |
321 } | 323 } |
322 | 324 |
323 MetadataDatabase* ConflictResolver::metadata_database() { | 325 MetadataDatabase* ConflictResolver::metadata_database() { |
324 return sync_context_->GetMetadataDatabase(); | 326 return sync_context_->GetMetadataDatabase(); |
325 } | 327 } |
326 | 328 |
327 } // namespace drive_backend | 329 } // namespace drive_backend |
328 } // namespace sync_file_system | 330 } // namespace sync_file_system |
OLD | NEW |