Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(279)

Side by Side Diff: Source/modules/indexeddb/IDBObjectStore.cpp

Issue 18590006: Blob support for IDB [Blink] (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebasing issue? Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698