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