Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp

Issue 2320213004: Port IndexedDB open() and database callbacks to Mojo. (Closed)
Patch Set: Make DatabaseClient an associated interface. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp
index 737435363e2c49374c8f701e580bee84ac3ef43b..f30ad68c58cb881dbdda93725d0edc62f28bcd6e 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBFactory.cpp
@@ -34,17 +34,16 @@
#include "core/dom/Document.h"
#include "core/dom/ExceptionCode.h"
#include "modules/indexeddb/IDBDatabase.h"
-#include "modules/indexeddb/IDBDatabaseCallbacks.h"
#include "modules/indexeddb/IDBKey.h"
#include "modules/indexeddb/IDBTracing.h"
#include "modules/indexeddb/IndexedDBClient.h"
#include "modules/indexeddb/WebIDBCallbacksImpl.h"
-#include "modules/indexeddb/WebIDBDatabaseCallbacksImpl.h"
#include "platform/Histogram.h"
#include "platform/weborigin/SecurityOrigin.h"
#include "public/platform/Platform.h"
#include "public/platform/WebSecurityOrigin.h"
#include "public/platform/modules/indexeddb/WebIDBFactory.h"
+#include "public/platform/modules/indexeddb/indexed_db.mojom-blink.h"
#include <memory>
namespace blink {
@@ -107,16 +106,19 @@ IDBOpenDBRequest* IDBFactory::openInternal(ScriptState* scriptState, const Strin
return nullptr;
}
- IDBDatabaseCallbacks* databaseCallbacks = IDBDatabaseCallbacks::create();
int64_t transactionId = IDBDatabase::nextTransactionId();
- IDBOpenDBRequest* request = IDBOpenDBRequest::create(scriptState, databaseCallbacks, transactionId, version);
+ IDBOpenDBRequest* request = IDBOpenDBRequest::create(scriptState, transactionId, version);
if (!IndexedDBClient::from(scriptState->getExecutionContext())->allowIndexedDB(scriptState->getExecutionContext(), name)) {
request->onError(DOMException::create(UnknownError, permissionDeniedErrorMessage));
return request;
}
- Platform::current()->idbFactory()->open(name, version, transactionId, WebIDBCallbacksImpl::create(request).release(), WebIDBDatabaseCallbacksImpl::create(databaseCallbacks).release(), WebSecurityOrigin(scriptState->getExecutionContext()->getSecurityOrigin()));
+ mojo::ScopedInterfaceEndpointHandle clientInterfaceEndpoint;
+ Platform::current()->idbFactory()->open(name, version, transactionId, WebIDBCallbacksImpl::create(request).release(), &clientInterfaceEndpoint, WebSecurityOrigin(scriptState->getExecutionContext()->getSecurityOrigin()));
+ indexed_db::mojom::blink::DatabaseClientAssociatedRequest clientRequest;
+ clientRequest.Bind(std::move(clientInterfaceEndpoint));
+ request->setClientRequest(std::move(clientRequest));
return request;
}
@@ -137,7 +139,7 @@ IDBOpenDBRequest* IDBFactory::deleteDatabase(ScriptState* scriptState, const Str
return nullptr;
}
- IDBOpenDBRequest* request = IDBOpenDBRequest::create(scriptState, nullptr, 0, IDBDatabaseMetadata::DefaultVersion);
+ IDBOpenDBRequest* request = IDBOpenDBRequest::create(scriptState, 0, IDBDatabaseMetadata::DefaultVersion);
if (!IndexedDBClient::from(scriptState->getExecutionContext())->allowIndexedDB(scriptState->getExecutionContext(), name)) {
request->onError(DOMException::create(UnknownError, permissionDeniedErrorMessage));

Powered by Google App Engine
This is Rietveld 408576698