Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | |
|
msramek
2017/01/09 12:54:44
Ditto.
dullweber
2017/01/09 16:05:46
Done.
| |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_BROWSING_DATA_COOKIE_COUNTING_HELPER_H_ | |
| 6 #define CHROME_BROWSER_BROWSING_DATA_COOKIE_COUNTING_HELPER_H_ | |
| 7 | |
| 8 #include <set> | |
| 9 #include "net/cookies/canonical_cookie.h" | |
| 10 #include "net/ssl/channel_id_store.h" | |
| 11 #include "storage/common/quota/quota_types.h" | |
| 12 | |
| 13 class Profile; | |
| 14 class BrowsingDataFlashLSOHelper; | |
| 15 | |
| 16 namespace net { | |
| 17 class URLRequestContextGetter; | |
| 18 } | |
| 19 | |
| 20 namespace content { | |
| 21 struct LocalStorageUsageInfo; | |
| 22 struct SessionStorageUsageInfo; | |
| 23 } | |
| 24 | |
| 25 namespace storage { | |
| 26 class SpecialStoragePolicy; | |
| 27 } | |
| 28 | |
| 29 // Helper class that counts the number of unique origins, that are affected by | |
| 30 // deleting "cookies and site data" in the CBD dialog. | |
| 31 class CookieCountingHelper { | |
|
msramek
2017/01/09 12:54:43
Note that we have SiteDataSizeCollector (used in c
dullweber
2017/01/09 16:05:46
The SiteDataSizeCollector uses the same helper cla
| |
| 32 public: | |
| 33 explicit CookieCountingHelper(Profile* profile, | |
| 34 base::Time begin, | |
| 35 base::Callback<void(int)> completion_callback); | |
| 36 ~CookieCountingHelper(); | |
| 37 | |
| 38 void CountAndDestroySelfWhenFinished(); | |
| 39 | |
| 40 private: | |
| 41 void GetCookiesOnIOThread( | |
| 42 const scoped_refptr<net::URLRequestContextGetter>& rq_context); | |
| 43 void GetCookiesCallback(const net::CookieList& cookies); | |
| 44 void GetSessionStorageUsageInfoCallback( | |
| 45 const scoped_refptr<storage::SpecialStoragePolicy>& | |
| 46 special_storage_policy, | |
| 47 const std::vector<content::SessionStorageUsageInfo>& infos); | |
| 48 void GetLocalStorageUsageInfoCallback( | |
| 49 const scoped_refptr<storage::SpecialStoragePolicy>& | |
| 50 special_storage_policy, | |
| 51 const std::vector<content::LocalStorageUsageInfo>& infos); | |
| 52 void GetQuotaOriginsCallback(const std::set<GURL>& origin_set, | |
| 53 storage::StorageType type); | |
| 54 void SitesWithFlashDataCallback(const std::vector<std::string>& sites); | |
| 55 void GetChannelIDsOnIOThread( | |
| 56 const scoped_refptr<net::URLRequestContextGetter>& rq_context); | |
| 57 void GetChannelIDsCallback( | |
| 58 const net::ChannelIDStore::ChannelIDList& channel_ids); | |
| 59 | |
| 60 void Done(const std::vector<GURL>& origins); | |
| 61 | |
| 62 Profile* profile_; | |
| 63 base::Time begin_; | |
| 64 base::Callback<void(int)> completion_callback_; | |
| 65 int tasks_; | |
| 66 std::set<GURL> unique_origins_; | |
| 67 scoped_refptr<BrowsingDataFlashLSOHelper> flash_lso_helper_; | |
| 68 }; | |
| 69 | |
| 70 #endif // CHROME_BROWSER_BROWSING_DATA_COOKIE_COUNTING_HELPER_H_ | |
| OLD | NEW |