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

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

Issue 1007703003: [bindings] Utilize ScriptValue::from and remove IDB* => ScriptValue conversion methods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
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 12 matching lines...) Expand all
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/core/v8/SerializedScriptValueFactory.h"
33 #include "bindings/modules/v8/ToV8ForModules.h"
33 #include "bindings/modules/v8/V8BindingForModules.h" 34 #include "bindings/modules/v8/V8BindingForModules.h"
34 #include "core/dom/DOMStringList.h" 35 #include "core/dom/DOMStringList.h"
35 #include "core/dom/ExceptionCode.h" 36 #include "core/dom/ExceptionCode.h"
36 #include "core/dom/ExecutionContext.h" 37 #include "core/dom/ExecutionContext.h"
37 #include "modules/indexeddb/IDBAny.h" 38 #include "modules/indexeddb/IDBAny.h"
38 #include "modules/indexeddb/IDBCursorWithValue.h" 39 #include "modules/indexeddb/IDBCursorWithValue.h"
39 #include "modules/indexeddb/IDBDatabase.h" 40 #include "modules/indexeddb/IDBDatabase.h"
40 #include "modules/indexeddb/IDBKeyPath.h" 41 #include "modules/indexeddb/IDBKeyPath.h"
41 #include "modules/indexeddb/IDBTracing.h" 42 #include "modules/indexeddb/IDBTracing.h"
42 #include "modules/indexeddb/WebIDBCallbacksImpl.h" 43 #include "modules/indexeddb/WebIDBCallbacksImpl.h"
(...skipping 22 matching lines...) Expand all
65 } 66 }
66 67
67 DEFINE_TRACE(IDBObjectStore) 68 DEFINE_TRACE(IDBObjectStore)
68 { 69 {
69 visitor->trace(m_transaction); 70 visitor->trace(m_transaction);
70 visitor->trace(m_indexMap); 71 visitor->trace(m_indexMap);
71 } 72 }
72 73
73 ScriptValue IDBObjectStore::keyPath(ScriptState* scriptState) const 74 ScriptValue IDBObjectStore::keyPath(ScriptState* scriptState) const
74 { 75 {
75 return idbKeyPathToScriptValue(scriptState, m_metadata.keyPath); 76 return ScriptValue::from(scriptState, m_metadata.keyPath);
76 } 77 }
77 78
78 PassRefPtrWillBeRawPtr<DOMStringList> IDBObjectStore::indexNames() const 79 PassRefPtrWillBeRawPtr<DOMStringList> IDBObjectStore::indexNames() const
79 { 80 {
80 IDB_TRACE("IDBObjectStore::indexNames"); 81 IDB_TRACE("IDBObjectStore::indexNames");
81 RefPtrWillBeRawPtr<DOMStringList> indexNames = DOMStringList::create(); 82 RefPtrWillBeRawPtr<DOMStringList> indexNames = DOMStringList::create();
82 for (IDBObjectStoreMetadata::IndexMap::const_iterator it = m_metadata.indexe s.begin(); it != m_metadata.indexes.end(); ++it) 83 for (IDBObjectStoreMetadata::IndexMap::const_iterator it = m_metadata.indexe s.begin(); it != m_metadata.indexes.end(); ++it)
83 indexNames->append(it->value.name); 84 indexNames->append(it->value.name);
84 indexNames->sort(); 85 indexNames->sort();
85 return indexNames.release(); 86 return indexNames.release();
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 } 669 }
669 return IDBIndexMetadata::InvalidId; 670 return IDBIndexMetadata::InvalidId;
670 } 671 }
671 672
672 WebIDBDatabase* IDBObjectStore::backendDB() const 673 WebIDBDatabase* IDBObjectStore::backendDB() const
673 { 674 {
674 return m_transaction->backendDB(); 675 return m_transaction->backendDB();
675 } 676 }
676 677
677 } // namespace blink 678 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698