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 CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 }; | 61 }; |
62 | 62 |
63 // Enum defining type of file operation e.g. copy or move, etc. | 63 // Enum defining type of file operation e.g. copy or move, etc. |
64 enum FileOperationType { | 64 enum FileOperationType { |
65 FILE_OPERATION_MOVE = 0, | 65 FILE_OPERATION_MOVE = 0, |
66 FILE_OPERATION_COPY, | 66 FILE_OPERATION_COPY, |
67 }; | 67 }; |
68 | 68 |
69 // Structure to store information of an existing cache file. | 69 // Structure to store information of an existing cache file. |
70 struct CacheEntry { | 70 struct CacheEntry { |
| 71 CacheEntry() : sub_dir_type(CACHE_TYPE_META), |
| 72 cache_state(0) {} |
| 73 |
71 CacheEntry(const std::string& md5, | 74 CacheEntry(const std::string& md5, |
72 CacheSubDirectoryType sub_dir_type, | 75 CacheSubDirectoryType sub_dir_type, |
73 int cache_state) | 76 int cache_state) |
74 : md5(md5), | 77 : md5(md5), |
75 sub_dir_type(sub_dir_type), | 78 sub_dir_type(sub_dir_type), |
76 cache_state(cache_state) { | 79 cache_state(cache_state) { |
77 } | 80 } |
78 | 81 |
79 bool IsPresent() const { return IsCachePresent(cache_state); } | 82 bool IsPresent() const { return IsCachePresent(cache_state); } |
80 bool IsPinned() const { return IsCachePinned(cache_state); } | 83 bool IsPinned() const { return IsCachePinned(cache_state); } |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 }; | 329 }; |
327 | 330 |
328 // Sets the free disk space getter for testing. | 331 // Sets the free disk space getter for testing. |
329 // The existing getter is deleted. | 332 // The existing getter is deleted. |
330 void SetFreeDiskSpaceGetterForTesting( | 333 void SetFreeDiskSpaceGetterForTesting( |
331 FreeDiskSpaceGetterInterface* getter); | 334 FreeDiskSpaceGetterInterface* getter); |
332 | 335 |
333 } // namespace gdata | 336 } // namespace gdata |
334 | 337 |
335 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_H_ | 338 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_CACHE_H_ |
OLD | NEW |