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

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

Issue 1009503003: [bindings] Introduce ScriptValue.to<T> to convert to native values. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Patch for landing Created 5 years, 9 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
« no previous file with comments | « Source/modules/indexeddb/IDBKeyRange.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 148 }
149 149
150 IDBRequest* IDBObjectStore::put(ScriptState* scriptState, const ScriptValue& val ue, const ScriptValue& key, ExceptionState& exceptionState) 150 IDBRequest* IDBObjectStore::put(ScriptState* scriptState, const ScriptValue& val ue, const ScriptValue& key, ExceptionState& exceptionState)
151 { 151 {
152 IDB_TRACE("IDBObjectStore::put"); 152 IDB_TRACE("IDBObjectStore::put");
153 return put(scriptState, WebIDBPutModeAddOrUpdate, IDBAny::create(this), valu e, key, exceptionState); 153 return put(scriptState, WebIDBPutModeAddOrUpdate, IDBAny::create(this), valu e, key, exceptionState);
154 } 154 }
155 155
156 IDBRequest* IDBObjectStore::put(ScriptState* scriptState, WebIDBPutMode putMode, IDBAny* source, const ScriptValue& value, const ScriptValue& keyValue, Exceptio nState& exceptionState) 156 IDBRequest* IDBObjectStore::put(ScriptState* scriptState, WebIDBPutMode putMode, IDBAny* source, const ScriptValue& value, const ScriptValue& keyValue, Exceptio nState& exceptionState)
157 { 157 {
158 IDBKey* key = keyValue.isUndefined() ? nullptr : scriptValueToIDBKey(scriptS tate->isolate(), keyValue); 158 IDBKey* key = keyValue.isUndefined() ? nullptr : keyValue.to<IDBKey*>(except ionState);
159 return put(scriptState, putMode, source, value, key, exceptionState); 159 return put(scriptState, putMode, source, value, key, exceptionState);
160 } 160 }
161 161
162 IDBRequest* IDBObjectStore::put(ScriptState* scriptState, WebIDBPutMode putMode, IDBAny* source, const ScriptValue& value, IDBKey* key, ExceptionState& exceptio nState) 162 IDBRequest* IDBObjectStore::put(ScriptState* scriptState, WebIDBPutMode putMode, IDBAny* source, const ScriptValue& value, IDBKey* key, ExceptionState& exceptio nState)
163 { 163 {
164 if (isDeleted()) { 164 if (isDeleted()) {
165 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::objectS toreDeletedErrorMessage); 165 exceptionState.throwDOMException(InvalidStateError, IDBDatabase::objectS toreDeletedErrorMessage);
166 return 0; 166 return 0;
167 } 167 }
168 if (m_transaction->isFinished() || m_transaction->isFinishing()) { 168 if (m_transaction->isFinished() || m_transaction->isFinishing()) {
(...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 } 669 }
670 return IDBIndexMetadata::InvalidId; 670 return IDBIndexMetadata::InvalidId;
671 } 671 }
672 672
673 WebIDBDatabase* IDBObjectStore::backendDB() const 673 WebIDBDatabase* IDBObjectStore::backendDB() const
674 { 674 {
675 return m_transaction->backendDB(); 675 return m_transaction->backendDB();
676 } 676 }
677 677
678 } // namespace blink 678 } // namespace blink
OLDNEW
« no previous file with comments | « Source/modules/indexeddb/IDBKeyRange.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698