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_BROWSER_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ | 5 #ifndef WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ |
6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ | 6 #define WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/files/file.h" | 11 #include "base/files/file.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "base/sequenced_task_runner.h" | 15 #include "base/sequenced_task_runner.h" |
16 #include "webkit/browser/webkit_storage_browser_export.h" | 16 #include "storage/common/storage_export.h" |
17 | 17 |
18 namespace fileapi { | 18 namespace storage { |
19 | 19 |
20 class TimedTaskHelper; | 20 class TimedTaskHelper; |
21 | 21 |
22 class WEBKIT_STORAGE_BROWSER_EXPORT_PRIVATE FileSystemUsageCache { | 22 class STORAGE_EXPORT_PRIVATE FileSystemUsageCache { |
23 public: | 23 public: |
24 explicit FileSystemUsageCache(base::SequencedTaskRunner* task_runner); | 24 explicit FileSystemUsageCache(base::SequencedTaskRunner* task_runner); |
25 ~FileSystemUsageCache(); | 25 ~FileSystemUsageCache(); |
26 | 26 |
27 // Gets the size described in the .usage file even if dirty > 0 or | 27 // Gets the size described in the .usage file even if dirty > 0 or |
28 // is_valid == false. Returns true if the .usage file is available. | 28 // is_valid == false. Returns true if the .usage file is available. |
29 bool GetUsage(const base::FilePath& usage_file_path, int64* usage); | 29 bool GetUsage(const base::FilePath& usage_file_path, int64* usage); |
30 | 30 |
31 // Gets the dirty count in the .usage file. | 31 // Gets the dirty count in the .usage file. |
32 // Returns true if the .usage file is available. | 32 // Returns true if the .usage file is available. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 scoped_ptr<TimedTaskHelper> timer_; | 93 scoped_ptr<TimedTaskHelper> timer_; |
94 CacheFiles cache_files_; | 94 CacheFiles 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 fileapi | 103 } // namespace storage |
104 | 104 |
105 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ | 105 #endif // WEBKIT_BROWSER_FILEAPI_FILE_SYSTEM_USAGE_CACHE_H_ |
OLD | NEW |