Blink roll 25b6bd3a7a131ffe68d809546ad1a20707915cdc:3a503f41ae42e5b79cfcd2ff10e65afde...
[chromium-blink-merge.git] / content / browser / indexed_db / indexed_db_metadata.h
bloba597616c55f4b799d13af880cef81d626f2f91f5
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_
8 #include <map>
10 #include "base/basictypes.h"
11 #include "base/strings/string16.h"
12 #include "content/common/indexed_db/indexed_db_key_path.h"
14 namespace content {
16 struct IndexedDBIndexMetadata {
17 static const int64 kInvalidId = -1;
19 IndexedDBIndexMetadata() {}
20 IndexedDBIndexMetadata(const base::string16& name,
21 int64 id,
22 const IndexedDBKeyPath& key_path,
23 bool unique,
24 bool multi_entry)
25 : name(name),
26 id(id),
27 key_path(key_path),
28 unique(unique),
29 multi_entry(multi_entry) {}
30 base::string16 name;
31 int64 id;
32 IndexedDBKeyPath key_path;
33 bool unique;
34 bool multi_entry;
37 struct CONTENT_EXPORT IndexedDBObjectStoreMetadata {
38 typedef std::map<int64, IndexedDBIndexMetadata> IndexMap;
40 static const int64 kInvalidId = -1;
42 IndexedDBObjectStoreMetadata();
43 IndexedDBObjectStoreMetadata(const base::string16& name,
44 int64 id,
45 const IndexedDBKeyPath& key_path,
46 bool auto_increment,
47 int64 max_index_id);
48 ~IndexedDBObjectStoreMetadata();
49 base::string16 name;
50 int64 id;
51 IndexedDBKeyPath key_path;
52 bool auto_increment;
53 int64 max_index_id;
55 IndexMap indexes;
58 struct CONTENT_EXPORT IndexedDBDatabaseMetadata {
59 // TODO(jsbell): These can probably be collapsed into 0.
60 enum {
61 NO_INT_VERSION = -1,
62 DEFAULT_INT_VERSION = 0
65 typedef std::map<int64, IndexedDBObjectStoreMetadata> ObjectStoreMap;
67 IndexedDBDatabaseMetadata();
68 IndexedDBDatabaseMetadata(const base::string16& name,
69 int64 id,
70 const base::string16& version,
71 int64 int_version,
72 int64 max_object_store_id);
73 ~IndexedDBDatabaseMetadata();
75 base::string16 name;
76 int64 id;
77 base::string16 version;
78 int64 int_version;
79 int64 max_object_store_id;
81 ObjectStoreMap object_stores;
83 } // namespace content
85 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_