Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Side by Side Diff: third_party/WebKit/Source/modules/indexeddb/IDBMetadata.cpp

Issue 1963293002: Replacing Indexed DB Chromium IPC with Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactoring after Passing URLRequestContextGetter. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
8
9 namespace blink { 7 namespace blink {
10 8
11 IDBDatabaseMetadata::IDBDatabaseMetadata(const WebIDBMetadata& webMetadata) 9 IDBDatabaseMetadata::IDBDatabaseMetadata(indexed_db::mojom::blink::DatabaseMetad ataPtr databaseMetadata)
12 : name(webMetadata.name) 10 : name(databaseMetadata->name)
13 , id(webMetadata.id) 11 , id(databaseMetadata->id)
14 , version(webMetadata.version) 12 , version(databaseMetadata->version)
15 , maxObjectStoreId(webMetadata.maxObjectStoreId) 13 , maxObjectStoreId(databaseMetadata->max_object_store_id)
16 { 14 {
17 for (size_t i = 0; i < webMetadata.objectStores.size(); ++i) { 15 for (const auto& store : databaseMetadata->object_stores.values()) {
18 const WebIDBMetadata::ObjectStore webObjectStore = webMetadata.objectSto res[i]; 16 IDBObjectStoreMetadata objectStore(store->name, store->id, IDBKeyPath(st ore->key_path), store->auto_increment, store->max_index_id);
19 IDBObjectStoreMetadata objectStore(webObjectStore.name, webObjectStore.i d, IDBKeyPath(webObjectStore.keyPath), webObjectStore.autoIncrement, webObjectSt ore.maxIndexId); 17 for (const auto& storeMetadata : store->indexes.values()) {
20 18 IDBIndexMetadata index(storeMetadata->name, storeMetadata->id, IDBKe yPath(storeMetadata->key_path), storeMetadata->unique, storeMetadata->multi_entr y);
21 for (size_t j = 0; j < webObjectStore.indexes.size(); ++j) {
22 const WebIDBMetadata::Index webIndex = webObjectStore.indexes[j];
23 IDBIndexMetadata index(webIndex.name, webIndex.id, IDBKeyPath(webInd ex.keyPath), webIndex.unique, webIndex.multiEntry);
24 objectStore.indexes.set(index.id, index); 19 objectStore.indexes.set(index.id, index);
25 } 20 }
26 objectStores.set(objectStore.id, objectStore);
27 } 21 }
28 } 22 }
29 23
30 } // namespace blink 24 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/indexeddb/IDBMetadata.h ('k') | third_party/WebKit/Source/modules/indexeddb/IDBMojoUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698