Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(380)

Side by Side Diff: chrome/browser/browsing_data/browsing_data_file_system_helper.h

Issue 1542413002: Switch to standard integer types in chrome/browser/, part 1 of 4. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
9 #include <stdint.h>
10
8 #include <list> 11 #include <list>
9 #include <map> 12 #include <map>
10 13
11 #include "base/callback.h" 14 #include "base/callback.h"
15 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
13 #include "storage/common/fileapi/file_system_types.h" 17 #include "storage/common/fileapi/file_system_types.h"
14 #include "url/gurl.h" 18 #include "url/gurl.h"
15 19
16 namespace storage { 20 namespace storage {
17 class FileSystemContext; 21 class FileSystemContext;
18 } 22 }
19 23
20 class Profile; 24 class Profile;
21 25
(...skipping 16 matching lines...) Expand all
38 public: 42 public:
39 // Detailed information about a file system, including it's origin GURL, 43 // Detailed information about a file system, including it's origin GURL,
40 // the amount of data (in bytes) for each sandboxed filesystem type. 44 // the amount of data (in bytes) for each sandboxed filesystem type.
41 struct FileSystemInfo { 45 struct FileSystemInfo {
42 explicit FileSystemInfo(const GURL& origin); 46 explicit FileSystemInfo(const GURL& origin);
43 ~FileSystemInfo(); 47 ~FileSystemInfo();
44 48
45 // The origin for which the information is relevant. 49 // The origin for which the information is relevant.
46 GURL origin; 50 GURL origin;
47 // FileSystemType to usage (in bytes) map. 51 // FileSystemType to usage (in bytes) map.
48 std::map<storage::FileSystemType, int64> usage_map; 52 std::map<storage::FileSystemType, int64_t> usage_map;
49 }; 53 };
50 54
51 using FetchCallback = base::Callback<void(const std::list<FileSystemInfo>&)>; 55 using FetchCallback = base::Callback<void(const std::list<FileSystemInfo>&)>;
52 56
53 // Creates a BrowsingDataFileSystemHelper instance for the file systems 57 // Creates a BrowsingDataFileSystemHelper instance for the file systems
54 // stored in |profile|'s user data directory. The BrowsingDataFileSystemHelper 58 // stored in |profile|'s user data directory. The BrowsingDataFileSystemHelper
55 // object will hold a reference to the Profile that's passed in, but is not 59 // object will hold a reference to the Profile that's passed in, but is not
56 // responsible for destroying it. 60 // responsible for destroying it.
57 // 61 //
58 // The BrowsingDataFileSystemHelper will not change the profile itself, but 62 // The BrowsingDataFileSystemHelper will not change the profile itself, but
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 // |profile| is unused in this canned implementation, but it's the interface 94 // |profile| is unused in this canned implementation, but it's the interface
91 // we're writing to, so we'll accept it, but not store it. 95 // we're writing to, so we'll accept it, but not store it.
92 explicit CannedBrowsingDataFileSystemHelper(Profile* profile); 96 explicit CannedBrowsingDataFileSystemHelper(Profile* profile);
93 97
94 // Manually adds a filesystem to the set of canned file systems that this 98 // Manually adds a filesystem to the set of canned file systems that this
95 // helper returns via StartFetching. If an origin contains both a temporary 99 // helper returns via StartFetching. If an origin contains both a temporary
96 // and a persistent filesystem, AddFileSystem must be called twice (once for 100 // and a persistent filesystem, AddFileSystem must be called twice (once for
97 // each file system type). 101 // each file system type).
98 void AddFileSystem(const GURL& origin, 102 void AddFileSystem(const GURL& origin,
99 storage::FileSystemType type, 103 storage::FileSystemType type,
100 int64 size); 104 int64_t size);
101 105
102 // Clear this helper's list of canned filesystems. 106 // Clear this helper's list of canned filesystems.
103 void Reset(); 107 void Reset();
104 108
105 // True if no filesystems are currently stored. 109 // True if no filesystems are currently stored.
106 bool empty() const; 110 bool empty() const;
107 111
108 // Returns the number of currently stored filesystems. 112 // Returns the number of currently stored filesystems.
109 size_t GetFileSystemCount() const; 113 size_t GetFileSystemCount() const;
110 114
(...skipping 14 matching lines...) Expand all
125 private: 129 private:
126 ~CannedBrowsingDataFileSystemHelper() override; 130 ~CannedBrowsingDataFileSystemHelper() override;
127 131
128 // Holds the current list of filesystems returned to the client. 132 // Holds the current list of filesystems returned to the client.
129 std::list<FileSystemInfo> file_system_info_; 133 std::list<FileSystemInfo> file_system_info_;
130 134
131 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataFileSystemHelper); 135 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataFileSystemHelper);
132 }; 136 };
133 137
134 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_FILE_SYSTEM_HELPER_H_ 138 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_FILE_SYSTEM_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698