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

Side by Side Diff: chrome/browser/browsing_data_local_storage_helper.h

Issue 10092013: Display third party cookies and site data counts in the WebsiteSettings UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 8 years, 7 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 | Annotate | Revision Log
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_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
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 30 matching lines...) Expand all
79 78
80 // This only mutates on the UI thread. 79 // This only mutates on the UI thread.
81 base::Callback<void(const std::list<LocalStorageInfo>&)> completion_callback_; 80 base::Callback<void(const std::list<LocalStorageInfo>&)> completion_callback_;
82 81
83 // Indicates whether or not we're currently fetching information: 82 // Indicates whether or not we're currently fetching information:
84 // it's true when StartFetching() is called in the UI thread, and it's reset 83 // it's true when StartFetching() is called in the UI thread, and it's reset
85 // after we notified the callback in the UI thread. 84 // after we notified the callback in the UI thread.
86 // This only mutates on the UI thread. 85 // This only mutates on the UI thread.
87 bool is_fetching_; 86 bool is_fetching_;
88 87
89 // This only mutates in the WEBKIT thread. 88 // This only mutates in the FILE thread.
Bernhard Bauer 2012/05/10 17:18:59 That's not really true. These BrowsingDataHelper
markusheintz_ 2012/05/11 12:18:28 Yeah I forgot to mention the UI thread. I checked
Bernhard Bauer 2012/05/11 13:05:00 Yeah, that's what I meant. Invariants of the form
markusheintz_ 2012/05/14 11:00:54 I tried to make this comment a bit more useful.
90 std::list<LocalStorageInfo> local_storage_info_; 89 std::list<LocalStorageInfo> local_storage_info_;
91 90
92 private: 91 private:
93 // Called back with the all the local storage files. 92 // Called back with the all the local storage files.
94 void GetAllStorageFilesCallback(const std::vector<FilePath>& files); 93 void GetAllStorageFilesCallback(const std::vector<FilePath>& files);
95 // Get the file info on the file thread. 94 // Get the file info on the file thread.
96 void FetchLocalStorageInfo(const std::vector<FilePath>& files); 95 void FetchLocalStorageInfo(const std::vector<FilePath>& files);
97 96
98 DISALLOW_COPY_AND_ASSIGN(BrowsingDataLocalStorageHelper); 97 DISALLOW_COPY_AND_ASSIGN(BrowsingDataLocalStorageHelper);
99 }; 98 };
(...skipping 17 matching lines...) Expand all
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>& GetLocalStorageInfo() const;
128
127 // BrowsingDataLocalStorageHelper implementation. 129 // BrowsingDataLocalStorageHelper implementation.
128 virtual void StartFetching( 130 virtual void StartFetching(
129 const base::Callback<void(const std::list<LocalStorageInfo>&)>& callback) 131 const base::Callback<void(const std::list<LocalStorageInfo>&)>& callback)
130 OVERRIDE; 132 OVERRIDE;
131 133
132 private: 134 private:
133 virtual ~CannedBrowsingDataLocalStorageHelper(); 135 virtual ~CannedBrowsingDataLocalStorageHelper();
134 136
135 // Convert the pending local storage info to local storage info objects. 137 // Convert the pending local storage info to local storage info objects.
136 void ConvertPendingInfo(); 138 void ConvertPendingInfo();
137 139
138 std::set<GURL> pending_local_storage_info_; 140 std::set<GURL> pending_local_storage_info_;
139 141
140 Profile* profile_; 142 Profile* profile_;
141 143
142 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataLocalStorageHelper); 144 DISALLOW_COPY_AND_ASSIGN(CannedBrowsingDataLocalStorageHelper);
143 }; 145 };
144 146
145 #endif // CHROME_BROWSER_BROWSING_DATA_LOCAL_STORAGE_HELPER_H_ 147 #endif // CHROME_BROWSER_BROWSING_DATA_LOCAL_STORAGE_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698