| 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 <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "content/common/indexed_db/indexed_db_key_path.h" | 12 #include "content/common/indexed_db/indexed_db_key_path.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 struct IndexedDBIndexMetadata { | 16 struct IndexedDBIndexMetadata { |
| 17 IndexedDBIndexMetadata() {} | 17 IndexedDBIndexMetadata() {} |
| 18 IndexedDBIndexMetadata(const string16& name, | 18 IndexedDBIndexMetadata(const base::string16& name, |
| 19 int64 id, | 19 int64 id, |
| 20 const IndexedDBKeyPath& key_path, | 20 const IndexedDBKeyPath& key_path, |
| 21 bool unique, | 21 bool unique, |
| 22 bool multi_entry) | 22 bool multi_entry) |
| 23 : name(name), | 23 : name(name), |
| 24 id(id), | 24 id(id), |
| 25 key_path(key_path), | 25 key_path(key_path), |
| 26 unique(unique), | 26 unique(unique), |
| 27 multi_entry(multi_entry) {} | 27 multi_entry(multi_entry) {} |
| 28 string16 name; | 28 base::string16 name; |
| 29 int64 id; | 29 int64 id; |
| 30 IndexedDBKeyPath key_path; | 30 IndexedDBKeyPath key_path; |
| 31 bool unique; | 31 bool unique; |
| 32 bool multi_entry; | 32 bool multi_entry; |
| 33 | 33 |
| 34 static const int64 kInvalidId = -1; | 34 static const int64 kInvalidId = -1; |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 struct CONTENT_EXPORT IndexedDBObjectStoreMetadata { | 37 struct CONTENT_EXPORT IndexedDBObjectStoreMetadata { |
| 38 IndexedDBObjectStoreMetadata(); | 38 IndexedDBObjectStoreMetadata(); |
| 39 IndexedDBObjectStoreMetadata(const string16& name, | 39 IndexedDBObjectStoreMetadata(const base::string16& name, |
| 40 int64 id, | 40 int64 id, |
| 41 const IndexedDBKeyPath& key_path, | 41 const IndexedDBKeyPath& key_path, |
| 42 bool auto_increment, | 42 bool auto_increment, |
| 43 int64 max_index_id); | 43 int64 max_index_id); |
| 44 ~IndexedDBObjectStoreMetadata(); | 44 ~IndexedDBObjectStoreMetadata(); |
| 45 string16 name; | 45 base::string16 name; |
| 46 int64 id; | 46 int64 id; |
| 47 IndexedDBKeyPath key_path; | 47 IndexedDBKeyPath key_path; |
| 48 bool auto_increment; | 48 bool auto_increment; |
| 49 int64 max_index_id; | 49 int64 max_index_id; |
| 50 | 50 |
| 51 static const int64 kInvalidId = -1; | 51 static const int64 kInvalidId = -1; |
| 52 | 52 |
| 53 typedef std::map<int64, IndexedDBIndexMetadata> IndexMap; | 53 typedef std::map<int64, IndexedDBIndexMetadata> IndexMap; |
| 54 IndexMap indexes; | 54 IndexMap indexes; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 struct CONTENT_EXPORT IndexedDBDatabaseMetadata { | 57 struct CONTENT_EXPORT IndexedDBDatabaseMetadata { |
| 58 // TODO(jsbell): These can probably be collapsed into 0. | 58 // TODO(jsbell): These can probably be collapsed into 0. |
| 59 enum { | 59 enum { |
| 60 NO_INT_VERSION = -1, | 60 NO_INT_VERSION = -1, |
| 61 DEFAULT_INT_VERSION = 0 | 61 DEFAULT_INT_VERSION = 0 |
| 62 }; | 62 }; |
| 63 | 63 |
| 64 typedef std::map<int64, IndexedDBObjectStoreMetadata> ObjectStoreMap; | 64 typedef std::map<int64, IndexedDBObjectStoreMetadata> ObjectStoreMap; |
| 65 | 65 |
| 66 IndexedDBDatabaseMetadata(); | 66 IndexedDBDatabaseMetadata(); |
| 67 IndexedDBDatabaseMetadata(const string16& name, | 67 IndexedDBDatabaseMetadata(const base::string16& name, |
| 68 int64 id, | 68 int64 id, |
| 69 const string16& version, | 69 const base::string16& version, |
| 70 int64 int_version, | 70 int64 int_version, |
| 71 int64 max_object_store_id); | 71 int64 max_object_store_id); |
| 72 ~IndexedDBDatabaseMetadata(); | 72 ~IndexedDBDatabaseMetadata(); |
| 73 | 73 |
| 74 string16 name; | 74 base::string16 name; |
| 75 int64 id; | 75 int64 id; |
| 76 string16 version; | 76 base::string16 version; |
| 77 int64 int_version; | 77 int64 int_version; |
| 78 int64 max_object_store_id; | 78 int64 max_object_store_id; |
| 79 | 79 |
| 80 ObjectStoreMap object_stores; | 80 ObjectStoreMap object_stores; |
| 81 }; | 81 }; |
| 82 } | 82 } |
| 83 | 83 |
| 84 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_ | 84 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_ |
| OLD | NEW |