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..100a5bc6e2904c070173d299197f15313129a91f 100644 |
--- a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp |
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.cpp |
@@ -71,6 +71,38 @@ DEFINE_TRACE(IDBObjectStore) |
visitor->trace(m_createdIndexes); |
} |
+void IDBObjectStore::setName(const String& name, ExceptionState& exceptionState) |
+{ |
+ IDB_TRACE("IDBObjectStore::setName"); |
+ if (!m_transaction->isVersionChange()) { |
+ exceptionState.throwDOMException(InvalidStateError, IDBDatabase::notVersionChangeTransactionErrorMessage); |
+ return; |
+ } |
+ if (isDeleted()) { |
+ exceptionState.throwDOMException(InvalidStateError, IDBDatabase::objectStoreDeletedErrorMessage); |
+ return; |
+ } |
+ if (m_transaction->isFinished() || m_transaction->isFinishing()) { |
+ exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionFinishedErrorMessage); |
+ return; |
+ } |
+ if (!m_transaction->isActive()) { |
+ exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::transactionInactiveErrorMessage); |
+ return; |
+ } |
+ |
+ if (m_transaction->db()->containsObjectStore(name)) { |
+ exceptionState.throwDOMException(ConstraintError, "An object store with the specified name already exists."); |
+ return; |
+ } |
+ if (!backendDB()) { |
+ exceptionState.throwDOMException(InvalidStateError, IDBDatabase::databaseClosedErrorMessage); |
+ return; |
+ } |
+ |
+ m_metadata.name = name; |
+} |
+ |
ScriptValue IDBObjectStore::keyPath(ScriptState* scriptState) const |
{ |
return ScriptValue::from(scriptState, m_metadata.keyPath); |