1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_
10 #include "base/basictypes.h"
11 #include "base/strings/string16.h"
12 #include "content/common/indexed_db/indexed_db_key_path.h"
16 struct IndexedDBIndexMetadata
{
17 IndexedDBIndexMetadata() {}
18 IndexedDBIndexMetadata(const base::string16
& name
,
20 const IndexedDBKeyPath
& key_path
,
27 multi_entry(multi_entry
) {}
30 IndexedDBKeyPath key_path
;
34 static const int64 kInvalidId
= -1;
37 struct CONTENT_EXPORT IndexedDBObjectStoreMetadata
{
38 IndexedDBObjectStoreMetadata();
39 IndexedDBObjectStoreMetadata(const base::string16
& name
,
41 const IndexedDBKeyPath
& key_path
,
44 ~IndexedDBObjectStoreMetadata();
47 IndexedDBKeyPath key_path
;
51 static const int64 kInvalidId
= -1;
53 typedef std::map
<int64
, IndexedDBIndexMetadata
> IndexMap
;
57 struct CONTENT_EXPORT IndexedDBDatabaseMetadata
{
58 // TODO(jsbell): These can probably be collapsed into 0.
61 DEFAULT_INT_VERSION
= 0
64 typedef std::map
<int64
, IndexedDBObjectStoreMetadata
> ObjectStoreMap
;
66 IndexedDBDatabaseMetadata();
67 IndexedDBDatabaseMetadata(const base::string16
& name
,
69 const base::string16
& version
,
71 int64 max_object_store_id
);
72 ~IndexedDBDatabaseMetadata();
76 base::string16 version
;
78 int64 max_object_store_id
;
80 ObjectStoreMap object_stores
;
84 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_