OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "modules/indexeddb/IDBMetadata.h" | 5 #include "modules/indexeddb/IDBMetadata.h" |
6 | 6 |
7 #include "public/platform/modules/indexeddb/WebIDBMetadata.h" | 7 #include "public/platform/modules/indexeddb/WebIDBMetadata.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
11 IDBDatabaseMetadata::IDBDatabaseMetadata(const WebIDBMetadata& webMetadata) | 11 IDBDatabaseMetadata::IDBDatabaseMetadata(const WebIDBMetadata& webMetadata) |
12 : name(webMetadata.name) | 12 : name(webMetadata.name) |
13 , id(webMetadata.id) | 13 , id(webMetadata.id) |
14 , intVersion(webMetadata.intVersion) | 14 , version(webMetadata.version) |
15 , maxObjectStoreId(webMetadata.maxObjectStoreId) | 15 , maxObjectStoreId(webMetadata.maxObjectStoreId) |
16 { | 16 { |
17 for (size_t i = 0; i < webMetadata.objectStores.size(); ++i) { | 17 for (size_t i = 0; i < webMetadata.objectStores.size(); ++i) { |
18 const WebIDBMetadata::ObjectStore webObjectStore = webMetadata.objectSto
res[i]; | 18 const WebIDBMetadata::ObjectStore webObjectStore = webMetadata.objectSto
res[i]; |
19 IDBObjectStoreMetadata objectStore(webObjectStore.name, webObjectStore.i
d, IDBKeyPath(webObjectStore.keyPath), webObjectStore.autoIncrement, webObjectSt
ore.maxIndexId); | 19 IDBObjectStoreMetadata objectStore(webObjectStore.name, webObjectStore.i
d, IDBKeyPath(webObjectStore.keyPath), webObjectStore.autoIncrement, webObjectSt
ore.maxIndexId); |
20 | 20 |
21 for (size_t j = 0; j < webObjectStore.indexes.size(); ++j) { | 21 for (size_t j = 0; j < webObjectStore.indexes.size(); ++j) { |
22 const WebIDBMetadata::Index webIndex = webObjectStore.indexes[j]; | 22 const WebIDBMetadata::Index webIndex = webObjectStore.indexes[j]; |
23 IDBIndexMetadata index(webIndex.name, webIndex.id, IDBKeyPath(webInd
ex.keyPath), webIndex.unique, webIndex.multiEntry); | 23 IDBIndexMetadata index(webIndex.name, webIndex.id, IDBKeyPath(webInd
ex.keyPath), webIndex.unique, webIndex.multiEntry); |
24 objectStore.indexes.set(index.id, index); | 24 objectStore.indexes.set(index.id, index); |
25 } | 25 } |
26 objectStores.set(objectStore.id, objectStore); | 26 objectStores.set(objectStore.id, objectStore); |
27 } | 27 } |
28 } | 28 } |
29 | 29 |
30 } // namespace blink | 30 } // namespace blink |
OLD | NEW |