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

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

Issue 10533057: IPC plumbing for IndexedDB to snapshot metadata to the renderer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Don't CamelCase "metadata" Created 8 years, 6 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/common/indexed_db/indexed_db_metadata.h
diff --git a/content/common/indexed_db/indexed_db_metadata.h b/content/common/indexed_db/indexed_db_metadata.h
new file mode 100644
index 0000000000000000000000000000000000000000..04057aa23ad81c4b94d54c6c58459c068be51c70
--- /dev/null
+++ b/content/common/indexed_db/indexed_db_metadata.h
@@ -0,0 +1,100 @@
+// Copyright (c) 2012 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_COMMON_INDEXED_DB_INDEXED_DB_METADATA_H_
+#define CONTENT_COMMON_INDEXED_DB_INDEXED_DB_METADATA_H_
+#pragma once
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/string16.h"
+#include "indexed_db_key_path.h"
+#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBMetadata.h"
+
+namespace content {
+
+class IndexedDBObjectStoreMetadata;
+class IndexedDBIndexMetadata;
+
+class CONTENT_EXPORT IndexedDBDatabaseMetadata {
michaeln 2012/06/08 19:46:51 Do these classes really need the CONTENT_EXPORT?
jsbell 2012/06/08 20:11:57 Nope!
+ public:
+ IndexedDBDatabaseMetadata();
+ explicit IndexedDBDatabaseMetadata(const WebKit::WebIDBDatabaseMetadata);
michaeln 2012/06/08 19:46:51 Do you want this to be a const input arg? Also we
jsbell 2012/06/08 20:11:57 Oops, missing &.
+ ~IndexedDBDatabaseMetadata();
+
+ const string16& name() const { return name_; }
+ const string16& version() const { return version_; }
+ const std::vector<IndexedDBObjectStoreMetadata>& object_stores() const {
+ return object_stores_;
+ }
+
+ void Set(const string16& name,
+ const string16& version,
+ const std::vector<IndexedDBObjectStoreMetadata>& object_stores);
+
+ operator WebKit::WebIDBDatabaseMetadata() const;
+
+ private:
+ string16 name_;
+ string16 version_;
+ std::vector<IndexedDBObjectStoreMetadata> object_stores_;
+};
+
+class CONTENT_EXPORT IndexedDBObjectStoreMetadata {
+ public:
+ IndexedDBObjectStoreMetadata();
+ explicit IndexedDBObjectStoreMetadata(
+ const WebKit::WebIDBObjectStoreMetadata);
+ ~IndexedDBObjectStoreMetadata();
+
+ const string16& name() const { return name_; }
+ const IndexedDBKeyPath& key_path() const { return key_path_; }
+ bool auto_increment() const { return auto_increment_; }
+ const std::vector<IndexedDBIndexMetadata>& indexes() const {
+ return indexes_;
+ }
+
+ void Set(const string16& name,
+ const IndexedDBKeyPath& key_path,
+ bool auto_increment,
+ const std::vector<IndexedDBIndexMetadata>& indexes);
+
+ operator WebKit::WebIDBObjectStoreMetadata() const;
+
+ private:
+ string16 name_;
+ IndexedDBKeyPath key_path_;
+ bool auto_increment_;
+ std::vector<IndexedDBIndexMetadata> indexes_;
+};
+
+class CONTENT_EXPORT IndexedDBIndexMetadata {
+ public:
+ IndexedDBIndexMetadata();
+ explicit IndexedDBIndexMetadata(const WebKit::WebIDBIndexMetadata);
michaeln 2012/06/08 19:46:51 ditto const ref + param name
jsbell 2012/06/08 20:11:57 Done.
+ ~IndexedDBIndexMetadata();
+
+ const string16& name() const { return name_; }
+ const IndexedDBKeyPath& key_path() const { return key_path_; }
+ bool unique() const { return unique_; }
+ bool multi_entry() const { return multi_entry_; }
+
+ void Set(const string16& name,
+ const IndexedDBKeyPath& key_path,
+ bool unique,
+ bool multi_entry);
+
+ operator WebKit::WebIDBIndexMetadata() const;
+
+ private:
+ string16 name_;
+ IndexedDBKeyPath key_path_;
+ bool unique_;
+ bool multi_entry_;
+};
+
+} // namespace content
+
+#endif // CONTENT_COMMON_INDEXED_DB_INDEXED_DB_KEY_H_

Powered by Google App Engine
This is Rietveld 408576698