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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/indexeddb/IDBMetadata.cpp
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBMetadata.cpp b/third_party/WebKit/Source/modules/indexeddb/IDBMetadata.cpp
index e2b28eae4389b401287565c39ae6c90b2904903c..499e1ca960d23cf0170e57e94067ea8857ceab4d 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBMetadata.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBMetadata.cpp
@@ -4,26 +4,20 @@
#include "modules/indexeddb/IDBMetadata.h"
-#include "public/platform/modules/indexeddb/WebIDBMetadata.h"
-
namespace blink {
-IDBDatabaseMetadata::IDBDatabaseMetadata(const WebIDBMetadata& webMetadata)
- : name(webMetadata.name)
- , id(webMetadata.id)
- , version(webMetadata.version)
- , maxObjectStoreId(webMetadata.maxObjectStoreId)
+IDBDatabaseMetadata::IDBDatabaseMetadata(indexed_db::mojom::blink::DatabaseMetadataPtr databaseMetadata)
+ : name(databaseMetadata->name)
+ , id(databaseMetadata->id)
+ , version(databaseMetadata->version)
+ , maxObjectStoreId(databaseMetadata->max_object_store_id)
{
- for (size_t i = 0; i < webMetadata.objectStores.size(); ++i) {
- const WebIDBMetadata::ObjectStore webObjectStore = webMetadata.objectStores[i];
- IDBObjectStoreMetadata objectStore(webObjectStore.name, webObjectStore.id, IDBKeyPath(webObjectStore.keyPath), webObjectStore.autoIncrement, webObjectStore.maxIndexId);
-
- for (size_t j = 0; j < webObjectStore.indexes.size(); ++j) {
- const WebIDBMetadata::Index webIndex = webObjectStore.indexes[j];
- IDBIndexMetadata index(webIndex.name, webIndex.id, IDBKeyPath(webIndex.keyPath), webIndex.unique, webIndex.multiEntry);
+ for (const auto& store : databaseMetadata->object_stores.values()) {
+ IDBObjectStoreMetadata objectStore(store->name, store->id, IDBKeyPath(store->key_path), store->auto_increment, store->max_index_id);
+ for (const auto& storeMetadata : store->indexes.values()) {
+ IDBIndexMetadata index(storeMetadata->name, storeMetadata->id, IDBKeyPath(storeMetadata->key_path), storeMetadata->unique, storeMetadata->multi_entry);
objectStore.indexes.set(index.id, index);
}
- objectStores.set(objectStore.id, objectStore);
}
}
« 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