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 #include "chrome/browser/content_settings/local_shared_objects_container.h" | 5 #include "chrome/browser/content_settings/local_shared_objects_container.h" |
6 | 6 |
7 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" | 7 #include "chrome/browser/browsing_data/browsing_data_appcache_helper.h" |
8 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" | 8 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h" |
9 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" | 9 #include "chrome/browser/browsing_data/browsing_data_cookie_helper.h" |
10 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" | 10 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 local_storages_(new CannedBrowsingDataLocalStorageHelper(profile)), | 45 local_storages_(new CannedBrowsingDataLocalStorageHelper(profile)), |
46 service_workers_(new CannedBrowsingDataServiceWorkerHelper( | 46 service_workers_(new CannedBrowsingDataServiceWorkerHelper( |
47 content::BrowserContext::GetDefaultStoragePartition(profile)-> | 47 content::BrowserContext::GetDefaultStoragePartition(profile)-> |
48 GetServiceWorkerContext())), | 48 GetServiceWorkerContext())), |
49 session_storages_(new CannedBrowsingDataLocalStorageHelper(profile)) { | 49 session_storages_(new CannedBrowsingDataLocalStorageHelper(profile)) { |
50 } | 50 } |
51 | 51 |
52 LocalSharedObjectsContainer::~LocalSharedObjectsContainer() { | 52 LocalSharedObjectsContainer::~LocalSharedObjectsContainer() { |
53 } | 53 } |
54 | 54 |
55 void LocalSharedObjectsContainer::Reset() { | |
56 appcaches_->Reset(); | |
57 channel_ids_->Reset(); | |
58 cookies_->Reset(); | |
59 databases_->Reset(); | |
60 file_systems_->Reset(); | |
61 indexed_dbs_->Reset(); | |
62 local_storages_->Reset(); | |
63 service_workers_->Reset(); | |
64 session_storages_->Reset(); | |
65 } | |
66 | |
67 size_t LocalSharedObjectsContainer::GetObjectCount() const { | 55 size_t LocalSharedObjectsContainer::GetObjectCount() const { |
68 size_t count = 0; | 56 size_t count = 0; |
69 count += appcaches()->GetAppCacheCount(); | 57 count += appcaches()->GetAppCacheCount(); |
70 count += channel_ids()->GetChannelIDCount(); | 58 count += channel_ids()->GetChannelIDCount(); |
71 count += cookies()->GetCookieCount(); | 59 count += cookies()->GetCookieCount(); |
72 count += databases()->GetDatabaseCount(); | 60 count += databases()->GetDatabaseCount(); |
73 count += file_systems()->GetFileSystemCount(); | 61 count += file_systems()->GetFileSystemCount(); |
74 count += indexed_dbs()->GetIndexedDBCount(); | 62 count += indexed_dbs()->GetIndexedDBCount(); |
75 count += local_storages()->GetLocalStorageCount(); | 63 count += local_storages()->GetLocalStorageCount(); |
76 count += service_workers()->GetServiceWorkerCount(); | 64 count += service_workers()->GetServiceWorkerCount(); |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 info != info_vector.end(); | 181 info != info_vector.end(); |
194 ++info) { | 182 ++info) { |
195 if (SameDomainOrHost(origin, info->manifest_url)) | 183 if (SameDomainOrHost(origin, info->manifest_url)) |
196 ++count; | 184 ++count; |
197 } | 185 } |
198 } | 186 } |
199 | 187 |
200 return count; | 188 return count; |
201 } | 189 } |
202 | 190 |
| 191 void LocalSharedObjectsContainer::Reset() { |
| 192 appcaches_->Reset(); |
| 193 channel_ids_->Reset(); |
| 194 cookies_->Reset(); |
| 195 databases_->Reset(); |
| 196 file_systems_->Reset(); |
| 197 indexed_dbs_->Reset(); |
| 198 local_storages_->Reset(); |
| 199 service_workers_->Reset(); |
| 200 session_storages_->Reset(); |
| 201 } |
| 202 |
203 scoped_ptr<CookiesTreeModel> | 203 scoped_ptr<CookiesTreeModel> |
204 LocalSharedObjectsContainer::CreateCookiesTreeModel() const { | 204 LocalSharedObjectsContainer::CreateCookiesTreeModel() const { |
205 LocalDataContainer* container = new LocalDataContainer( | 205 LocalDataContainer* container = new LocalDataContainer( |
206 cookies(), | 206 cookies(), |
207 databases(), | 207 databases(), |
208 local_storages(), | 208 local_storages(), |
209 session_storages(), | 209 session_storages(), |
210 appcaches(), | 210 appcaches(), |
211 indexed_dbs(), | 211 indexed_dbs(), |
212 file_systems(), | 212 file_systems(), |
213 NULL, | 213 NULL, |
214 channel_ids(), | 214 channel_ids(), |
215 service_workers(), | 215 service_workers(), |
216 NULL); | 216 NULL); |
217 | 217 |
218 return make_scoped_ptr(new CookiesTreeModel(container, NULL, true)); | 218 return make_scoped_ptr(new CookiesTreeModel(container, NULL, true)); |
219 } | 219 } |
OLD | NEW |