OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_DATABASE_ADAPTER_H_ | 5 #ifndef CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_DATABASE_ADAPTER_H_ |
6 #define CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_DATABASE_ADAPTER_H_ | 6 #define CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_DATABASE_ADAPTER_H_ |
7 | 7 |
8 #include "base/gtest_prod_util.h" | 8 #include "base/gtest_prod_util.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/browser/dom_storage/dom_storage_database_adapter.h" | 10 #include "content/browser/dom_storage/dom_storage_database_adapter.h" |
11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
12 | 12 |
13 namespace base { | 13 namespace base { |
14 class FilePath; | 14 class FilePath; |
15 } | 15 } |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 class DOMStorageDatabase; | 19 class DOMStorageDatabase; |
20 | 20 |
21 class CONTENT_EXPORT LocalStorageDatabaseAdapter : | 21 class CONTENT_EXPORT LocalStorageDatabaseAdapter : |
22 public DOMStorageDatabaseAdapter { | 22 public DOMStorageDatabaseAdapter { |
23 public: | 23 public: |
24 explicit LocalStorageDatabaseAdapter(const base::FilePath& path); | 24 explicit LocalStorageDatabaseAdapter(const base::FilePath& path); |
25 virtual ~LocalStorageDatabaseAdapter(); | 25 virtual ~LocalStorageDatabaseAdapter(); |
26 virtual void ReadAllValues(DOMStorageValuesMap* result) OVERRIDE; | 26 virtual void ReadAllValues(DOMStorageValuesMap* result) override; |
27 virtual bool CommitChanges(bool clear_all_first, | 27 virtual bool CommitChanges(bool clear_all_first, |
28 const DOMStorageValuesMap& changes) OVERRIDE; | 28 const DOMStorageValuesMap& changes) override; |
29 virtual void DeleteFiles() OVERRIDE; | 29 virtual void DeleteFiles() override; |
30 virtual void Reset() OVERRIDE; | 30 virtual void Reset() override; |
31 | 31 |
32 protected: | 32 protected: |
33 // Constructor that uses an in-memory sqlite database, for testing. | 33 // Constructor that uses an in-memory sqlite database, for testing. |
34 LocalStorageDatabaseAdapter(); | 34 LocalStorageDatabaseAdapter(); |
35 | 35 |
36 private: | 36 private: |
37 FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, BackingDatabaseOpened); | 37 FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, BackingDatabaseOpened); |
38 FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, CommitChangesAtShutdown); | 38 FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, CommitChangesAtShutdown); |
39 FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, CommitTasks); | 39 FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, CommitTasks); |
40 FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, DeleteOrigin); | 40 FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, DeleteOrigin); |
41 FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, PurgeMemory); | 41 FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, PurgeMemory); |
42 | 42 |
43 scoped_ptr<DOMStorageDatabase> db_; | 43 scoped_ptr<DOMStorageDatabase> db_; |
44 | 44 |
45 DISALLOW_COPY_AND_ASSIGN(LocalStorageDatabaseAdapter); | 45 DISALLOW_COPY_AND_ASSIGN(LocalStorageDatabaseAdapter); |
46 }; | 46 }; |
47 | 47 |
48 } // namespace content | 48 } // namespace content |
49 | 49 |
50 #endif // CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_DATABASE_ADAPTER_H_ | 50 #endif // CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_DATABASE_ADAPTER_H_ |
OLD | NEW |