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_BROWSING_DATA_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 // data) by calling DeleteFileSystemOrigin() on the UI thread. Calling | 37 // data) by calling DeleteFileSystemOrigin() on the UI thread. Calling |
38 // DeleteFileSystemOrigin() for an origin that doesn't have any is safe; it's | 38 // DeleteFileSystemOrigin() for an origin that doesn't have any is safe; it's |
39 // just an expensive NOOP. | 39 // just an expensive NOOP. |
40 class BrowsingDataFileSystemHelper | 40 class BrowsingDataFileSystemHelper |
41 : public base::RefCountedThreadSafe<BrowsingDataFileSystemHelper> { | 41 : public base::RefCountedThreadSafe<BrowsingDataFileSystemHelper> { |
42 public: | 42 public: |
43 // Detailed information about a file system, including it's origin GURL, | 43 // Detailed information about a file system, including it's origin GURL, |
44 // the amount of data (in bytes) for each sandboxed filesystem type. | 44 // the amount of data (in bytes) for each sandboxed filesystem type. |
45 struct FileSystemInfo { | 45 struct FileSystemInfo { |
46 explicit FileSystemInfo(const GURL& origin); | 46 explicit FileSystemInfo(const GURL& origin); |
| 47 FileSystemInfo(const FileSystemInfo& other); |
47 ~FileSystemInfo(); | 48 ~FileSystemInfo(); |
48 | 49 |
49 // The origin for which the information is relevant. | 50 // The origin for which the information is relevant. |
50 GURL origin; | 51 GURL origin; |
51 // FileSystemType to usage (in bytes) map. | 52 // FileSystemType to usage (in bytes) map. |
52 std::map<storage::FileSystemType, int64_t> usage_map; | 53 std::map<storage::FileSystemType, int64_t> usage_map; |
53 }; | 54 }; |
54 | 55 |
55 using FetchCallback = base::Callback<void(const std::list<FileSystemInfo>&)>; | 56 using FetchCallback = base::Callback<void(const std::list<FileSystemInfo>&)>; |
56 | 57 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 private: | 130 private: |
130 ~CannedBrowsingDataFileSystemHelper() override; | 131 ~CannedBrowsingDataFileSystemHelper() override; |
131 | 132 |
132 // Holds the current list of filesystems returned to the client. | 133 // Holds the current list of filesystems returned to the client. |
133 std::list<FileSystemInfo> file_system_info_; | 134 std::list<FileSystemInfo> file_system_info_; |
134 | 135 |
135 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataFileSystemHelper); | 136 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataFileSystemHelper); |
136 }; | 137 }; |
137 | 138 |
138 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ | 139 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ |
OLD | NEW |