| 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 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 | 40 |
| 41 RefPtr<IDBObjectStoreMetadata> IDBObjectStoreMetadata::createCopy() const { | 41 RefPtr<IDBObjectStoreMetadata> IDBObjectStoreMetadata::createCopy() const { |
| 42 RefPtr<IDBObjectStoreMetadata> copy = adoptRef( | 42 RefPtr<IDBObjectStoreMetadata> copy = adoptRef( |
| 43 new IDBObjectStoreMetadata(name, id, keyPath, autoIncrement, maxIndexId)); | 43 new IDBObjectStoreMetadata(name, id, keyPath, autoIncrement, maxIndexId)); |
| 44 | 44 |
| 45 for (const auto& it : indexes) { | 45 for (const auto& it : indexes) { |
| 46 IDBIndexMetadata* index = it.value.get(); | 46 IDBIndexMetadata* index = it.value.get(); |
| 47 RefPtr<IDBIndexMetadata> indexCopy = | 47 RefPtr<IDBIndexMetadata> indexCopy = |
| 48 adoptRef(new IDBIndexMetadata(index->name, index->id, index->keyPath, | 48 adoptRef(new IDBIndexMetadata(index->name, index->id, index->keyPath, |
| 49 index->unique, index->multiEntry)); | 49 index->unique, index->multiEntry)); |
| 50 copy->indexes.add(it.key, std::move(indexCopy)); | 50 copy->indexes.insert(it.key, std::move(indexCopy)); |
| 51 } | 51 } |
| 52 return copy; | 52 return copy; |
| 53 } | 53 } |
| 54 | 54 |
| 55 IDBDatabaseMetadata::IDBDatabaseMetadata() | 55 IDBDatabaseMetadata::IDBDatabaseMetadata() |
| 56 : version(IDBDatabaseMetadata::NoVersion) {} | 56 : version(IDBDatabaseMetadata::NoVersion) {} |
| 57 | 57 |
| 58 IDBDatabaseMetadata::IDBDatabaseMetadata(const String& name, | 58 IDBDatabaseMetadata::IDBDatabaseMetadata(const String& name, |
| 59 int64_t id, | 59 int64_t id, |
| 60 int64_t version, | 60 int64_t version, |
| (...skipping 29 matching lines...) Expand all Loading... |
| 90 } | 90 } |
| 91 | 91 |
| 92 void IDBDatabaseMetadata::copyFrom(const IDBDatabaseMetadata& metadata) { | 92 void IDBDatabaseMetadata::copyFrom(const IDBDatabaseMetadata& metadata) { |
| 93 name = metadata.name; | 93 name = metadata.name; |
| 94 id = metadata.id; | 94 id = metadata.id; |
| 95 version = metadata.version; | 95 version = metadata.version; |
| 96 maxObjectStoreId = metadata.maxObjectStoreId; | 96 maxObjectStoreId = metadata.maxObjectStoreId; |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |