| 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/webkit_storage_export.h" |
| 13 | 13 |
| 14 namespace fileapi { | 14 namespace fileapi { |
| 15 | 15 |
| 16 class FILEAPI_EXPORT FileChange { | 16 class WEBKIT_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 FILE_TYPE_UNDETERMINED, | 26 FILE_TYPE_UNDETERMINED, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 41 bool operator==(const FileChange& that) const { | 41 bool operator==(const FileChange& that) const { |
| 42 return change() == that.change() && | 42 return change() == that.change() && |
| 43 file_type() == that.file_type(); | 43 file_type() == that.file_type(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 private: | 46 private: |
| 47 ChangeType change_; | 47 ChangeType change_; |
| 48 FileType file_type_; | 48 FileType file_type_; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 class FILEAPI_EXPORT FileChangeList { | 51 class WEBKIT_STORAGE_EXPORT FileChangeList { |
| 52 public: | 52 public: |
| 53 FileChangeList(); | 53 FileChangeList(); |
| 54 ~FileChangeList(); | 54 ~FileChangeList(); |
| 55 | 55 |
| 56 // Updates the list with the |new_change|. | 56 // Updates the list with the |new_change|. |
| 57 void Update(const FileChange& new_change); | 57 void Update(const FileChange& new_change); |
| 58 | 58 |
| 59 size_t size() const { return list_.size(); } | 59 size_t size() const { return list_.size(); } |
| 60 bool empty() const { return list_.empty(); } | 60 bool empty() const { return list_.empty(); } |
| 61 void clear() { list_.clear(); } | 61 void clear() { list_.clear(); } |
| 62 const std::vector<FileChange>& list() const { return list_; } | 62 const std::vector<FileChange>& list() const { return list_; } |
| 63 | 63 |
| 64 std::string DebugString() const; | 64 std::string DebugString() const; |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 std::vector<FileChange> list_; | 67 std::vector<FileChange> list_; |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace fileapi | 70 } // namespace fileapi |
| 71 | 71 |
| 72 #endif // WEBKIT_FILEAPI_SYNCABLE_FILE_CHANGE_H_ | 72 #endif // WEBKIT_FILEAPI_SYNCABLE_FILE_CHANGE_H_ |
| OLD | NEW |