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"
11 class CannedBrowsingDataAppCacheHelper
;
12 class CannedBrowsingDataChannelIDHelper
;
13 class CannedBrowsingDataCookieHelper
;
14 class CannedBrowsingDataDatabaseHelper
;
15 class CannedBrowsingDataFileSystemHelper
;
16 class CannedBrowsingDataIndexedDBHelper
;
17 class CannedBrowsingDataLocalStorageHelper
;
18 class CannedBrowsingDataServiceWorkerHelper
;
19 class CookiesTreeModel
;
23 class LocalSharedObjectsContainer
{
25 explicit LocalSharedObjectsContainer(Profile
* profile
);
26 ~LocalSharedObjectsContainer();
28 // Empties the container.
31 // Returns the number of objects stored in the container.
32 size_t GetObjectCount() const;
34 // Returns the number of objects for the given |origin|.
35 size_t GetObjectCountForDomain(const GURL
& url
) const;
37 // Creates a new CookiesTreeModel for all objects in the container,
38 // copying each of them.
39 scoped_ptr
<CookiesTreeModel
> CreateCookiesTreeModel() const;
41 CannedBrowsingDataAppCacheHelper
* appcaches() const {
42 return appcaches_
.get();
44 CannedBrowsingDataChannelIDHelper
* channel_ids() const {
45 return channel_ids_
.get();
47 CannedBrowsingDataCookieHelper
* cookies() const { return cookies_
.get(); }
48 CannedBrowsingDataDatabaseHelper
* databases() const {
49 return databases_
.get();
51 CannedBrowsingDataFileSystemHelper
* file_systems() const {
52 return file_systems_
.get();
54 CannedBrowsingDataIndexedDBHelper
* indexed_dbs() const {
55 return indexed_dbs_
.get();
57 CannedBrowsingDataLocalStorageHelper
* local_storages() const {
58 return local_storages_
.get();
60 CannedBrowsingDataServiceWorkerHelper
* service_workers() const {
61 return service_workers_
.get();
63 CannedBrowsingDataLocalStorageHelper
* session_storages() const {
64 return session_storages_
.get();
68 scoped_refptr
<CannedBrowsingDataAppCacheHelper
> appcaches_
;
69 scoped_refptr
<CannedBrowsingDataChannelIDHelper
> channel_ids_
;
70 scoped_refptr
<CannedBrowsingDataCookieHelper
> cookies_
;
71 scoped_refptr
<CannedBrowsingDataDatabaseHelper
> databases_
;
72 scoped_refptr
<CannedBrowsingDataFileSystemHelper
> file_systems_
;
73 scoped_refptr
<CannedBrowsingDataIndexedDBHelper
> indexed_dbs_
;
74 scoped_refptr
<CannedBrowsingDataLocalStorageHelper
> local_storages_
;
75 scoped_refptr
<CannedBrowsingDataServiceWorkerHelper
> service_workers_
;
76 scoped_refptr
<CannedBrowsingDataLocalStorageHelper
> session_storages_
;
78 DISALLOW_COPY_AND_ASSIGN(LocalSharedObjectsContainer
);
81 #endif // CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_