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

Unified Diff: Source/modules/indexeddb/IDBObjectStore.cpp

Issue 325683002: [IndexedDB] Use consistent enums on both sides of IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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: Source/modules/indexeddb/IDBObjectStore.cpp
diff --git a/Source/modules/indexeddb/IDBObjectStore.cpp b/Source/modules/indexeddb/IDBObjectStore.cpp
index a54d93e15d207f5c6e7281acb795825ea66a9218..552ce0c4f97a12bb16ca31cd56b6b39568592f12 100644
--- a/Source/modules/indexeddb/IDBObjectStore.cpp
+++ b/Source/modules/indexeddb/IDBObjectStore.cpp
@@ -143,22 +143,22 @@ static void generateIndexKeysForValue(v8::Isolate* isolate, const IDBIndexMetada
IDBRequest* IDBObjectStore::add(ScriptState* scriptState, ScriptValue& value, const ScriptValue& key, ExceptionState& exceptionState)
{
IDB_TRACE("IDBObjectStore::add");
- return put(scriptState, WebIDBDatabase::AddOnly, IDBAny::create(this), value, key, exceptionState);
+ return put(scriptState, blink::AddOnly, IDBAny::create(this), value, key, exceptionState);
}
IDBRequest* IDBObjectStore::put(ScriptState* scriptState, ScriptValue& value, const ScriptValue& key, ExceptionState& exceptionState)
{
IDB_TRACE("IDBObjectStore::put");
- return put(scriptState, WebIDBDatabase::AddOrUpdate, IDBAny::create(this), value, key, exceptionState);
+ return put(scriptState, blink::AddOrUpdate, IDBAny::create(this), value, key, exceptionState);
}
-IDBRequest* IDBObjectStore::put(ScriptState* scriptState, WebIDBDatabase::PutMode putMode, IDBAny* source, ScriptValue& value, const ScriptValue& keyValue, ExceptionState& exceptionState)
+IDBRequest* IDBObjectStore::put(ScriptState* scriptState, blink::PutMode putMode, IDBAny* source, ScriptValue& value, const ScriptValue& keyValue, ExceptionState& exceptionState)
{
IDBKey* key = keyValue.isUndefined() ? nullptr : scriptValueToIDBKey(scriptState->isolate(), keyValue);
return put(scriptState, putMode, source, value, key, exceptionState);
}
-IDBRequest* IDBObjectStore::put(ScriptState* scriptState, WebIDBDatabase::PutMode putMode, IDBAny* source, ScriptValue& value, IDBKey* key, ExceptionState& exceptionState)
+IDBRequest* IDBObjectStore::put(ScriptState* scriptState, blink::PutMode putMode, IDBAny* source, ScriptValue& value, IDBKey* key, ExceptionState& exceptionState)
{
if (isDeleted()) {
exceptionState.throwDOMException(InvalidStateError, IDBDatabase::objectStoreDeletedErrorMessage);
@@ -194,7 +194,7 @@ IDBRequest* IDBObjectStore::put(ScriptState* scriptState, WebIDBDatabase::PutMod
const bool usesInLineKeys = !keyPath.isNull();
const bool hasKeyGenerator = autoIncrement();
- if (putMode != WebIDBDatabase::CursorUpdate && usesInLineKeys && key) {
+ if (putMode != blink::CursorUpdate && usesInLineKeys && key) {
exceptionState.throwDOMException(DataError, "The object store uses in-line keys and the key parameter was provided.");
return 0;
}
@@ -245,7 +245,7 @@ IDBRequest* IDBObjectStore::put(ScriptState* scriptState, WebIDBDatabase::PutMod
serializedValue->toWireBytes(wireBytes);
RefPtr<SharedBuffer> valueBuffer = SharedBuffer::adoptVector(wireBytes);
- backendDB()->put(m_transaction->id(), id(), blink::WebData(valueBuffer), blobInfo, key, static_cast<WebIDBDatabase::PutMode>(putMode), WebIDBCallbacksImpl::create(request).leakPtr(), indexIds, indexKeys);
+ backendDB()->put(m_transaction->id(), id(), blink::WebData(valueBuffer), blobInfo, key, static_cast<blink::PutMode>(putMode), WebIDBCallbacksImpl::create(request).leakPtr(), indexIds, indexKeys);
return request;
}
@@ -458,7 +458,7 @@ IDBIndex* IDBObjectStore::createIndex(ScriptState* scriptState, const String& na
if (exceptionState.hadException())
return 0;
- IDBRequest* indexRequest = openCursor(scriptState, static_cast<IDBKeyRange*>(0), blink::WebIDBCursor::Next, WebIDBDatabase::PreemptiveTask);
+ IDBRequest* indexRequest = openCursor(scriptState, static_cast<IDBKeyRange*>(0), blink::Next, blink::PreemptiveTask);
indexRequest->preventPropagation();
// This is kept alive by being the success handler of the request, which is in turn kept alive by the owning transaction.
@@ -560,7 +560,7 @@ IDBRequest* IDBObjectStore::openCursor(ScriptState* scriptState, const ScriptVal
return 0;
}
- WebIDBCursor::Direction direction = IDBCursor::stringToDirection(directionString, exceptionState);
+ blink::Direction direction = IDBCursor::stringToDirection(directionString, exceptionState);
if (exceptionState.hadException())
return 0;
@@ -573,10 +573,10 @@ IDBRequest* IDBObjectStore::openCursor(ScriptState* scriptState, const ScriptVal
return 0;
}
- return openCursor(scriptState, keyRange, direction, WebIDBDatabase::NormalTask);
+ return openCursor(scriptState, keyRange, direction, blink::NormalTask);
}
-IDBRequest* IDBObjectStore::openCursor(ScriptState* scriptState, IDBKeyRange* range, WebIDBCursor::Direction direction, WebIDBDatabase::TaskType taskType)
+IDBRequest* IDBObjectStore::openCursor(ScriptState* scriptState, IDBKeyRange* range, blink::Direction direction, blink::TaskType taskType)
{
IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get());
request->setCursorDetails(IndexedDB::CursorKeyAndValue, direction);
@@ -601,7 +601,7 @@ IDBRequest* IDBObjectStore::openKeyCursor(ScriptState* scriptState, const Script
return 0;
}
- WebIDBCursor::Direction direction = IDBCursor::stringToDirection(directionString, exceptionState);
+ blink::Direction direction = IDBCursor::stringToDirection(directionString, exceptionState);
if (exceptionState.hadException())
return 0;
@@ -617,7 +617,7 @@ IDBRequest* IDBObjectStore::openKeyCursor(ScriptState* scriptState, const Script
IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get());
request->setCursorDetails(IndexedDB::CursorKeyOnly, direction);
- backendDB()->openCursor(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, keyRange, direction, true, WebIDBDatabase::NormalTask, WebIDBCallbacksImpl::create(request).leakPtr());
+ backendDB()->openCursor(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, keyRange, direction, true, blink::NormalTask, WebIDBCallbacksImpl::create(request).leakPtr());
return request;
}

Powered by Google App Engine
This is Rietveld 408576698