| Index: third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp
|
| diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp
|
| index 2f035a201a6dd6e53b3f691d8f07dbd57a52a8e3..ec21129359299443b6d05625de0b5fe9d3132d97 100644
|
| --- a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp
|
| +++ b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp
|
| @@ -114,7 +114,39 @@ IDBRequest* IDBObjectStore::get(ScriptState* scriptState, const ScriptValue& key
|
| }
|
|
|
| IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get());
|
| - backendDB()->get(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, keyRange, false, WebIDBCallbacksImpl::create(request).release());
|
| + backendDB()->get(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, keyRange, false /* keyOnly */, WebIDBCallbacksImpl::create(request).release());
|
| + return request;
|
| +}
|
| +
|
| +IDBRequest* IDBObjectStore::getKey(ScriptState* scriptState, const ScriptValue& key, ExceptionState& exceptionState)
|
| +{
|
| + IDB_TRACE("IDBObjectStore::getKey");
|
| + if (isDeleted()) {
|
| + exceptionState.throwDOMException(InvalidStateError, IDBDatabase::objectStoreDeletedErrorMessage);
|
| + return nullptr;
|
| + }
|
| + if (m_transaction->isFinished() || m_transaction->isFinishing()) {
|
| + exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionFinishedErrorMessage);
|
| + return nullptr;
|
| + }
|
| + if (!m_transaction->isActive()) {
|
| + exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionInactiveErrorMessage);
|
| + return nullptr;
|
| + }
|
| + IDBKeyRange* keyRange = IDBKeyRange::fromScriptValue(scriptState->getExecutionContext(), key, exceptionState);
|
| + if (exceptionState.hadException())
|
| + return nullptr;
|
| + if (!keyRange) {
|
| + exceptionState.throwDOMException(DataError, IDBDatabase::noKeyOrKeyRangeErrorMessage);
|
| + return nullptr;
|
| + }
|
| + if (!backendDB()) {
|
| + exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databaseClosedErrorMessage);
|
| + return nullptr;
|
| + }
|
| +
|
| + IDBRequest* request = IDBRequest::create(scriptState, IDBAny::create(this), m_transaction.get());
|
| + backendDB()->get(m_transaction->id(), id(), IDBIndexMetadata::InvalidId, keyRange, true /* keyOnly */, WebIDBCallbacksImpl::create(request).release());
|
| return request;
|
| }
|
|
|
|
|