Chromium Code Reviews| 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_ |