OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 virtual bool keyExistsInIndex(int64_t databaseId, int64_t objectStoreId, int
64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey); | 73 virtual bool keyExistsInIndex(int64_t databaseId, int64_t objectStoreId, int
64_t indexId, const IDBKey& indexKey, RefPtr<IDBKey>& foundPrimaryKey); |
74 | 74 |
75 virtual PassRefPtr<Cursor> openObjectStoreCursor(int64_t databaseId, int64_t
objectStoreId, const IDBKeyRange*, IDBCursor::Direction); | 75 virtual PassRefPtr<Cursor> openObjectStoreCursor(int64_t databaseId, int64_t
objectStoreId, const IDBKeyRange*, IDBCursor::Direction); |
76 virtual PassRefPtr<Cursor> openIndexKeyCursor(int64_t databaseId, int64_t ob
jectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction); | 76 virtual PassRefPtr<Cursor> openIndexKeyCursor(int64_t databaseId, int64_t ob
jectStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction); |
77 virtual PassRefPtr<Cursor> openIndexCursor(int64_t databaseId, int64_t objec
tStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction); | 77 virtual PassRefPtr<Cursor> openIndexCursor(int64_t databaseId, int64_t objec
tStoreId, int64_t indexId, const IDBKeyRange*, IDBCursor::Direction); |
78 | 78 |
79 virtual PassRefPtr<Transaction> createTransaction(); | 79 virtual PassRefPtr<Transaction> createTransaction(); |
80 | 80 |
81 static bool backingStoreExists(SecurityOrigin*, const String& name, const St
ring& pathBase); | 81 static bool backingStoreExists(SecurityOrigin*, const String& name, const St
ring& pathBase); |
82 | 82 |
83 protected: | 83 private: |
84 IDBLevelDBBackingStore(const String& identifier, IDBFactoryBackendImpl*, Pas
sOwnPtr<LevelDBDatabase>); | 84 IDBLevelDBBackingStore(const String& identifier, IDBFactoryBackendImpl*, Pas
sOwnPtr<LevelDBDatabase>); |
85 | 85 |
86 private: | |
87 String m_identifier; | 86 String m_identifier; |
88 RefPtr<IDBFactoryBackendImpl> m_factory; | 87 RefPtr<IDBFactoryBackendImpl> m_factory; |
89 OwnPtr<LevelDBDatabase> m_db; | 88 OwnPtr<LevelDBDatabase> m_db; |
90 OwnPtr<LevelDBComparator> m_comparator; | 89 OwnPtr<LevelDBComparator> m_comparator; |
91 RefPtr<LevelDBTransaction> m_currentTransaction; | 90 RefPtr<LevelDBTransaction> m_currentTransaction; |
92 | 91 |
93 class Transaction : public IDBBackingStore::Transaction { | 92 class Transaction : public IDBBackingStore::Transaction { |
94 public: | 93 public: |
95 static PassRefPtr<Transaction> create(IDBLevelDBBackingStore*); | 94 static PassRefPtr<Transaction> create(IDBLevelDBBackingStore*); |
96 virtual void begin(); | 95 virtual void begin(); |
97 virtual bool commit(); | 96 virtual bool commit(); |
98 virtual void rollback(); | 97 virtual void rollback(); |
99 | 98 |
100 private: | 99 private: |
101 Transaction(IDBLevelDBBackingStore*); | 100 Transaction(IDBLevelDBBackingStore*); |
102 IDBLevelDBBackingStore* m_backingStore; | 101 IDBLevelDBBackingStore* m_backingStore; |
103 }; | 102 }; |
104 }; | 103 }; |
105 | 104 |
106 } // namespace WebCore | 105 } // namespace WebCore |
107 | 106 |
108 | 107 |
109 #endif // USE(LEVELDB) | 108 #endif // USE(LEVELDB) |
110 #endif // ENABLE(INDEXED_DATABASE) | 109 #endif // ENABLE(INDEXED_DATABASE) |
111 | 110 |
112 #endif // IDBLevelDBBackingStore_h | 111 #endif // IDBLevelDBBackingStore_h |
OLD | NEW |