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 CONTENT_EXPORT IndexedDBIndexMetadata
{
17 static const int64 kInvalidId
= -1;
19 IndexedDBIndexMetadata();
20 IndexedDBIndexMetadata(const base::string16
& name
,
22 const IndexedDBKeyPath
& key_path
,
25 IndexedDBIndexMetadata(const IndexedDBIndexMetadata
& other
);
26 ~IndexedDBIndexMetadata();
27 IndexedDBIndexMetadata
& operator=(const IndexedDBIndexMetadata
& other
);
31 IndexedDBKeyPath key_path
;
36 struct CONTENT_EXPORT IndexedDBObjectStoreMetadata
{
37 typedef std::map
<int64
, IndexedDBIndexMetadata
> IndexMap
;
39 static const int64 kInvalidId
= -1;
41 IndexedDBObjectStoreMetadata();
42 IndexedDBObjectStoreMetadata(const base::string16
& name
,
44 const IndexedDBKeyPath
& key_path
,
47 IndexedDBObjectStoreMetadata(const IndexedDBObjectStoreMetadata
& other
);
48 ~IndexedDBObjectStoreMetadata();
49 IndexedDBObjectStoreMetadata
& operator=(
50 const IndexedDBObjectStoreMetadata
& other
);
54 IndexedDBKeyPath key_path
;
61 struct CONTENT_EXPORT IndexedDBDatabaseMetadata
{
62 // TODO(jsbell): These can probably be collapsed into 0.
65 DEFAULT_INT_VERSION
= 0
68 typedef std::map
<int64
, IndexedDBObjectStoreMetadata
> ObjectStoreMap
;
70 IndexedDBDatabaseMetadata();
71 IndexedDBDatabaseMetadata(const base::string16
& name
,
73 const base::string16
& version
,
75 int64 max_object_store_id
);
76 IndexedDBDatabaseMetadata(const IndexedDBDatabaseMetadata
& other
);
77 ~IndexedDBDatabaseMetadata();
78 IndexedDBDatabaseMetadata
& operator=(IndexedDBDatabaseMetadata
& other
);
82 base::string16 version
;
84 int64 max_object_store_id
;
86 ObjectStoreMap object_stores
;
88 } // namespace content
90 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_