Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorImpl.cpp (192805 => 192806)
--- trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorImpl.cpp 2015-11-30 18:46:13 UTC (rev 192805)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBCursorImpl.cpp 2015-11-30 19:05:05 UTC (rev 192806)
@@ -139,7 +139,7 @@
return nullptr;
}
- return effectiveObjectStore().put(exec, value.jsValue(), m_deprecatedCurrentPrimaryKey.jsValue(), ec);
+ return effectiveObjectStore().putForCursorUpdate(exec, value.jsValue(), m_deprecatedCurrentPrimaryKey.jsValue(), ec);
}
void IDBCursor::advance(unsigned long count, ExceptionCode& ec)
Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp (192805 => 192806)
--- trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp 2015-11-30 18:46:13 UTC (rev 192805)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.cpp 2015-11-30 19:05:05 UTC (rev 192806)
@@ -203,28 +203,33 @@
RefPtr<WebCore::IDBRequest> IDBObjectStore::add(JSC::ExecState& state, JSC::JSValue value, ExceptionCode& ec)
{
- return putOrAdd(state, value, nullptr, IndexedDB::ObjectStoreOverwriteMode::NoOverwrite, ec);
+ return putOrAdd(state, value, nullptr, IndexedDB::ObjectStoreOverwriteMode::NoOverwrite, InlineKeyCheck::Perform, ec);
}
RefPtr<WebCore::IDBRequest> IDBObjectStore::add(JSC::ExecState& execState, JSC::JSValue value, JSC::JSValue key, ExceptionCode& ec)
{
auto idbKey = scriptValueToIDBKey(execState, key);
- return putOrAdd(execState, value, idbKey, IndexedDB::ObjectStoreOverwriteMode::NoOverwrite, ec);
+ return putOrAdd(execState, value, idbKey, IndexedDB::ObjectStoreOverwriteMode::NoOverwrite, InlineKeyCheck::Perform, ec);
}
RefPtr<WebCore::IDBRequest> IDBObjectStore::put(JSC::ExecState& execState, JSC::JSValue value, JSC::JSValue key, ExceptionCode& ec)
{
auto idbKey = scriptValueToIDBKey(execState, key);
- return putOrAdd(execState, value, idbKey, IndexedDB::ObjectStoreOverwriteMode::Overwrite, ec);
+ return putOrAdd(execState, value, idbKey, IndexedDB::ObjectStoreOverwriteMode::Overwrite, InlineKeyCheck::Perform, ec);
}
RefPtr<WebCore::IDBRequest> IDBObjectStore::put(JSC::ExecState& state, JSC::JSValue value, ExceptionCode& ec)
{
- return putOrAdd(state, value, nullptr, IndexedDB::ObjectStoreOverwriteMode::Overwrite, ec);
+ return putOrAdd(state, value, nullptr, IndexedDB::ObjectStoreOverwriteMode::Overwrite, InlineKeyCheck::Perform, ec);
}
-RefPtr<WebCore::IDBRequest> IDBObjectStore::putOrAdd(JSC::ExecState& state, JSC::JSValue value, RefPtr<IDBKey> key, IndexedDB::ObjectStoreOverwriteMode overwriteMode, ExceptionCode& ec)
+RefPtr<WebCore::IDBRequest> IDBObjectStore::putForCursorUpdate(JSC::ExecState& state, JSC::JSValue value, JSC::JSValue key, ExceptionCode& ec)
{
+ return putOrAdd(state, value, scriptValueToIDBKey(state, key), IndexedDB::ObjectStoreOverwriteMode::Overwrite, InlineKeyCheck::DoNotPerform, ec);
+}
+
+RefPtr<WebCore::IDBRequest> IDBObjectStore::putOrAdd(JSC::ExecState& state, JSC::JSValue value, RefPtr<IDBKey> key, IndexedDB::ObjectStoreOverwriteMode overwriteMode, InlineKeyCheck inlineKeyCheck, ExceptionCode& ec)
+{
LOG(IndexedDB, "IDBObjectStore::putOrAdd");
if (m_transaction->isReadOnly()) {
@@ -261,7 +266,7 @@
bool usesInlineKeys = !m_info.keyPath().isNull();
bool usesKeyGenerator = autoIncrement();
- if (usesInlineKeys) {
+ if (usesInlineKeys && inlineKeyCheck == InlineKeyCheck::Perform) {
if (key) {
ec = static_cast<ExceptionCode>(IDBExceptionCode::DataError);
return nullptr;
Modified: trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h (192805 => 192806)
--- trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h 2015-11-30 18:46:13 UTC (rev 192805)
+++ trunk/Source/WebCore/Modules/indexeddb/client/IDBObjectStoreImpl.h 2015-11-30 19:05:05 UTC (rev 192806)
@@ -78,6 +78,8 @@
virtual RefPtr<WebCore::IDBRequest> count(ScriptExecutionContext*, IDBKeyRange*, ExceptionCode&) override final;
virtual RefPtr<WebCore::IDBRequest> count(ScriptExecutionContext*, const Deprecated::ScriptValue& key, ExceptionCode&) override final;
+ RefPtr<WebCore::IDBRequest> putForCursorUpdate(JSC::ExecState&, JSC::JSValue, JSC::JSValue key, ExceptionCode&);
+
RefPtr<WebCore::IDBRequest> deleteFunction(ScriptExecutionContext*, JSC::JSValue key, ExceptionCode&);
void markAsDeleted();
@@ -92,7 +94,12 @@
private:
IDBObjectStore(const IDBObjectStoreInfo&, IDBTransaction&);
- RefPtr<WebCore::IDBRequest> putOrAdd(JSC::ExecState&, JSC::JSValue, RefPtr<IDBKey>, IndexedDB::ObjectStoreOverwriteMode, ExceptionCode&);
+ enum class InlineKeyCheck {
+ Perform,
+ DoNotPerform,
+ };
+
+ RefPtr<WebCore::IDBRequest> putOrAdd(JSC::ExecState&, JSC::JSValue, RefPtr<IDBKey>, IndexedDB::ObjectStoreOverwriteMode, InlineKeyCheck, ExceptionCode&);
RefPtr<WebCore::IDBRequest> doCount(ScriptExecutionContext&, const IDBKeyRangeData&, ExceptionCode&);
IDBObjectStoreInfo m_info;