Chromium Code Reviews| Index: content/browser/dom_storage/local_storage_database_adapter.h |
| diff --git a/content/browser/dom_storage/local_storage_database_adapter.h b/content/browser/dom_storage/local_storage_database_adapter.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3ba1b0ef73c2f687f37726989ba78b3e01c2c12c |
| --- /dev/null |
| +++ b/content/browser/dom_storage/local_storage_database_adapter.h |
| @@ -0,0 +1,50 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
|
jam
2013/08/06 16:13:49
ditto re file history
|
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_DATABASE_ADAPTER_H_ |
| +#define CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_DATABASE_ADAPTER_H_ |
| + |
| +#include "base/gtest_prod_util.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "content/browser/dom_storage/dom_storage_database_adapter.h" |
| +#include "content/common/content_export.h" |
| + |
| +namespace base { |
| +class FilePath; |
| +} |
| + |
| +namespace content { |
| + |
| +class DOMStorageDatabase; |
| + |
| +class CONTENT_EXPORT LocalStorageDatabaseAdapter : |
| + public DOMStorageDatabaseAdapter { |
| + public: |
| + explicit LocalStorageDatabaseAdapter(const base::FilePath& path); |
| + virtual ~LocalStorageDatabaseAdapter(); |
| + virtual void ReadAllValues(DOMStorageValuesMap* result) OVERRIDE; |
| + virtual bool CommitChanges(bool clear_all_first, |
| + const DOMStorageValuesMap& changes) OVERRIDE; |
| + virtual void DeleteFiles() OVERRIDE; |
| + virtual void Reset() OVERRIDE; |
| + |
| + protected: |
| + // Constructor that uses an in-memory sqlite database, for testing. |
| + LocalStorageDatabaseAdapter(); |
| + |
| + private: |
| + FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, BackingDatabaseOpened); |
| + FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, CommitChangesAtShutdown); |
| + FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, CommitTasks); |
| + FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, DeleteOrigin); |
| + FRIEND_TEST_ALL_PREFIXES(DOMStorageAreaTest, PurgeMemory); |
| + |
| + scoped_ptr<DOMStorageDatabase> db_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(LocalStorageDatabaseAdapter); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_DOM_STORAGE_LOCAL_STORAGE_DATABASE_ADAPTER_H_ |