| 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 13 matching lines...) Expand all Loading... |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "public/platform/WebIDBMetadata.h" | 27 #include "public/platform/WebIDBMetadata.h" |
| 28 | 28 |
| 29 #include "modules/indexeddb/IDBMetadata.h" | 29 #include "modules/indexeddb/IDBMetadata.h" |
| 30 #include "public/platform/WebIDBKeyPath.h" | 30 #include "public/platform/WebIDBKeyPath.h" |
| 31 #include "public/platform/WebString.h" | 31 #include "public/platform/WebString.h" |
| 32 #include "public/platform/WebVector.h" | 32 #include "public/platform/WebVector.h" |
| 33 | 33 |
| 34 using namespace blink; | |
| 35 | |
| 36 namespace blink { | 34 namespace blink { |
| 37 | 35 |
| 38 WebIDBMetadata::WebIDBMetadata(const blink::IDBDatabaseMetadata& metadata) | 36 WebIDBMetadata::WebIDBMetadata(const IDBDatabaseMetadata& metadata) |
| 39 { | 37 { |
| 40 name = metadata.name; | 38 name = metadata.name; |
| 41 version = metadata.version; | 39 version = metadata.version; |
| 42 intVersion = metadata.intVersion; | 40 intVersion = metadata.intVersion; |
| 43 objectStores = WebVector<ObjectStore>(static_cast<size_t>(metadata.objectSto
res.size())); | 41 objectStores = WebVector<ObjectStore>(static_cast<size_t>(metadata.objectSto
res.size())); |
| 44 maxObjectStoreId = metadata.maxObjectStoreId; | 42 maxObjectStoreId = metadata.maxObjectStoreId; |
| 45 | 43 |
| 46 size_t i = 0; | 44 size_t i = 0; |
| 47 for (IDBDatabaseMetadata::ObjectStoreMap::const_iterator storeIterator = met
adata.objectStores.begin(); storeIterator != metadata.objectStores.end(); ++stor
eIterator) { | 45 for (IDBDatabaseMetadata::ObjectStoreMap::const_iterator storeIterator = met
adata.objectStores.begin(); storeIterator != metadata.objectStores.end(); ++stor
eIterator) { |
| 48 const IDBObjectStoreMetadata& objectStore = storeIterator->value; | 46 const IDBObjectStoreMetadata& objectStore = storeIterator->value; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 const Index webIndex = webObjectStore.indexes[j]; | 78 const Index webIndex = webObjectStore.indexes[j]; |
| 81 IDBIndexMetadata index(webIndex.name, webIndex.id, webIndex.keyPath,
webIndex.unique, webIndex.multiEntry); | 79 IDBIndexMetadata index(webIndex.name, webIndex.id, webIndex.keyPath,
webIndex.unique, webIndex.multiEntry); |
| 82 objectStore.indexes.set(index.id, index); | 80 objectStore.indexes.set(index.id, index); |
| 83 } | 81 } |
| 84 db.objectStores.set(objectStore.id, objectStore); | 82 db.objectStores.set(objectStore.id, objectStore); |
| 85 } | 83 } |
| 86 return db; | 84 return db; |
| 87 } | 85 } |
| 88 | 86 |
| 89 } // namespace blink | 87 } // namespace blink |
| OLD | NEW |