| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 WEBKIT_FILEAPI_SYNCABLE_FILE_CHANGE_H_ | 5 #ifndef WEBKIT_FILEAPI_SYNCABLE_FILE_CHANGE_H_ |
| 6 #define WEBKIT_FILEAPI_SYNCABLE_FILE_CHANGE_H_ | 6 #define WEBKIT_FILEAPI_SYNCABLE_FILE_CHANGE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "webkit/fileapi/fileapi_export.h" | 12 #include "webkit/storage/storage_export.h" |
| 13 | 13 |
| 14 namespace fileapi { | 14 namespace fileapi { |
| 15 | 15 |
| 16 class FILEAPI_EXPORT FileChange { | 16 class STORAGE_EXPORT FileChange { |
| 17 public: | 17 public: |
| 18 enum ChangeType { | 18 enum ChangeType { |
| 19 FILE_CHANGE_ADD_OR_UPDATE, | 19 FILE_CHANGE_ADD_OR_UPDATE, |
| 20 FILE_CHANGE_DELETE, | 20 FILE_CHANGE_DELETE, |
| 21 }; | 21 }; |
| 22 | 22 |
| 23 enum FileType { | 23 enum FileType { |
| 24 FILE_TYPE_DIRECTORY, | 24 FILE_TYPE_DIRECTORY, |
| 25 FILE_TYPE_FILE, | 25 FILE_TYPE_FILE, |
| 26 }; | 26 }; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 40 bool operator==(const FileChange& that) const { | 40 bool operator==(const FileChange& that) const { |
| 41 return change() == that.change() && | 41 return change() == that.change() && |
| 42 file_type() == that.file_type(); | 42 file_type() == that.file_type(); |
| 43 } | 43 } |
| 44 | 44 |
| 45 private: | 45 private: |
| 46 ChangeType change_; | 46 ChangeType change_; |
| 47 FileType file_type_; | 47 FileType file_type_; |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 class FILEAPI_EXPORT FileChangeList { | 50 class STORAGE_EXPORT FileChangeList { |
| 51 public: | 51 public: |
| 52 FileChangeList(); | 52 FileChangeList(); |
| 53 ~FileChangeList(); | 53 ~FileChangeList(); |
| 54 | 54 |
| 55 // Updates the list with the |new_change|. | 55 // Updates the list with the |new_change|. |
| 56 void Update(const FileChange& new_change); | 56 void Update(const FileChange& new_change); |
| 57 | 57 |
| 58 size_t size() const { return list_.size(); } | 58 size_t size() const { return list_.size(); } |
| 59 bool empty() const { return list_.empty(); } | 59 bool empty() const { return list_.empty(); } |
| 60 void clear() { list_.clear(); } | 60 void clear() { list_.clear(); } |
| 61 const std::vector<FileChange>& list() const { return list_; } | 61 const std::vector<FileChange>& list() const { return list_; } |
| 62 | 62 |
| 63 std::string DebugString() const; | 63 std::string DebugString() const; |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 std::vector<FileChange> list_; | 66 std::vector<FileChange> list_; |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 } // namespace fileapi | 69 } // namespace fileapi |
| 70 | 70 |
| 71 #endif // WEBKIT_FILEAPI_SYNCABLE_FILE_CHANGE_H_ | 71 #endif // WEBKIT_FILEAPI_SYNCABLE_FILE_CHANGE_H_ |
| OLD | NEW |