OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/browsing_data/chrome_browsing_data_types.h" | |
6 | |
7 #include <set> | |
8 | |
9 #include "base/lazy_instance.h" | |
10 | |
11 //////////////////////////////////////////////////////////////////////////////// | |
12 // Chrome-specific datatypes. | |
13 | |
14 const content::BrowsingDataType kBrowsingDataTypeHistory {"history", false}; | |
15 | |
16 const content::BrowsingDataType kBrowsingDataTypeFormData {"form data", false}; | |
17 | |
18 const content::BrowsingDataType kBrowsingDataTypePasswords {"passwords", true}; | |
19 | |
20 const content::BrowsingDataType kBrowsingDataTypePluginData { | |
21 "plugin data", true | |
22 }; | |
23 | |
24 #if defined(OS_ANDROID) | |
25 const content::BrowsingDataType kBrowsingDataTypeWebappData { | |
26 "webapp data", true | |
27 }; | |
28 #endif | |
29 | |
30 const content::BrowsingDataType kBrowsingDataTypeSiteUsageData { | |
31 "site usage data", true | |
32 }; | |
33 | |
34 const content::BrowsingDataType kBrowsingDataTypeDurablePermission { | |
35 "durable permission", true | |
36 }; | |
37 | |
38 const content::BrowsingDataType kBrowsingDataTypeHostedAppDataTestOnly { | |
39 "hosted app data (test only)", true | |
40 }; | |
41 | |
42 //////////////////////////////////////////////////////////////////////////////// | |
43 // Group datatypes. | |
44 | |
45 namespace { | |
46 | |
47 class GroupDataTypes { | |
48 public: | |
49 GroupDataTypes() { | |
50 // kBrowsingDataTypeSetSiteData | |
51 site_data = { | |
52 &kBrowsingDataTypeAppCache, | |
53 &kBrowsingDataTypeCookies, | |
54 &kBrowsingDataTypeFileSystems, | |
55 &kBrowsingDataTypeIndexedDB, | |
56 &kBrowsingDataTypeLocalStorage, | |
57 &kBrowsingDataTypePluginData, | |
58 &kBrowsingDataTypeServiceWorkers, | |
59 &kBrowsingDataTypeCacheStorage, | |
60 &kBrowsingDataTypeWebSQL, | |
61 &kBrowsingDataTypeChannelIDs, | |
62 #if defined(OS_ANDROID) | |
63 &kBrowsingDataTypeWebappData, | |
64 #endif | |
65 &kBrowsingDataTypeSiteUsageData, | |
66 &kBrowsingDataTypeDurablePermission | |
67 }; | |
68 | |
69 // kBrowsingDataTypeSetImportantSites | |
70 important_sites = site_data; | |
71 important_sites.insert(&kBrowsingDataTypeCache); | |
72 | |
73 // kBrowsingDataTypeSetAll | |
74 all = important_sites; | |
75 all.insert(&kBrowsingDataTypeDownloads); | |
76 all.insert(&kBrowsingDataTypeFormData); | |
77 all.insert(&kBrowsingDataTypeHistory); | |
78 all.insert(&kBrowsingDataTypePasswords); | |
79 | |
80 // kBrowsingDataTypeSetWipeProfile | |
81 wipe_profile = all; | |
82 wipe_profile.insert(&kBrowsingDataTypeNoChecks); | |
83 } | |
84 | |
85 ~GroupDataTypes() {} | |
86 | |
87 std::set<const content::BrowsingDataType*> site_data; | |
88 std::set<const content::BrowsingDataType*> important_sites; | |
89 std::set<const content::BrowsingDataType*> all; | |
90 std::set<const content::BrowsingDataType*> wipe_profile; | |
91 }; | |
92 | |
93 static base::LazyInstance<GroupDataTypes>::Leaky g_group_data_types = | |
94 LAZY_INSTANCE_INITIALIZER; | |
95 | |
96 } // namespace | |
97 | |
98 const std::set<const content::BrowsingDataType*>& kBrowsingDataTypeSetSiteData = | |
Bernhard Bauer
2017/02/17 11:10:43
So, what you are saying is that this does not crea
msramek
2017/02/17 18:00:20
No, I totally misspoke here, sorry.
I wanted to p
Bernhard Bauer
2017/02/20 14:19:16
So, primarily my problem with this right now is th
msramek
2017/02/20 17:11:16
Done. I changed them to methods.
My original goal
| |
99 g_group_data_types.Get().site_data; | |
100 | |
101 const std::set<const content::BrowsingDataType*>& | |
102 kBrowsingDataTypeSetImportantSites = g_group_data_types.Get().important_sites; | |
103 | |
104 const std::set<const content::BrowsingDataType*>& kBrowsingDataTypeSetAll = | |
105 g_group_data_types.Get().all; | |
106 | |
107 const std::set<const content::BrowsingDataType*>& | |
108 kBrowsingDataTypeSetWipeProfile = g_group_data_types.Get().wipe_profile; | |
OLD | NEW |