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

Unified Diff: content/browser/indexed_db/indexed_db_metadata.h

Issue 15564008: Migrate the IndexedDB backend from Blink to Chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Accessor naming, use LevelDBSlice ctor explicitly Created 7 years, 7 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: content/browser/indexed_db/indexed_db_metadata.h
diff --git a/content/browser/indexed_db/indexed_db_metadata.h b/content/browser/indexed_db/indexed_db_metadata.h
new file mode 100644
index 0000000000000000000000000000000000000000..e45a039990ece311c5dc2be550c6dadebedc0a4e
--- /dev/null
+++ b/content/browser/indexed_db/indexed_db_metadata.h
@@ -0,0 +1,85 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_
+#define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_
+
+#include <map>
+
+#include "base/string16.h"
+#include "content/common/indexed_db/indexed_db_key_path.h"
+
+namespace content {
+
+struct IndexedDBIndexMetadata {
+ IndexedDBIndexMetadata() {}
+ IndexedDBIndexMetadata(const string16& name,
+ int64_t id,
+ const IndexedDBKeyPath& key_path,
+ bool unique,
+ bool multi_entry)
+ : name(name),
+ id(id),
+ key_path(key_path),
+ unique(unique),
+ multi_entry(multi_entry) {}
+ string16 name;
+ int64_t id;
+ IndexedDBKeyPath key_path;
+ bool unique;
+ bool multi_entry;
+
+ static const int64_t InvalidId = -1;
+};
+
+struct CONTENT_EXPORT IndexedDBObjectStoreMetadata {
+ IndexedDBObjectStoreMetadata();
+ IndexedDBObjectStoreMetadata(const string16& name,
+ int64_t id,
+ const IndexedDBKeyPath& key_path,
+ bool auto_increment,
+ int64_t max_index_id);
+ ~IndexedDBObjectStoreMetadata();
+ string16 name;
+ int64_t id;
+ IndexedDBKeyPath key_path;
+ bool auto_increment;
+ int64_t max_index_id;
+
+ static const int64_t InvalidId = -1;
+
+ typedef std::map<int64_t, IndexedDBIndexMetadata> IndexMap;
+ IndexMap indexes;
+
+};
+
+struct CONTENT_EXPORT IndexedDBDatabaseMetadata {
+ // TODO: These can probably be collapsed into 0.
+ enum {
+ NoIntVersion = -1,
+ DefaultIntVersion = 0
+ };
+
+ typedef std::map<int64_t, IndexedDBObjectStoreMetadata> ObjectStoreMap;
+
+ IndexedDBDatabaseMetadata();
+ IndexedDBDatabaseMetadata(const string16& name,
+ int64_t id,
+ const string16& version,
+ int64_t int_version,
+ int64_t max_object_store_id);
+ ~IndexedDBDatabaseMetadata();
+
+ string16 name;
+ int64_t id;
+ string16 version;
+ int64_t int_version;
+ int64_t max_object_store_id;
+
+ ObjectStoreMap object_stores;
+};
+
+}
+
+#endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_

Powered by Google App Engine
This is Rietveld 408576698