| 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_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "content/browser/indexed_db/indexed_db_backing_store.h" | 10 #include "content/browser/indexed_db/indexed_db_backing_store.h" |
| 11 | 11 |
| 12 namespace base { |
| 13 class TaskRunner; |
| 14 } |
| 15 |
| 12 namespace content { | 16 namespace content { |
| 13 | 17 |
| 18 class IndexedDBFactory; |
| 19 |
| 14 class IndexedDBFakeBackingStore : public IndexedDBBackingStore { | 20 class IndexedDBFakeBackingStore : public IndexedDBBackingStore { |
| 15 public: | 21 public: |
| 16 IndexedDBFakeBackingStore() | 22 IndexedDBFakeBackingStore(); |
| 17 : IndexedDBBackingStore(GURL("http://localhost:81"), | 23 IndexedDBFakeBackingStore(IndexedDBFactory* factory, |
| 18 scoped_ptr<LevelDBDatabase>(), | 24 base::TaskRunner* task_runner); |
| 19 scoped_ptr<LevelDBComparator>()) {} | |
| 20 virtual std::vector<base::string16> GetDatabaseNames() OVERRIDE; | 25 virtual std::vector<base::string16> GetDatabaseNames() OVERRIDE; |
| 21 virtual leveldb::Status GetIDBDatabaseMetaData(const base::string16& name, | 26 virtual leveldb::Status GetIDBDatabaseMetaData(const base::string16& name, |
| 22 IndexedDBDatabaseMetadata*, | 27 IndexedDBDatabaseMetadata*, |
| 23 bool* found) OVERRIDE; | 28 bool* found) OVERRIDE; |
| 24 virtual leveldb::Status CreateIDBDatabaseMetaData( | 29 virtual leveldb::Status CreateIDBDatabaseMetaData( |
| 25 const base::string16& name, | 30 const base::string16& name, |
| 26 const base::string16& version, | 31 const base::string16& version, |
| 27 int64 int_version, | 32 int64 int_version, |
| 28 int64* row_id) OVERRIDE; | 33 int64* row_id) OVERRIDE; |
| 29 virtual bool UpdateIDBDatabaseIntVersion(Transaction*, | 34 virtual bool UpdateIDBDatabaseIntVersion(Transaction*, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 int64 database_id, | 81 int64 database_id, |
| 77 int64 object_store_id, | 82 int64 object_store_id, |
| 78 int64 index_id) OVERRIDE; | 83 int64 index_id) OVERRIDE; |
| 79 virtual leveldb::Status PutIndexDataForRecord(Transaction*, | 84 virtual leveldb::Status PutIndexDataForRecord(Transaction*, |
| 80 int64 database_id, | 85 int64 database_id, |
| 81 int64 object_store_id, | 86 int64 object_store_id, |
| 82 int64 index_id, | 87 int64 index_id, |
| 83 const IndexedDBKey&, | 88 const IndexedDBKey&, |
| 84 const RecordIdentifier&) | 89 const RecordIdentifier&) |
| 85 OVERRIDE; | 90 OVERRIDE; |
| 91 virtual void ReportBlobUnused(int64 database_id, int64 blob_key) OVERRIDE; |
| 86 | 92 |
| 87 virtual scoped_ptr<Cursor> OpenObjectStoreKeyCursor( | 93 virtual scoped_ptr<Cursor> OpenObjectStoreKeyCursor( |
| 88 Transaction* transaction, | 94 Transaction* transaction, |
| 89 int64 database_id, | 95 int64 database_id, |
| 90 int64 object_store_id, | 96 int64 object_store_id, |
| 91 const IndexedDBKeyRange& key_range, | 97 const IndexedDBKeyRange& key_range, |
| 92 indexed_db::CursorDirection) OVERRIDE; | 98 indexed_db::CursorDirection) OVERRIDE; |
| 93 virtual scoped_ptr<Cursor> OpenObjectStoreCursor( | 99 virtual scoped_ptr<Cursor> OpenObjectStoreCursor( |
| 94 Transaction* transaction, | 100 Transaction* transaction, |
| 95 int64 database_id, | 101 int64 database_id, |
| (...skipping 27 matching lines...) Expand all Loading... |
| 123 }; | 129 }; |
| 124 | 130 |
| 125 protected: | 131 protected: |
| 126 friend class base::RefCounted<IndexedDBFakeBackingStore>; | 132 friend class base::RefCounted<IndexedDBFakeBackingStore>; |
| 127 virtual ~IndexedDBFakeBackingStore(); | 133 virtual ~IndexedDBFakeBackingStore(); |
| 128 }; | 134 }; |
| 129 | 135 |
| 130 } // namespace content | 136 } // namespace content |
| 131 | 137 |
| 132 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ | 138 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_FAKE_BACKING_STORE_H_ |
| OLD | NEW |