OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_ |
| 7 |
| 8 #include <map> |
| 9 |
| 10 #include "base/string16.h" |
| 11 #include "content/common/indexed_db/indexed_db_key_path.h" |
| 12 |
| 13 namespace content { |
| 14 |
| 15 struct IndexedDBIndexMetadata { |
| 16 IndexedDBIndexMetadata() {} |
| 17 IndexedDBIndexMetadata(const string16& name, |
| 18 int64_t id, |
| 19 const IndexedDBKeyPath& key_path, |
| 20 bool unique, |
| 21 bool multi_entry) |
| 22 : name(name), |
| 23 id(id), |
| 24 key_path(key_path), |
| 25 unique(unique), |
| 26 multi_entry(multi_entry) {} |
| 27 string16 name; |
| 28 int64_t id; |
| 29 IndexedDBKeyPath key_path; |
| 30 bool unique; |
| 31 bool multi_entry; |
| 32 |
| 33 static const int64_t InvalidId = -1; |
| 34 }; |
| 35 |
| 36 struct CONTENT_EXPORT IndexedDBObjectStoreMetadata { |
| 37 IndexedDBObjectStoreMetadata(); |
| 38 IndexedDBObjectStoreMetadata(const string16& name, |
| 39 int64_t id, |
| 40 const IndexedDBKeyPath& key_path, |
| 41 bool auto_increment, |
| 42 int64_t max_index_id); |
| 43 ~IndexedDBObjectStoreMetadata(); |
| 44 string16 name; |
| 45 int64_t id; |
| 46 IndexedDBKeyPath key_path; |
| 47 bool auto_increment; |
| 48 int64_t max_index_id; |
| 49 |
| 50 static const int64_t InvalidId = -1; |
| 51 |
| 52 typedef std::map<int64_t, IndexedDBIndexMetadata> IndexMap; |
| 53 IndexMap indexes; |
| 54 |
| 55 }; |
| 56 |
| 57 struct CONTENT_EXPORT IndexedDBDatabaseMetadata { |
| 58 // TODO: These can probably be collapsed into 0. |
| 59 enum { |
| 60 NoIntVersion = -1, |
| 61 DefaultIntVersion = 0 |
| 62 }; |
| 63 |
| 64 typedef std::map<int64_t, IndexedDBObjectStoreMetadata> ObjectStoreMap; |
| 65 |
| 66 IndexedDBDatabaseMetadata(); |
| 67 IndexedDBDatabaseMetadata(const string16& name, |
| 68 int64_t id, |
| 69 const string16& version, |
| 70 int64_t int_version, |
| 71 int64_t max_object_store_id); |
| 72 ~IndexedDBDatabaseMetadata(); |
| 73 |
| 74 string16 name; |
| 75 int64_t id; |
| 76 string16 version; |
| 77 int64_t int_version; |
| 78 int64_t max_object_store_id; |
| 79 |
| 80 ObjectStoreMap object_stores; |
| 81 }; |
| 82 |
| 83 } |
| 84 |
| 85 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_ |
OLD | NEW |