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