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

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

Issue 1963293002: Replacing Indexed DB Chromium IPC with Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring after Passing URLRequestContextGetter. Created 4 years, 4 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/IDBIndex.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp
index 86e2166751b60c43799b018e011b477ce57e10a7..58e3ee36564b91b34c715a1a4f4c7fbade7b863e 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBIndex.cpp
@@ -31,17 +31,15 @@
#include "core/dom/ExceptionCode.h"
#include "core/dom/ExecutionContext.h"
#include "modules/indexeddb/IDBDatabase.h"
+#include "modules/indexeddb/IDBDatabaseProxy.h"
#include "modules/indexeddb/IDBKey.h"
#include "modules/indexeddb/IDBObjectStore.h"
#include "modules/indexeddb/IDBTracing.h"
#include "modules/indexeddb/IDBTransaction.h"
-#include "modules/indexeddb/WebIDBCallbacksImpl.h"
#include "public/platform/modules/indexeddb/WebIDBKeyRange.h"
#include <memory>
-using blink::WebIDBCallbacks;
-using blink::WebIDBCursor;
-using blink::WebIDBDatabase;
+using indexed_db::mojom::blink::CursorDirection;
namespace blink {
@@ -85,7 +83,7 @@ IDBRequest* IDBIndex::openCursor(ScriptState* scriptState, const ScriptValue& ra
exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionInactiveErrorMessage);
return nullptr;
}
- WebIDBCursorDirection direction = IDBCursor::stringToDirection(directionString);
+ CursorDirection direction = IDBCursor::stringToDirection(directionString);
IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), range, exceptionState);
if (exceptionState.hadException())
return nullptr;
@@ -98,11 +96,11 @@ IDBRequest* IDBIndex::openCursor(ScriptState* scriptState, const ScriptValue& ra
return openCursor(scriptState, keyRange, direction);
}
-IDBRequest* IDBIndex::openCursor(ScriptState* scriptState, IDBKeyRange* keyRange, WebIDBCursorDirection direction)
+IDBRequest* IDBIndex::openCursor(ScriptState* scriptState, IDBKeyRange* keyRange, CursorDirection direction)
{
IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get());
request->setCursorDetails(IndexedDB::CursorKeyAndValue, direction);
- backendDB()->openCursor(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, direction, false, WebIDBTaskTypeNormal, WebIDBCallbacksImpl::create(request).release());
+ backendDB()->OpenCursor(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, direction, false, indexed_db::mojom::blink::TaskType::Normal);
return request;
}
@@ -132,7 +130,7 @@ IDBRequest* IDBIndex::count(ScriptState* scriptState, const ScriptValue& range,
}
IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get());
- backendDB()->count(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, WebIDBCallbacksImpl::create(request).release());
+ backendDB()->Count(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange);
return request;
}
@@ -151,7 +149,7 @@ IDBRequest* IDBIndex::openKeyCursor(ScriptState* scriptState, const ScriptValue&
exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionInactiveErrorMessage);
return nullptr;
}
- WebIDBCursorDirection direction = IDBCursor::stringToDirection(directionString);
+ CursorDirection direction = IDBCursor::stringToDirection(directionString);
IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), range, exceptionState);
if (exceptionState.hadException())
return nullptr;
@@ -162,7 +160,7 @@ IDBRequest* IDBIndex::openKeyCursor(ScriptState* scriptState, const ScriptValue&
IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get());
request->setCursorDetails(IndexedDB::CursorKeyOnly, direction);
- backendDB()->openCursor(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, direction, true, WebIDBTaskTypeNormal, WebIDBCallbacksImpl::create(request).release());
+ backendDB()->OpenCursor(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, direction, true, indexed_db::mojom::blink::TaskType::Normal);
return request;
}
@@ -228,7 +226,8 @@ IDBRequest* IDBIndex::getInternal(ScriptState* scriptState, const ScriptValue& k
}
IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get());
- backendDB()->get(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, keyOnly, WebIDBCallbacksImpl::create(request).release());
+ indexed_db::mojom::blink::Database::GetCallback getCallback = convertToBaseCallback(WTF::bind(&IDBRequest::onGetResult, wrapWeakPersistent(request)));
+ backendDB()->Get(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, keyOnly, getCallback);
return request;
}
@@ -259,11 +258,11 @@ IDBRequest* IDBIndex::getAllInternal(ScriptState* scriptState, const ScriptValue
}
IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get());
- backendDB()->getAll(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, maxCount, keyOnly, WebIDBCallbacksImpl::create(request).release());
+ backendDB()->GetAll(m_transaction->id(), m_objectStore->id(), m_metadata.id, keyRange, maxCount, keyOnly);
return request;
}
-WebIDBDatabase* IDBIndex::backendDB() const
+IDBDatabaseProxy* IDBIndex::backendDB() const
{
return m_transaction->backendDB();
}
« no previous file with comments | « third_party/WebKit/Source/modules/indexeddb/IDBIndex.h ('k') | third_party/WebKit/Source/modules/indexeddb/IDBKeyPath.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698