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_LOCAL_STORAGE_HELPER_H_ | 5 #ifndef CHROME_BROWSER_BROWSING_DATA_LOCAL_STORAGE_HELPER_H_ |
6 #define CHROME_BROWSER_BROWSING_DATA_LOCAL_STORAGE_HELPER_H_ | 6 #define CHROME_BROWSER_BROWSING_DATA_LOCAL_STORAGE_HELPER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <list> | 9 #include <list> |
10 #include <set> | 10 #include <set> |
(...skipping 17 matching lines...) Expand all Loading... | |
28 // This class fetches local storage information in the WebKit thread, and | 28 // This class fetches local storage information in the WebKit thread, and |
29 // notifies the UI thread upon completion. | 29 // notifies the UI thread upon completion. |
30 // A client of this class need to call StartFetching from the UI thread to | 30 // A client of this class need to call StartFetching from the UI thread to |
31 // initiate the flow, and it'll be notified by the callback in its UI | 31 // initiate the flow, and it'll be notified by the callback in its UI |
32 // thread at some later point. | 32 // thread at some later point. |
33 class BrowsingDataLocalStorageHelper | 33 class BrowsingDataLocalStorageHelper |
34 : public base::RefCountedThreadSafe<BrowsingDataLocalStorageHelper> { | 34 : public base::RefCountedThreadSafe<BrowsingDataLocalStorageHelper> { |
35 public: | 35 public: |
36 // Contains detailed information about local storage. | 36 // Contains detailed information about local storage. |
37 struct LocalStorageInfo { | 37 struct LocalStorageInfo { |
38 LocalStorageInfo(); | |
39 LocalStorageInfo( | 38 LocalStorageInfo( |
40 const std::string& protocol, | 39 const std::string& protocol, |
41 const std::string& host, | 40 const std::string& host, |
42 unsigned short port, | 41 unsigned short port, |
43 const std::string& database_identifier, | 42 const std::string& database_identifier, |
44 const std::string& origin, | 43 const std::string& origin, |
45 const FilePath& file_path, | 44 const FilePath& file_path, |
46 int64 size, | 45 int64 size, |
47 base::Time last_modified); | 46 base::Time last_modified); |
48 ~LocalStorageInfo(); | 47 ~LocalStorageInfo(); |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
117 | 116 |
118 // Clear the list of canned local storages. | 117 // Clear the list of canned local storages. |
119 void Reset(); | 118 void Reset(); |
120 | 119 |
121 // True if no local storages are currently stored. | 120 // True if no local storages are currently stored. |
122 bool empty() const; | 121 bool empty() const; |
123 | 122 |
124 // Returns the number of local storages currently stored. | 123 // Returns the number of local storages currently stored. |
125 size_t GetLocalStorageCount() const; | 124 size_t GetLocalStorageCount() const; |
126 | 125 |
126 // Returns the set of origins that use local storage. | |
127 const std::set<GURL>& pending_local_storage_info() const { | |
bauerb at google
2012/04/27 16:12:50
Including this one, we now have five methods in th
markusheintz_
2012/05/10 16:32:36
The style guide recommend to user Unix hacker styl
| |
128 return pending_local_storage_info_; | |
129 } | |
130 | |
127 // BrowsingDataLocalStorageHelper implementation. | 131 // BrowsingDataLocalStorageHelper implementation. |
128 virtual void StartFetching( | 132 virtual void StartFetching( |
129 const base::Callback<void(const std::list<LocalStorageInfo>&)>& callback) | 133 const base::Callback<void(const std::list<LocalStorageInfo>&)>& callback) |
130 OVERRIDE; | 134 OVERRIDE; |
131 | 135 |
132 private: | 136 private: |
133 virtual ~CannedBrowsingDataLocalStorageHelper(); | 137 virtual ~CannedBrowsingDataLocalStorageHelper(); |
134 | 138 |
135 // Convert the pending local storage info to local storage info objects. | 139 // Convert the pending local storage info to local storage info objects. |
136 void ConvertPendingInfo(); | 140 void ConvertPendingInfo(); |
137 | 141 |
138 std::set<GURL> pending_local_storage_info_; | 142 std::set<GURL> pending_local_storage_info_; |
139 | 143 |
140 Profile* profile_; | 144 Profile* profile_; |
141 | 145 |
142 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataLocalStorageHelper); | 146 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataLocalStorageHelper); |
143 }; | 147 }; |
144 | 148 |
145 #endif // CHROME_BROWSER_BROWSING_DATA_LOCAL_STORAGE_HELPER_H_ | 149 #endif // CHROME_BROWSER_BROWSING_DATA_LOCAL_STORAGE_HELPER_H_ |
OLD | NEW |