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 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CONFLICT_RESOLVER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CONFLICT_RESOLVER_H_ |
6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CONFLICT_RESOLVER_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CONFLICT_RESOLVER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 24 matching lines...) Expand all Loading... |
35 // ConflictResolver detaches the file from all parents other than the parent | 35 // ConflictResolver detaches the file from all parents other than the parent |
36 // of the active tracker. | 36 // of the active tracker. |
37 // If multiple trackers have the same local path or the same remote file, | 37 // If multiple trackers have the same local path or the same remote file, |
38 // ConflictResolver picks up one of them and delete others. | 38 // ConflictResolver picks up one of them and delete others. |
39 class ConflictResolver : public SyncTask { | 39 class ConflictResolver : public SyncTask { |
40 public: | 40 public: |
41 typedef std::vector<std::string> FileIDList; | 41 typedef std::vector<std::string> FileIDList; |
42 | 42 |
43 explicit ConflictResolver(SyncEngineContext* sync_context); | 43 explicit ConflictResolver(SyncEngineContext* sync_context); |
44 virtual ~ConflictResolver(); | 44 virtual ~ConflictResolver(); |
45 virtual void RunPreflight(scoped_ptr<SyncTaskToken> token) OVERRIDE; | 45 virtual void RunPreflight(scoped_ptr<SyncTaskToken> token) override; |
46 void RunExclusive(scoped_ptr<SyncTaskToken> token); | 46 void RunExclusive(scoped_ptr<SyncTaskToken> token); |
47 | 47 |
48 private: | 48 private: |
49 typedef std::pair<std::string, std::string> FileIDAndETag; | 49 typedef std::pair<std::string, std::string> FileIDAndETag; |
50 | 50 |
51 void DetachFromNonPrimaryParents(scoped_ptr<SyncTaskToken> token); | 51 void DetachFromNonPrimaryParents(scoped_ptr<SyncTaskToken> token); |
52 void DidDetachFromParent(scoped_ptr<SyncTaskToken> token, | 52 void DidDetachFromParent(scoped_ptr<SyncTaskToken> token, |
53 google_apis::GDataErrorCode error); | 53 google_apis::GDataErrorCode error); |
54 | 54 |
55 std::string PickPrimaryFile(const TrackerIDSet& trackers); | 55 std::string PickPrimaryFile(const TrackerIDSet& trackers); |
(...skipping 23 matching lines...) Expand all Loading... |
79 | 79 |
80 base::WeakPtrFactory<ConflictResolver> weak_ptr_factory_; | 80 base::WeakPtrFactory<ConflictResolver> weak_ptr_factory_; |
81 | 81 |
82 DISALLOW_COPY_AND_ASSIGN(ConflictResolver); | 82 DISALLOW_COPY_AND_ASSIGN(ConflictResolver); |
83 }; | 83 }; |
84 | 84 |
85 } // namespace drive_backend | 85 } // namespace drive_backend |
86 } // namespace sync_file_system | 86 } // namespace sync_file_system |
87 | 87 |
88 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CONFLICT_RESOLVER_H_ | 88 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_DRIVE_BACKEND_CONFLICT_RESOLVER_H_ |
OLD | NEW |