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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_
6 #define CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_
8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "components/content_settings/core/browser/local_shared_objects_counter.h"
12 class CannedBrowsingDataAppCacheHelper
;
13 class CannedBrowsingDataChannelIDHelper
;
14 class CannedBrowsingDataCookieHelper
;
15 class CannedBrowsingDataDatabaseHelper
;
16 class CannedBrowsingDataFileSystemHelper
;
17 class CannedBrowsingDataIndexedDBHelper
;
18 class CannedBrowsingDataLocalStorageHelper
;
19 class CannedBrowsingDataServiceWorkerHelper
;
20 class CannedBrowsingDataCacheStorageHelper
;
21 class CookiesTreeModel
;
24 class LocalSharedObjectsContainer
: public LocalSharedObjectsCounter
{
26 explicit LocalSharedObjectsContainer(Profile
* profile
);
27 ~LocalSharedObjectsContainer() override
;
29 // LocalSharedObjectsCounter:
30 size_t GetObjectCount() const override
;
31 size_t GetObjectCountForDomain(const GURL
& url
) const override
;
33 // Empties the container.
36 // Creates a new CookiesTreeModel for all objects in the container,
37 // copying each of them.
38 scoped_ptr
<CookiesTreeModel
> CreateCookiesTreeModel() const;
40 CannedBrowsingDataAppCacheHelper
* appcaches() const {
41 return appcaches_
.get();
43 CannedBrowsingDataChannelIDHelper
* channel_ids() const {
44 return channel_ids_
.get();
46 CannedBrowsingDataCookieHelper
* cookies() const { return cookies_
.get(); }
47 CannedBrowsingDataDatabaseHelper
* databases() const {
48 return databases_
.get();
50 CannedBrowsingDataFileSystemHelper
* file_systems() const {
51 return file_systems_
.get();
53 CannedBrowsingDataIndexedDBHelper
* indexed_dbs() const {
54 return indexed_dbs_
.get();
56 CannedBrowsingDataLocalStorageHelper
* local_storages() const {
57 return local_storages_
.get();
59 CannedBrowsingDataServiceWorkerHelper
* service_workers() const {
60 return service_workers_
.get();
62 CannedBrowsingDataCacheStorageHelper
* cache_storages() const {
63 return cache_storages_
.get();
65 CannedBrowsingDataLocalStorageHelper
* session_storages() const {
66 return session_storages_
.get();
70 scoped_refptr
<CannedBrowsingDataAppCacheHelper
> appcaches_
;
71 scoped_refptr
<CannedBrowsingDataChannelIDHelper
> channel_ids_
;
72 scoped_refptr
<CannedBrowsingDataCookieHelper
> cookies_
;
73 scoped_refptr
<CannedBrowsingDataDatabaseHelper
> databases_
;
74 scoped_refptr
<CannedBrowsingDataFileSystemHelper
> file_systems_
;
75 scoped_refptr
<CannedBrowsingDataIndexedDBHelper
> indexed_dbs_
;
76 scoped_refptr
<CannedBrowsingDataLocalStorageHelper
> local_storages_
;
77 scoped_refptr
<CannedBrowsingDataServiceWorkerHelper
> service_workers_
;
78 scoped_refptr
<CannedBrowsingDataCacheStorageHelper
> cache_storages_
;
79 scoped_refptr
<CannedBrowsingDataLocalStorageHelper
> session_storages_
;
81 DISALLOW_COPY_AND_ASSIGN(LocalSharedObjectsContainer
);
84 #endif // CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_