| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_ | 5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_ |
| 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_ | 6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 IndexedDBIndexMetadata& operator=(const IndexedDBIndexMetadata& other); | 28 IndexedDBIndexMetadata& operator=(const IndexedDBIndexMetadata& other); |
| 29 | 29 |
| 30 base::string16 name; | 30 base::string16 name; |
| 31 int64_t id; | 31 int64_t id; |
| 32 IndexedDBKeyPath key_path; | 32 IndexedDBKeyPath key_path; |
| 33 bool unique; | 33 bool unique; |
| 34 bool multi_entry; | 34 bool multi_entry; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 struct CONTENT_EXPORT IndexedDBObjectStoreMetadata { | 37 struct CONTENT_EXPORT IndexedDBObjectStoreMetadata { |
| 38 typedef std::map<int64_t, IndexedDBIndexMetadata> IndexMap; | |
| 39 | |
| 40 static const int64_t kInvalidId = -1; | 38 static const int64_t kInvalidId = -1; |
| 41 | 39 |
| 42 IndexedDBObjectStoreMetadata(); | 40 IndexedDBObjectStoreMetadata(); |
| 43 IndexedDBObjectStoreMetadata(const base::string16& name, | 41 IndexedDBObjectStoreMetadata(const base::string16& name, |
| 44 int64_t id, | 42 int64_t id, |
| 45 const IndexedDBKeyPath& key_path, | 43 const IndexedDBKeyPath& key_path, |
| 46 bool auto_increment, | 44 bool auto_increment, |
| 47 int64_t max_index_id); | 45 int64_t max_index_id); |
| 48 IndexedDBObjectStoreMetadata(const IndexedDBObjectStoreMetadata& other); | 46 IndexedDBObjectStoreMetadata(const IndexedDBObjectStoreMetadata& other); |
| 49 ~IndexedDBObjectStoreMetadata(); | 47 ~IndexedDBObjectStoreMetadata(); |
| 50 IndexedDBObjectStoreMetadata& operator=( | 48 IndexedDBObjectStoreMetadata& operator=( |
| 51 const IndexedDBObjectStoreMetadata& other); | 49 const IndexedDBObjectStoreMetadata& other); |
| 52 | 50 |
| 53 base::string16 name; | 51 base::string16 name; |
| 54 int64_t id; | 52 int64_t id; |
| 55 IndexedDBKeyPath key_path; | 53 IndexedDBKeyPath key_path; |
| 56 bool auto_increment; | 54 bool auto_increment; |
| 57 int64_t max_index_id; | 55 int64_t max_index_id; |
| 58 | 56 |
| 59 IndexMap indexes; | 57 std::map<int64_t, IndexedDBIndexMetadata> indexes; |
| 60 }; | 58 }; |
| 61 | 59 |
| 62 struct CONTENT_EXPORT IndexedDBDatabaseMetadata { | 60 struct CONTENT_EXPORT IndexedDBDatabaseMetadata { |
| 63 // TODO(jsbell): These can probably be collapsed into 0. | 61 // TODO(jsbell): These can probably be collapsed into 0. |
| 64 enum { NO_VERSION = -1, DEFAULT_VERSION = 0 }; | 62 enum { NO_VERSION = -1, DEFAULT_VERSION = 0 }; |
| 65 | 63 |
| 66 typedef std::map<int64_t, IndexedDBObjectStoreMetadata> ObjectStoreMap; | |
| 67 | |
| 68 IndexedDBDatabaseMetadata(); | 64 IndexedDBDatabaseMetadata(); |
| 69 IndexedDBDatabaseMetadata(const base::string16& name, | 65 IndexedDBDatabaseMetadata(const base::string16& name, |
| 70 int64_t id, | 66 int64_t id, |
| 71 int64_t version, | 67 int64_t version, |
| 72 int64_t max_object_store_id); | 68 int64_t max_object_store_id); |
| 73 IndexedDBDatabaseMetadata(const IndexedDBDatabaseMetadata& other); | 69 IndexedDBDatabaseMetadata(const IndexedDBDatabaseMetadata& other); |
| 74 ~IndexedDBDatabaseMetadata(); | 70 ~IndexedDBDatabaseMetadata(); |
| 75 IndexedDBDatabaseMetadata& operator=(IndexedDBDatabaseMetadata& other); | 71 IndexedDBDatabaseMetadata& operator=(const IndexedDBDatabaseMetadata& other); |
| 76 | 72 |
| 77 base::string16 name; | 73 base::string16 name; |
| 78 int64_t id; | 74 int64_t id; |
| 79 int64_t version; | 75 int64_t version; |
| 80 int64_t max_object_store_id; | 76 int64_t max_object_store_id; |
| 81 | 77 |
| 82 ObjectStoreMap object_stores; | 78 std::map<int64_t, IndexedDBObjectStoreMetadata> object_stores; |
| 83 }; | 79 }; |
| 84 } // namespace content | 80 } // namespace content |
| 85 | 81 |
| 86 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_ | 82 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_ |
| OLD | NEW |