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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 if (!m_transaction->isActive()) { | 170 if (!m_transaction->isActive()) { |
171 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::
transactionInactiveErrorMessage); | 171 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase::
transactionInactiveErrorMessage); |
172 return 0; | 172 return 0; |
173 } | 173 } |
174 if (m_transaction->isReadOnly()) { | 174 if (m_transaction->isReadOnly()) { |
175 exceptionState.throwDOMException(ReadOnlyError, IDBDatabase::transaction
ReadOnlyErrorMessage); | 175 exceptionState.throwDOMException(ReadOnlyError, IDBDatabase::transaction
ReadOnlyErrorMessage); |
176 return 0; | 176 return 0; |
177 } | 177 } |
178 | 178 |
179 Vector<WebBlobInfo> blobInfo; | 179 Vector<WebBlobInfo> blobInfo; |
180 | |
181 RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::creat
e(value, &blobInfo, exceptionState, scriptState->isolate()); | 180 RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::creat
e(value, &blobInfo, exceptionState, scriptState->isolate()); |
182 if (exceptionState.hadException()) | 181 if (exceptionState.hadException()) |
183 return 0; | 182 return 0; |
184 | 183 |
185 if (serializedValue->containsBlobs()) { | |
186 // FIXME: Add Blob/File/FileList support | |
187 exceptionState.throwDOMException(DataCloneError, "The object store curre
ntly does not support blob values."); | |
188 return 0; | |
189 } | |
190 ASSERT(blobInfo.isEmpty()); | |
191 | |
192 const IDBKeyPath& keyPath = m_metadata.keyPath; | 184 const IDBKeyPath& keyPath = m_metadata.keyPath; |
193 const bool usesInLineKeys = !keyPath.isNull(); | 185 const bool usesInLineKeys = !keyPath.isNull(); |
194 const bool hasKeyGenerator = autoIncrement(); | 186 const bool hasKeyGenerator = autoIncrement(); |
195 | 187 |
196 if (putMode != WebIDBDatabase::CursorUpdate && usesInLineKeys && key) { | 188 if (putMode != WebIDBDatabase::CursorUpdate && usesInLineKeys && key) { |
197 exceptionState.throwDOMException(DataError, "The object store uses in-li
ne keys and the key parameter was provided."); | 189 exceptionState.throwDOMException(DataError, "The object store uses in-li
ne keys and the key parameter was provided."); |
198 return 0; | 190 return 0; |
199 } | 191 } |
200 if (!usesInLineKeys && !hasKeyGenerator && !key) { | 192 if (!usesInLineKeys && !hasKeyGenerator && !key) { |
201 exceptionState.throwDOMException(DataError, "The object store uses out-o
f-line keys and has no key generator and the key parameter was not provided."); | 193 exceptionState.throwDOMException(DataError, "The object store uses out-o
f-line keys and has no key generator and the key parameter was not provided."); |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
668 } | 660 } |
669 return IDBIndexMetadata::InvalidId; | 661 return IDBIndexMetadata::InvalidId; |
670 } | 662 } |
671 | 663 |
672 WebIDBDatabase* IDBObjectStore::backendDB() const | 664 WebIDBDatabase* IDBObjectStore::backendDB() const |
673 { | 665 { |
674 return m_transaction->backendDB(); | 666 return m_transaction->backendDB(); |
675 } | 667 } |
676 | 668 |
677 } // namespace WebCore | 669 } // namespace WebCore |
OLD | NEW |