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 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_ | 5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_ |
6 #define CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_ | 6 #define CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "components/content_settings/core/browser/local_shared_objects_counter.
h" | |
15 | 14 |
16 class CannedBrowsingDataAppCacheHelper; | 15 class CannedBrowsingDataAppCacheHelper; |
17 class CannedBrowsingDataChannelIDHelper; | 16 class CannedBrowsingDataChannelIDHelper; |
18 class CannedBrowsingDataCookieHelper; | 17 class CannedBrowsingDataCookieHelper; |
19 class CannedBrowsingDataDatabaseHelper; | 18 class CannedBrowsingDataDatabaseHelper; |
20 class CannedBrowsingDataFileSystemHelper; | 19 class CannedBrowsingDataFileSystemHelper; |
21 class CannedBrowsingDataIndexedDBHelper; | 20 class CannedBrowsingDataIndexedDBHelper; |
22 class CannedBrowsingDataLocalStorageHelper; | 21 class CannedBrowsingDataLocalStorageHelper; |
23 class CannedBrowsingDataServiceWorkerHelper; | 22 class CannedBrowsingDataServiceWorkerHelper; |
24 class CannedBrowsingDataCacheStorageHelper; | 23 class CannedBrowsingDataCacheStorageHelper; |
25 class CookiesTreeModel; | 24 class CookiesTreeModel; |
| 25 class GURL; |
26 class Profile; | 26 class Profile; |
27 | 27 |
28 class LocalSharedObjectsContainer : public LocalSharedObjectsCounter { | 28 class LocalSharedObjectsContainer { |
29 public: | 29 public: |
30 explicit LocalSharedObjectsContainer(Profile* profile); | 30 explicit LocalSharedObjectsContainer(Profile* profile); |
31 ~LocalSharedObjectsContainer() override; | 31 ~LocalSharedObjectsContainer(); |
32 | 32 |
33 // LocalSharedObjectsCounter: | 33 // Returns the number of objects stored in the container. |
34 size_t GetObjectCount() const override; | 34 size_t GetObjectCount() const; |
35 size_t GetObjectCountForDomain(const GURL& url) const override; | 35 |
| 36 // Returns the number of objects for the given |origin|. |
| 37 size_t GetObjectCountForDomain(const GURL& origin) const; |
36 | 38 |
37 // Empties the container. | 39 // Empties the container. |
38 void Reset(); | 40 void Reset(); |
39 | 41 |
40 // Creates a new CookiesTreeModel for all objects in the container, | 42 // Creates a new CookiesTreeModel for all objects in the container, |
41 // copying each of them. | 43 // copying each of them. |
42 std::unique_ptr<CookiesTreeModel> CreateCookiesTreeModel() const; | 44 std::unique_ptr<CookiesTreeModel> CreateCookiesTreeModel() const; |
43 | 45 |
44 CannedBrowsingDataAppCacheHelper* appcaches() const { | 46 CannedBrowsingDataAppCacheHelper* appcaches() const { |
45 return appcaches_.get(); | 47 return appcaches_.get(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 scoped_refptr<CannedBrowsingDataIndexedDBHelper> indexed_dbs_; | 81 scoped_refptr<CannedBrowsingDataIndexedDBHelper> indexed_dbs_; |
80 scoped_refptr<CannedBrowsingDataLocalStorageHelper> local_storages_; | 82 scoped_refptr<CannedBrowsingDataLocalStorageHelper> local_storages_; |
81 scoped_refptr<CannedBrowsingDataServiceWorkerHelper> service_workers_; | 83 scoped_refptr<CannedBrowsingDataServiceWorkerHelper> service_workers_; |
82 scoped_refptr<CannedBrowsingDataCacheStorageHelper> cache_storages_; | 84 scoped_refptr<CannedBrowsingDataCacheStorageHelper> cache_storages_; |
83 scoped_refptr<CannedBrowsingDataLocalStorageHelper> session_storages_; | 85 scoped_refptr<CannedBrowsingDataLocalStorageHelper> session_storages_; |
84 | 86 |
85 DISALLOW_COPY_AND_ASSIGN(LocalSharedObjectsContainer); | 87 DISALLOW_COPY_AND_ASSIGN(LocalSharedObjectsContainer); |
86 }; | 88 }; |
87 | 89 |
88 #endif // CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_ | 90 #endif // CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_ |
OLD | NEW |