OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_CHROMEOS_FILE_SYSTEM_PROVIDER_OBSERVED_ENTRY_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OBSERVED_ENTRY_H_ |
6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OBSERVED_ENTRY_H_ | 6 #define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OBSERVED_ENTRY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
12 | 12 |
13 namespace chromeos { | 13 namespace chromeos { |
14 namespace file_system_provider { | 14 namespace file_system_provider { |
15 | 15 |
16 struct ObservedEntry; | 16 struct ObservedEntry; |
17 | 17 |
| 18 // Key for storing an observed entry in the map. |
| 19 struct ObservedEntryKey { |
| 20 ObservedEntryKey(const base::FilePath& entry_path, bool recursive); |
| 21 ~ObservedEntryKey(); |
| 22 |
| 23 struct Comparator { |
| 24 bool operator()(const ObservedEntryKey& a, const ObservedEntryKey& b) const; |
| 25 }; |
| 26 |
| 27 base::FilePath entry_path; |
| 28 bool recursive; |
| 29 }; |
| 30 |
18 // List of observed entries. | 31 // List of observed entries. |
19 typedef std::map<base::FilePath, ObservedEntry> ObservedEntries; | 32 typedef std::map<ObservedEntryKey, ObservedEntry, ObservedEntryKey::Comparator> |
| 33 ObservedEntries; |
20 | 34 |
21 // Represents an observed entry on a file system. | 35 // Represents an observed entry on a file system. |
22 struct ObservedEntry { | 36 struct ObservedEntry { |
23 ObservedEntry(); | 37 ObservedEntry(); |
24 ~ObservedEntry(); | 38 ~ObservedEntry(); |
25 | 39 |
26 base::FilePath entry_path; | 40 base::FilePath entry_path; |
27 bool recursive; | 41 bool recursive; |
28 std::string last_tag; | 42 std::string last_tag; |
29 }; | 43 }; |
30 | 44 |
31 } // namespace file_system_provider | 45 } // namespace file_system_provider |
32 } // namespace chromeos | 46 } // namespace chromeos |
33 | 47 |
34 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OBSERVED_ENTRY_H_ | 48 #endif // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OBSERVED_ENTRY_H_ |
OLD | NEW |