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

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

Issue 718383003: bindings: fixed incorrect dependency of SerializedScriptValue. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added fast/js/structured-clone.html Created 6 years 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
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 11 matching lines...) Expand all
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "config.h" 26 #include "config.h"
27 #include "modules/indexeddb/IDBObjectStore.h" 27 #include "modules/indexeddb/IDBObjectStore.h"
28 28
29 #include "bindings/core/v8/ExceptionState.h" 29 #include "bindings/core/v8/ExceptionState.h"
30 #include "bindings/core/v8/ExceptionStatePlaceholder.h" 30 #include "bindings/core/v8/ExceptionStatePlaceholder.h"
31 #include "bindings/core/v8/ScriptState.h" 31 #include "bindings/core/v8/ScriptState.h"
32 #include "bindings/core/v8/SerializedScriptValueFactory.h"
32 #include "bindings/modules/v8/IDBBindingUtilities.h" 33 #include "bindings/modules/v8/IDBBindingUtilities.h"
33 #include "core/dom/DOMStringList.h" 34 #include "core/dom/DOMStringList.h"
34 #include "core/dom/ExceptionCode.h" 35 #include "core/dom/ExceptionCode.h"
35 #include "core/dom/ExecutionContext.h" 36 #include "core/dom/ExecutionContext.h"
36 #include "modules/indexeddb/IDBAny.h" 37 #include "modules/indexeddb/IDBAny.h"
37 #include "modules/indexeddb/IDBCursorWithValue.h" 38 #include "modules/indexeddb/IDBCursorWithValue.h"
38 #include "modules/indexeddb/IDBDatabase.h" 39 #include "modules/indexeddb/IDBDatabase.h"
39 #include "modules/indexeddb/IDBKeyPath.h" 40 #include "modules/indexeddb/IDBKeyPath.h"
40 #include "modules/indexeddb/IDBTracing.h" 41 #include "modules/indexeddb/IDBTracing.h"
41 #include "modules/indexeddb/WebIDBCallbacksImpl.h" 42 #include "modules/indexeddb/WebIDBCallbacksImpl.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 if (!m_transaction->isActive()) { 171 if (!m_transaction->isActive()) {
171 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage); 172 exceptionState.throwDOMException(TransactionInactiveError, IDBDatabase:: transactionInactiveErrorMessage);
172 return 0; 173 return 0;
173 } 174 }
174 if (m_transaction->isReadOnly()) { 175 if (m_transaction->isReadOnly()) {
175 exceptionState.throwDOMException(ReadOnlyError, IDBDatabase::transaction ReadOnlyErrorMessage); 176 exceptionState.throwDOMException(ReadOnlyError, IDBDatabase::transaction ReadOnlyErrorMessage);
176 return 0; 177 return 0;
177 } 178 }
178 179
179 Vector<WebBlobInfo> blobInfo; 180 Vector<WebBlobInfo> blobInfo;
180 RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValue::creat e(value, &blobInfo, exceptionState, scriptState->isolate()); 181 RefPtr<SerializedScriptValue> serializedValue = SerializedScriptValueFactory ::instance().create(value, &blobInfo, exceptionState, scriptState->isolate());
181 if (exceptionState.hadException()) 182 if (exceptionState.hadException())
182 return 0; 183 return 0;
183 184
184 // Keys that need to be extracted must be taken from a clone so that 185 // Keys that need to be extracted must be taken from a clone so that
185 // side effects (i.e. getters) are not triggered. Construct the 186 // side effects (i.e. getters) are not triggered. Construct the
186 // clone lazily since the operation may be expensive. 187 // clone lazily since the operation may be expensive.
187 ScriptValue clone; 188 ScriptValue clone;
188 189
189 const IDBKeyPath& keyPath = m_metadata.keyPath; 190 const IDBKeyPath& keyPath = m_metadata.keyPath;
190 const bool usesInLineKeys = !keyPath.isNull(); 191 const bool usesInLineKeys = !keyPath.isNull();
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
671 } 672 }
672 return IDBIndexMetadata::InvalidId; 673 return IDBIndexMetadata::InvalidId;
673 } 674 }
674 675
675 WebIDBDatabase* IDBObjectStore::backendDB() const 676 WebIDBDatabase* IDBObjectStore::backendDB() const
676 { 677 {
677 return m_transaction->backendDB(); 678 return m_transaction->backendDB();
678 } 679 }
679 680
680 } // namespace blink 681 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/testing/Internals.cpp ('k') | Source/modules/serviceworkers/ServiceWorkerContainer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698