| 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_FILE_CHANGE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FILE_SYSTEM_FILE_CHANGE_H_ |
| 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_FILE_CHANGE_H_ | 6 #define CHROME_BROWSER_SYNC_FILE_SYSTEM_FILE_CHANGE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 private: | 45 private: |
| 46 ChangeType change_; | 46 ChangeType change_; |
| 47 SyncFileType file_type_; | 47 SyncFileType file_type_; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 class FileChangeList { | 50 class FileChangeList { |
| 51 public: | 51 public: |
| 52 typedef std::deque<FileChange> List; | 52 typedef std::deque<FileChange> List; |
| 53 | 53 |
| 54 FileChangeList(); | 54 FileChangeList(); |
| 55 FileChangeList(const FileChangeList& other); |
| 55 ~FileChangeList(); | 56 ~FileChangeList(); |
| 56 | 57 |
| 57 // Updates the list with the |new_change|. | 58 // Updates the list with the |new_change|. |
| 58 void Update(const FileChange& new_change); | 59 void Update(const FileChange& new_change); |
| 59 | 60 |
| 60 size_t size() const { return list_.size(); } | 61 size_t size() const { return list_.size(); } |
| 61 bool empty() const { return list_.empty(); } | 62 bool empty() const { return list_.empty(); } |
| 62 void clear() { list_.clear(); } | 63 void clear() { list_.clear(); } |
| 63 const List& list() const { return list_; } | 64 const List& list() const { return list_; } |
| 64 const FileChange& front() const { return list_.front(); } | 65 const FileChange& front() const { return list_.front(); } |
| 65 const FileChange& back() const { return list_.back(); } | 66 const FileChange& back() const { return list_.back(); } |
| 66 | 67 |
| 67 FileChangeList PopAndGetNewList() const; | 68 FileChangeList PopAndGetNewList() const; |
| 68 | 69 |
| 69 std::string DebugString() const; | 70 std::string DebugString() const; |
| 70 | 71 |
| 71 private: | 72 private: |
| 72 List list_; | 73 List list_; |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 } // namespace sync_file_system | 76 } // namespace sync_file_system |
| 76 | 77 |
| 77 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_FILE_CHANGE_H_ | 78 #endif // CHROME_BROWSER_SYNC_FILE_SYSTEM_FILE_CHANGE_H_ |
| OLD | NEW |