Index: third_party/WebKit/Source/modules/indexeddb/IDBDatabaseProxy.cpp |
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBDatabaseProxy.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBDatabaseProxy.cpp |
new file mode 100644 |
index 0000000000000000000000000000000000000000..6fca10d01d41c3c75d816e8a5d7f9ddb8e7b3c16 |
--- /dev/null |
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBDatabaseProxy.cpp |
@@ -0,0 +1,124 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "modules/indexeddb/IDBDatabaseProxy.h" |
+ |
+#include "modules/indexeddb/IDBMojoUtil.h" |
+ |
+namespace blink { |
+ |
+IDBDatabaseProxy::IDBDatabaseProxy(indexed_db::mojom::blink::DatabasePtr database) |
+ : m_database(std::move(database)) |
+{ |
+} |
+ |
+IDBDatabaseProxy* IDBDatabaseProxy::create(indexed_db::mojom::blink::DatabasePtr database) |
+{ |
+ return new IDBDatabaseProxy(std::move(database)); |
+} |
+ |
+void IDBDatabaseProxy::CreateObjectStore(int64_t transactionId, int64_t objectStoreId, const WTF::String& name, const IDBKeyPath& keyPath, bool autoIncrement) |
+{ |
+ m_database->CreateObjectStore(transactionId, objectStoreId, name, createKeyPath(keyPath), autoIncrement); |
+} |
+ |
+void IDBDatabaseProxy::Close() |
+{ |
+ m_database->Close(); |
+} |
+ |
+void IDBDatabaseProxy::DeleteObjectStore(int64_t transactionId, int64_t objectStoreId) |
+{ |
+ m_database->DeleteObjectStore(transactionId, objectStoreId); |
+} |
+ |
+void IDBDatabaseProxy::CreateTransaction(int64_t id, const Vector<int64_t>& objectStoreIds, indexed_db::mojom::blink::TransactionMode transactionMode) |
+{ |
+ Vector<int64_t> idCopy(objectStoreIds); |
+ m_database->CreateTransaction(id, std::move(idCopy), transactionMode); |
+} |
+ |
+void IDBDatabaseProxy::VersionChangeIgnored() |
+{ |
+ m_database->VersionChangeIgnored(); |
+} |
+ |
+void IDBDatabaseProxy::Abort(int64_t transactionId) |
+{ |
+ m_database->Abort(transactionId); |
+} |
+ |
+void IDBDatabaseProxy::Commit(int64_t transactionId) |
+{ |
+ m_database->Commit(transactionId); |
+} |
+ |
+void IDBDatabaseProxy::Get(int64_t transactionId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* keyRange, bool keyOnly, const indexed_db::mojom::blink::Database::GetCallback& callback) |
+{ |
+ m_database->Get(transactionId, objectStoreId, indexId, createKeyRange(keyRange), keyOnly, callback); |
+} |
+ |
+void IDBDatabaseProxy::GetAll(int64_t transactionId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* keyRange, int64_t maxCount, bool keyOnly) |
+{ |
+ m_database->GetAll(transactionId, objectStoreId, indexId, createKeyRange(keyRange), maxCount, keyOnly); |
+} |
+ |
+#if 0 |
+void IDBDatabaseProxy::Put(int64_t transactionId, int64_t objectStoreId, Vector<int8_t> value, Vector<BlobInfoPtr> blobInfo, IDBKey key, PutMode putMode, Vector<int64_t> indexIds, Vector<Vector<KeyPtr>> indexKeys) |
+{ |
+ m_database->Put(transactionId, objectStoreId, value, blobInfo, key, putMode, indexIds, indexKeys); |
+} |
+#endif |
+ |
+void IDBDatabaseProxy::DeleteRange(int64_t transactionId, int64_t objectStoreId, const IDBKeyRange* keyRange) |
+{ |
+ m_database->DeleteRange(transactionId, objectStoreId, createKeyRange(keyRange)); |
+} |
+ |
+void IDBDatabaseProxy::Clear(int64_t transactionId, int64_t objectStoreId) |
+{ |
+ m_database->Clear(transactionId, objectStoreId); |
+} |
+ |
+void IDBDatabaseProxy::CreateIndex(int64_t transactionId, int64_t objectStoreId, int64_t indexId, const WTF::String& name, const IDBKeyPath& keyPath, bool unique, bool multiEntry) |
+{ |
+ m_database->CreateIndex(transactionId, objectStoreId, indexId, name, createKeyPath(keyPath), unique, multiEntry); |
+} |
+ |
+void IDBDatabaseProxy::DeleteIndex(int64_t transactionId, int64_t objectStoreId, int64_t indexId) |
+{ |
+ m_database->DeleteIndex(transactionId, objectStoreId, indexId); |
+} |
+ |
+void IDBDatabaseProxy::SetIndexKeys(int64_t transactionId, int64_t objectStoreId, const IDBKey* primaryKey, const Vector<int64_t> indexIds, const HeapVector<IDBObjectStore::IndexKeys>& indexKeys) |
+{ |
+#if 0 |
+ Vector<int64_t> idCopy(indexIds); |
+ m_database->SetIndexKeys(transactionId, objectStoreId, createKey(primaryKey), std::move(idCopy), indexKeys); |
+#endif |
+} |
+ |
+void IDBDatabaseProxy::SetIndexesReady(int64_t transactionId, int64_t objectStoreId, const Vector<int64_t> indexIds) |
+{ |
+ Vector<int64_t> indexCopy(indexIds); |
+ m_database->SetIndexesReady(transactionId, objectStoreId, std::move(indexCopy)); |
+} |
+ |
+void IDBDatabaseProxy::OpenCursor(int64_t transactionId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* keyRange, indexed_db::mojom::blink::CursorDirection direction, bool keyOnly, indexed_db::mojom::blink::TaskType taskType) |
+{ |
+ m_database->OpenCursor(transactionId, objectStoreId, indexId, createKeyRange(keyRange), direction, keyOnly, taskType); |
+} |
+ |
+void IDBDatabaseProxy::Count(int64_t transactionId, int64_t objectStoreId, int64_t indexId, const IDBKeyRange* keyRange) |
+{ |
+ m_database->Count(transactionId, objectStoreId, indexId, createKeyRange(keyRange)); |
+} |
+ |
+void IDBDatabaseProxy::AckReceivedBlobs(const Vector<WTF::String> uuids) |
+{ |
+ Vector<WTF::String> uuidsCopy(uuids); |
+ m_database->AckReceivedBlobs(std::move(uuidsCopy)); |
+} |
+ |
+} // namespace blink |