| 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 "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 | 10 |
| 11 class CannedBrowsingDataAppCacheHelper; | 11 class CannedBrowsingDataAppCacheHelper; |
| 12 class CannedBrowsingDataChannelIDHelper; |
| 12 class CannedBrowsingDataCookieHelper; | 13 class CannedBrowsingDataCookieHelper; |
| 13 class CannedBrowsingDataDatabaseHelper; | 14 class CannedBrowsingDataDatabaseHelper; |
| 14 class CannedBrowsingDataFileSystemHelper; | 15 class CannedBrowsingDataFileSystemHelper; |
| 15 class CannedBrowsingDataIndexedDBHelper; | 16 class CannedBrowsingDataIndexedDBHelper; |
| 16 class CannedBrowsingDataLocalStorageHelper; | 17 class CannedBrowsingDataLocalStorageHelper; |
| 17 class CannedBrowsingDataServerBoundCertHelper; | |
| 18 class CookiesTreeModel; | 18 class CookiesTreeModel; |
| 19 class GURL; | 19 class GURL; |
| 20 class Profile; | 20 class Profile; |
| 21 | 21 |
| 22 class LocalSharedObjectsContainer { | 22 class LocalSharedObjectsContainer { |
| 23 public: | 23 public: |
| 24 explicit LocalSharedObjectsContainer(Profile* profile); | 24 explicit LocalSharedObjectsContainer(Profile* profile); |
| 25 ~LocalSharedObjectsContainer(); | 25 ~LocalSharedObjectsContainer(); |
| 26 | 26 |
| 27 // Empties the container. | 27 // Empties the container. |
| 28 void Reset(); | 28 void Reset(); |
| 29 | 29 |
| 30 // Returns the number of objects stored in the container. | 30 // Returns the number of objects stored in the container. |
| 31 size_t GetObjectCount() const; | 31 size_t GetObjectCount() const; |
| 32 | 32 |
| 33 // Returns the number of objects for the given |origin|. | 33 // Returns the number of objects for the given |origin|. |
| 34 size_t GetObjectCountForDomain(const GURL& url) const; | 34 size_t GetObjectCountForDomain(const GURL& url) const; |
| 35 | 35 |
| 36 // Creates a new CookiesTreeModel for all objects in the container, | 36 // Creates a new CookiesTreeModel for all objects in the container, |
| 37 // copying each of them. | 37 // copying each of them. |
| 38 scoped_ptr<CookiesTreeModel> CreateCookiesTreeModel() const; | 38 scoped_ptr<CookiesTreeModel> CreateCookiesTreeModel() const; |
| 39 | 39 |
| 40 CannedBrowsingDataAppCacheHelper* appcaches() const { | 40 CannedBrowsingDataAppCacheHelper* appcaches() const { |
| 41 return appcaches_.get(); | 41 return appcaches_.get(); |
| 42 } | 42 } |
| 43 CannedBrowsingDataChannelIDHelper* channel_ids() const { |
| 44 return channel_ids_.get(); |
| 45 } |
| 43 CannedBrowsingDataCookieHelper* cookies() const { return cookies_.get(); } | 46 CannedBrowsingDataCookieHelper* cookies() const { return cookies_.get(); } |
| 44 CannedBrowsingDataDatabaseHelper* databases() const { | 47 CannedBrowsingDataDatabaseHelper* databases() const { |
| 45 return databases_.get(); | 48 return databases_.get(); |
| 46 } | 49 } |
| 47 CannedBrowsingDataFileSystemHelper* file_systems() const { | 50 CannedBrowsingDataFileSystemHelper* file_systems() const { |
| 48 return file_systems_.get(); | 51 return file_systems_.get(); |
| 49 } | 52 } |
| 50 CannedBrowsingDataIndexedDBHelper* indexed_dbs() const { | 53 CannedBrowsingDataIndexedDBHelper* indexed_dbs() const { |
| 51 return indexed_dbs_.get(); | 54 return indexed_dbs_.get(); |
| 52 } | 55 } |
| 53 CannedBrowsingDataLocalStorageHelper* local_storages() const { | 56 CannedBrowsingDataLocalStorageHelper* local_storages() const { |
| 54 return local_storages_.get(); | 57 return local_storages_.get(); |
| 55 } | 58 } |
| 56 CannedBrowsingDataServerBoundCertHelper* server_bound_certs() const { | |
| 57 return server_bound_certs_.get(); | |
| 58 } | |
| 59 CannedBrowsingDataLocalStorageHelper* session_storages() const { | 59 CannedBrowsingDataLocalStorageHelper* session_storages() const { |
| 60 return session_storages_.get(); | 60 return session_storages_.get(); |
| 61 } | 61 } |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 scoped_refptr<CannedBrowsingDataAppCacheHelper> appcaches_; | 64 scoped_refptr<CannedBrowsingDataAppCacheHelper> appcaches_; |
| 65 scoped_refptr<CannedBrowsingDataChannelIDHelper> channel_ids_; |
| 65 scoped_refptr<CannedBrowsingDataCookieHelper> cookies_; | 66 scoped_refptr<CannedBrowsingDataCookieHelper> cookies_; |
| 66 scoped_refptr<CannedBrowsingDataDatabaseHelper> databases_; | 67 scoped_refptr<CannedBrowsingDataDatabaseHelper> databases_; |
| 67 scoped_refptr<CannedBrowsingDataFileSystemHelper> file_systems_; | 68 scoped_refptr<CannedBrowsingDataFileSystemHelper> file_systems_; |
| 68 scoped_refptr<CannedBrowsingDataIndexedDBHelper> indexed_dbs_; | 69 scoped_refptr<CannedBrowsingDataIndexedDBHelper> indexed_dbs_; |
| 69 scoped_refptr<CannedBrowsingDataLocalStorageHelper> local_storages_; | 70 scoped_refptr<CannedBrowsingDataLocalStorageHelper> local_storages_; |
| 70 scoped_refptr<CannedBrowsingDataServerBoundCertHelper> server_bound_certs_; | |
| 71 scoped_refptr<CannedBrowsingDataLocalStorageHelper> session_storages_; | 71 scoped_refptr<CannedBrowsingDataLocalStorageHelper> session_storages_; |
| 72 | 72 |
| 73 DISALLOW_COPY_AND_ASSIGN(LocalSharedObjectsContainer); | 73 DISALLOW_COPY_AND_ASSIGN(LocalSharedObjectsContainer); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 #endif // CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_ | 76 #endif // CHROME_BROWSER_CONTENT_SETTINGS_LOCAL_SHARED_OBJECTS_CONTAINER_H_ |
| OLD | NEW |