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 STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ | 5 #ifndef STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ |
6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ | 6 #define STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 char* buffer, | 81 char* buffer, |
82 int64_t buffer_size); | 82 int64_t buffer_size); |
83 bool WriteBytes(const base::FilePath& file_path, | 83 bool WriteBytes(const base::FilePath& file_path, |
84 const char* buffer, | 84 const char* buffer, |
85 int64_t buffer_size); | 85 int64_t buffer_size); |
86 bool FlushFile(const base::FilePath& file_path); | 86 bool FlushFile(const base::FilePath& file_path); |
87 void ScheduleCloseTimer(); | 87 void ScheduleCloseTimer(); |
88 | 88 |
89 bool HasCacheFileHandle(const base::FilePath& file_path); | 89 bool HasCacheFileHandle(const base::FilePath& file_path); |
90 | 90 |
91 bool CalledOnValidThread(); | 91 bool CalledOnValidSequence(); |
92 | 92 |
93 std::unique_ptr<TimedTaskHelper> timer_; | 93 std::unique_ptr<TimedTaskHelper> timer_; |
94 std::map<base::FilePath, std::unique_ptr<base::File>> cache_files_; | 94 std::map<base::FilePath, std::unique_ptr<base::File>> cache_files_; |
95 | 95 |
96 scoped_refptr<base::SequencedTaskRunner> task_runner_; | 96 scoped_refptr<base::SequencedTaskRunner> task_runner_; |
97 | 97 |
98 base::WeakPtrFactory<FileSystemUsageCache> weak_factory_; | 98 base::WeakPtrFactory<FileSystemUsageCache> weak_factory_; |
99 | 99 |
100 DISALLOW_COPY_AND_ASSIGN(FileSystemUsageCache); | 100 DISALLOW_COPY_AND_ASSIGN(FileSystemUsageCache); |
101 }; | 101 }; |
102 | 102 |
103 } // namespace storage | 103 } // namespace storage |
104 | 104 |
105 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ | 105 #endif // STORAGE_BROWSER_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ |
OLD | NEW |