| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 } | 114 } |
| 115 if (m_transaction->isFinished()) { | 115 if (m_transaction->isFinished()) { |
| 116 es.throwDOMException(TransactionInactiveError, IDBDatabase::transactionF
inishedErrorMessage); | 116 es.throwDOMException(TransactionInactiveError, IDBDatabase::transactionF
inishedErrorMessage); |
| 117 return 0; | 117 return 0; |
| 118 } | 118 } |
| 119 if (!m_transaction->isActive()) { | 119 if (!m_transaction->isActive()) { |
| 120 es.throwDOMException(TransactionInactiveError, IDBDatabase::transactionI
nactiveErrorMessage); | 120 es.throwDOMException(TransactionInactiveError, IDBDatabase::transactionI
nactiveErrorMessage); |
| 121 return 0; | 121 return 0; |
| 122 } | 122 } |
| 123 if (m_transaction->isReadOnly()) { | 123 if (m_transaction->isReadOnly()) { |
| 124 es.throwDOMException(ReadOnlyError); | 124 es.throwUninformativeAndGenericDOMException(ReadOnlyError); |
| 125 return 0; | 125 return 0; |
| 126 } | 126 } |
| 127 | 127 |
| 128 RefPtr<IDBObjectStore> objectStore = effectiveObjectStore(); | 128 RefPtr<IDBObjectStore> objectStore = effectiveObjectStore(); |
| 129 const IDBKeyPath& keyPath = objectStore->metadata().keyPath; | 129 const IDBKeyPath& keyPath = objectStore->metadata().keyPath; |
| 130 const bool usesInLineKeys = !keyPath.isNull(); | 130 const bool usesInLineKeys = !keyPath.isNull(); |
| 131 if (usesInLineKeys) { | 131 if (usesInLineKeys) { |
| 132 RefPtr<IDBKey> keyPathKey = createIDBKeyFromScriptValueAndKeyPath(m_requ
est->requestState(), value, keyPath); | 132 RefPtr<IDBKey> keyPathKey = createIDBKeyFromScriptValueAndKeyPath(m_requ
est->requestState(), value, keyPath); |
| 133 if (!keyPathKey || !keyPathKey->isEqual(m_primaryKey.get())) { | 133 if (!keyPathKey || !keyPathKey->isEqual(m_primaryKey.get())) { |
| 134 es.throwDOMException(DataError, "The effective object store of this
cursor uses in-line keys and evaluating the key path of the value parameter resu
lts in a different value than the cursor's effective key."); | 134 es.throwDOMException(DataError, "The effective object store of this
cursor uses in-line keys and evaluating the key path of the value parameter resu
lts in a different value than the cursor's effective key."); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 IDB_TRACE("IDBCursor::delete"); | 231 IDB_TRACE("IDBCursor::delete"); |
| 232 if (m_transaction->isFinished()) { | 232 if (m_transaction->isFinished()) { |
| 233 es.throwDOMException(TransactionInactiveError, IDBDatabase::transactionF
inishedErrorMessage); | 233 es.throwDOMException(TransactionInactiveError, IDBDatabase::transactionF
inishedErrorMessage); |
| 234 return 0; | 234 return 0; |
| 235 } | 235 } |
| 236 if (!m_transaction->isActive()) { | 236 if (!m_transaction->isActive()) { |
| 237 es.throwDOMException(TransactionInactiveError, IDBDatabase::transactionI
nactiveErrorMessage); | 237 es.throwDOMException(TransactionInactiveError, IDBDatabase::transactionI
nactiveErrorMessage); |
| 238 return 0; | 238 return 0; |
| 239 } | 239 } |
| 240 if (m_transaction->isReadOnly()) { | 240 if (m_transaction->isReadOnly()) { |
| 241 es.throwDOMException(ReadOnlyError); | 241 es.throwUninformativeAndGenericDOMException(ReadOnlyError); |
| 242 return 0; | 242 return 0; |
| 243 } | 243 } |
| 244 | 244 |
| 245 if (!m_gotValue) { | 245 if (!m_gotValue) { |
| 246 es.throwDOMException(InvalidStateError, IDBDatabase::noValueErrorMessage
); | 246 es.throwDOMException(InvalidStateError, IDBDatabase::noValueErrorMessage
); |
| 247 return 0; | 247 return 0; |
| 248 } | 248 } |
| 249 if (isKeyCursor()) { | 249 if (isKeyCursor()) { |
| 250 es.throwDOMException(InvalidStateError, IDBDatabase::isKeyCursorErrorMes
sage); | 250 es.throwDOMException(InvalidStateError, IDBDatabase::isKeyCursorErrorMes
sage); |
| 251 return 0; | 251 return 0; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 case IndexedDB::CursorPrevNoDuplicate: | 386 case IndexedDB::CursorPrevNoDuplicate: |
| 387 return IDBCursor::directionPrevUnique(); | 387 return IDBCursor::directionPrevUnique(); |
| 388 | 388 |
| 389 default: | 389 default: |
| 390 ASSERT_NOT_REACHED(); | 390 ASSERT_NOT_REACHED(); |
| 391 return IDBCursor::directionNext(); | 391 return IDBCursor::directionNext(); |
| 392 } | 392 } |
| 393 } | 393 } |
| 394 | 394 |
| 395 } // namespace WebCore | 395 } // namespace WebCore |
| OLD | NEW |