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

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

Issue 325683002: [IndexedDB] Use consistent enums on both sides of IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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 19 matching lines...) Expand all
30 #include "bindings/v8/ScriptWrappable.h" 30 #include "bindings/v8/ScriptWrappable.h"
31 #include "bindings/v8/SerializedScriptValue.h" 31 #include "bindings/v8/SerializedScriptValue.h"
32 #include "modules/indexeddb/IDBCursor.h" 32 #include "modules/indexeddb/IDBCursor.h"
33 #include "modules/indexeddb/IDBIndex.h" 33 #include "modules/indexeddb/IDBIndex.h"
34 #include "modules/indexeddb/IDBKey.h" 34 #include "modules/indexeddb/IDBKey.h"
35 #include "modules/indexeddb/IDBKeyRange.h" 35 #include "modules/indexeddb/IDBKeyRange.h"
36 #include "modules/indexeddb/IDBMetadata.h" 36 #include "modules/indexeddb/IDBMetadata.h"
37 #include "modules/indexeddb/IDBRequest.h" 37 #include "modules/indexeddb/IDBRequest.h"
38 #include "modules/indexeddb/IDBTransaction.h" 38 #include "modules/indexeddb/IDBTransaction.h"
39 #include "public/platform/WebIDBCursor.h" 39 #include "public/platform/WebIDBCursor.h"
40 #include "public/platform/WebIDBDatabase.h" 40 #include "public/platform/WebIDBDatabase.h"
jsbell 2014/06/09 16:27:09 Needs to include public/platform/WebIDBTypes.h
Pritam Nikam 2014/06/11 14:07:47 Done.
41 #include "wtf/PassRefPtr.h" 41 #include "wtf/PassRefPtr.h"
42 #include "wtf/RefPtr.h" 42 #include "wtf/RefPtr.h"
43 #include "wtf/text/WTFString.h" 43 #include "wtf/text/WTFString.h"
44 44
45 namespace WebCore { 45 namespace WebCore {
46 46
47 class DOMStringList; 47 class DOMStringList;
48 class IDBAny; 48 class IDBAny;
49 class ExceptionState; 49 class ExceptionState;
50 50
(...skipping 29 matching lines...) Expand all
80 IDBIndex* createIndex(ScriptState* scriptState, const String& name, const Ve ctor<String>& keyPath, const Dictionary& options, ExceptionState& exceptionState ) 80 IDBIndex* createIndex(ScriptState* scriptState, const String& name, const Ve ctor<String>& keyPath, const Dictionary& options, ExceptionState& exceptionState )
81 { 81 {
82 return createIndex(scriptState, name, IDBKeyPath(keyPath), options, exce ptionState); 82 return createIndex(scriptState, name, IDBKeyPath(keyPath), options, exce ptionState);
83 } 83 }
84 IDBIndex* index(const String& name, ExceptionState&); 84 IDBIndex* index(const String& name, ExceptionState&);
85 void deleteIndex(const String& name, ExceptionState&); 85 void deleteIndex(const String& name, ExceptionState&);
86 86
87 IDBRequest* count(ScriptState*, const ScriptValue& range, ExceptionState&); 87 IDBRequest* count(ScriptState*, const ScriptValue& range, ExceptionState&);
88 88
89 // Used by IDBCursor::update(): 89 // Used by IDBCursor::update():
90 IDBRequest* put(ScriptState*, blink::WebIDBDatabase::PutMode, IDBAny* source , ScriptValue&, IDBKey*, ExceptionState&); 90 IDBRequest* put(ScriptState*, blink::PutMode, IDBAny* source, ScriptValue&, IDBKey*, ExceptionState&);
91 91
92 // Used internally and by InspectorIndexedDBAgent: 92 // Used internally and by InspectorIndexedDBAgent:
93 IDBRequest* openCursor(ScriptState*, IDBKeyRange*, blink::WebIDBCursor::Dire ction, blink::WebIDBDatabase::TaskType = blink::WebIDBDatabase::NormalTask); 93 IDBRequest* openCursor(ScriptState*, IDBKeyRange*, blink::Direction, blink:: TaskType = blink::NormalTask);
94 94
95 void markDeleted() { m_deleted = true; } 95 void markDeleted() { m_deleted = true; }
96 bool isDeleted() const { return m_deleted; } 96 bool isDeleted() const { return m_deleted; }
97 void transactionFinished(); 97 void transactionFinished();
98 98
99 const IDBObjectStoreMetadata& metadata() const { return m_metadata; } 99 const IDBObjectStoreMetadata& metadata() const { return m_metadata; }
100 void setMetadata(const IDBObjectStoreMetadata& metadata) { m_metadata = meta data; } 100 void setMetadata(const IDBObjectStoreMetadata& metadata) { m_metadata = meta data; }
101 101
102 typedef HeapVector<Member<IDBKey> > IndexKeys; 102 typedef HeapVector<Member<IDBKey> > IndexKeys;
103 103
104 blink::WebIDBDatabase* backendDB() const; 104 blink::WebIDBDatabase* backendDB() const;
105 105
106 private: 106 private:
107 IDBObjectStore(const IDBObjectStoreMetadata&, IDBTransaction*); 107 IDBObjectStore(const IDBObjectStoreMetadata&, IDBTransaction*);
108 108
109 IDBIndex* createIndex(ScriptState*, const String& name, const IDBKeyPath&, c onst Dictionary&, ExceptionState&); 109 IDBIndex* createIndex(ScriptState*, const String& name, const IDBKeyPath&, c onst Dictionary&, ExceptionState&);
110 IDBIndex* createIndex(ScriptState*, const String& name, const IDBKeyPath&, b ool unique, bool multiEntry, ExceptionState&); 110 IDBIndex* createIndex(ScriptState*, const String& name, const IDBKeyPath&, b ool unique, bool multiEntry, ExceptionState&);
111 IDBRequest* put(ScriptState*, blink::WebIDBDatabase::PutMode, IDBAny* source , ScriptValue&, const ScriptValue& key, ExceptionState&); 111 IDBRequest* put(ScriptState*, blink::PutMode, IDBAny* source, ScriptValue&, const ScriptValue& key, ExceptionState&);
112 112
113 int64_t findIndexId(const String& name) const; 113 int64_t findIndexId(const String& name) const;
114 bool containsIndex(const String& name) const 114 bool containsIndex(const String& name) const
115 { 115 {
116 return findIndexId(name) != IDBIndexMetadata::InvalidId; 116 return findIndexId(name) != IDBIndexMetadata::InvalidId;
117 } 117 }
118 118
119 IDBObjectStoreMetadata m_metadata; 119 IDBObjectStoreMetadata m_metadata;
120 Member<IDBTransaction> m_transaction; 120 Member<IDBTransaction> m_transaction;
121 bool m_deleted; 121 bool m_deleted;
122 122
123 typedef HeapHashMap<String, Member<IDBIndex> > IDBIndexMap; 123 typedef HeapHashMap<String, Member<IDBIndex> > IDBIndexMap;
124 IDBIndexMap m_indexMap; 124 IDBIndexMap m_indexMap;
125 }; 125 };
126 126
127 } // namespace WebCore 127 } // namespace WebCore
128 128
129 #endif // IDBObjectStore_h 129 #endif // IDBObjectStore_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698