OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 #ifndef WEBKIT_DOM_STORAGE_LOCAL_STORAGE_DATABASE_ADAPTER_H_ |
| 6 #define WEBKIT_DOM_STORAGE_LOCAL_STORAGE_DATABASE_ADAPTER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "webkit/dom_storage/dom_storage_database_adapter.h" |
| 12 |
| 13 class FilePath; |
| 14 |
| 15 namespace dom_storage { |
| 16 |
| 17 class DomStorageDatabase; |
| 18 |
| 19 class LocalStorageDatabaseAdapter : public DomStorageDatabaseAdapter { |
| 20 public: |
| 21 explicit LocalStorageDatabaseAdapter(const FilePath& path); |
| 22 virtual ~LocalStorageDatabaseAdapter(); |
| 23 virtual void ReadAllValues(ValuesMap* result) OVERRIDE; |
| 24 virtual bool CommitChanges(bool clear_all_first, |
| 25 const ValuesMap& changes) OVERRIDE; |
| 26 virtual void DeleteFiles() OVERRIDE; |
| 27 virtual void Reset() OVERRIDE; |
| 28 protected: |
| 29 // Constructor that uses an in-memory sqlite database, for testing. |
| 30 LocalStorageDatabaseAdapter(); |
| 31 |
| 32 private: |
| 33 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, BackingDatabaseOpened); |
| 34 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, CommitChangesAtShutdown); |
| 35 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, CommitTasks); |
| 36 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, DeleteOrigin); |
| 37 FRIEND_TEST_ALL_PREFIXES(DomStorageAreaTest, PurgeMemory); |
| 38 |
| 39 scoped_ptr<DomStorageDatabase> db_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(LocalStorageDatabaseAdapter); |
| 42 }; |
| 43 |
| 44 } // namespace dom_storage |
| 45 |
| 46 #endif // WEBKIT_DOM_STORAGE_LOCAL_STORAGE_DATABASE_ADAPTER_H_ |
OLD | NEW |