| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 21 matching lines...) Expand all Loading... |
| 32 #include "modules/indexeddb/IDBKeyPath.h" | 32 #include "modules/indexeddb/IDBKeyPath.h" |
| 33 #include "public/platform/modules/indexeddb/WebIDBMetadata.h" | 33 #include "public/platform/modules/indexeddb/WebIDBMetadata.h" |
| 34 #include "wtf/Allocator.h" | 34 #include "wtf/Allocator.h" |
| 35 #include "wtf/HashMap.h" | 35 #include "wtf/HashMap.h" |
| 36 #include "wtf/text/StringHash.h" | 36 #include "wtf/text/StringHash.h" |
| 37 #include "wtf/text/WTFString.h" | 37 #include "wtf/text/WTFString.h" |
| 38 | 38 |
| 39 namespace blink { | 39 namespace blink { |
| 40 | 40 |
| 41 struct IDBIndexMetadata { | 41 struct IDBIndexMetadata { |
| 42 ALLOW_ONLY_INLINE_ALLOCATION(); | 42 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 43 IDBIndexMetadata() { } | 43 IDBIndexMetadata() { } |
| 44 IDBIndexMetadata(const String& name, int64_t id, const IDBKeyPath& keyPath,
bool unique, bool multiEntry) | 44 IDBIndexMetadata(const String& name, int64_t id, const IDBKeyPath& keyPath,
bool unique, bool multiEntry) |
| 45 : name(name) | 45 : name(name) |
| 46 , id(id) | 46 , id(id) |
| 47 , keyPath(keyPath) | 47 , keyPath(keyPath) |
| 48 , unique(unique) | 48 , unique(unique) |
| 49 , multiEntry(multiEntry) { } | 49 , multiEntry(multiEntry) { } |
| 50 String name; | 50 String name; |
| 51 int64_t id; | 51 int64_t id; |
| 52 IDBKeyPath keyPath; | 52 IDBKeyPath keyPath; |
| 53 bool unique; | 53 bool unique; |
| 54 bool multiEntry; | 54 bool multiEntry; |
| 55 | 55 |
| 56 static const int64_t InvalidId = -1; | 56 static const int64_t InvalidId = -1; |
| 57 }; | 57 }; |
| 58 | 58 |
| 59 struct IDBObjectStoreMetadata { | 59 struct IDBObjectStoreMetadata { |
| 60 ALLOW_ONLY_INLINE_ALLOCATION(); | 60 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
| 61 IDBObjectStoreMetadata() { } | 61 IDBObjectStoreMetadata() { } |
| 62 IDBObjectStoreMetadata(const String& name, int64_t id, const IDBKeyPath& key
Path, bool autoIncrement, int64_t maxIndexId) | 62 IDBObjectStoreMetadata(const String& name, int64_t id, const IDBKeyPath& key
Path, bool autoIncrement, int64_t maxIndexId) |
| 63 : name(name) | 63 : name(name) |
| 64 , id(id) | 64 , id(id) |
| 65 , keyPath(keyPath) | 65 , keyPath(keyPath) |
| 66 , autoIncrement(autoIncrement) | 66 , autoIncrement(autoIncrement) |
| 67 , maxIndexId(maxIndexId) | 67 , maxIndexId(maxIndexId) |
| 68 { | 68 { |
| 69 } | 69 } |
| 70 String name; | 70 String name; |
| 71 int64_t id; | 71 int64_t id; |
| 72 IDBKeyPath keyPath; | 72 IDBKeyPath keyPath; |
| 73 bool autoIncrement; | 73 bool autoIncrement; |
| 74 int64_t maxIndexId; | 74 int64_t maxIndexId; |
| 75 | 75 |
| 76 static const int64_t InvalidId = -1; | 76 static const int64_t InvalidId = -1; |
| 77 | 77 |
| 78 typedef HashMap<int64_t, IDBIndexMetadata> IndexMap; | 78 typedef HashMap<int64_t, IDBIndexMetadata> IndexMap; |
| 79 IndexMap indexes; | 79 IndexMap indexes; |
| 80 }; | 80 }; |
| 81 | 81 |
| 82 struct IDBDatabaseMetadata { | 82 struct IDBDatabaseMetadata { |
| 83 DISALLOW_ALLOCATION(); | 83 DISALLOW_NEW(); |
| 84 // FIXME: These can probably be collapsed into 0. | 84 // FIXME: These can probably be collapsed into 0. |
| 85 enum { | 85 enum { |
| 86 NoIntVersion = -1, | 86 NoIntVersion = -1, |
| 87 DefaultIntVersion = 0 | 87 DefaultIntVersion = 0 |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 typedef HashMap<int64_t, IDBObjectStoreMetadata> ObjectStoreMap; | 90 typedef HashMap<int64_t, IDBObjectStoreMetadata> ObjectStoreMap; |
| 91 | 91 |
| 92 IDBDatabaseMetadata() | 92 IDBDatabaseMetadata() |
| 93 : intVersion(NoIntVersion) | 93 : intVersion(NoIntVersion) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 110 String version; | 110 String version; |
| 111 int64_t intVersion; | 111 int64_t intVersion; |
| 112 int64_t maxObjectStoreId; | 112 int64_t maxObjectStoreId; |
| 113 | 113 |
| 114 ObjectStoreMap objectStores; | 114 ObjectStoreMap objectStores; |
| 115 }; | 115 }; |
| 116 | 116 |
| 117 } | 117 } |
| 118 | 118 |
| 119 #endif // IDBMetadata_h | 119 #endif // IDBMetadata_h |
| OLD | NEW |