Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / content / browser / indexed_db / indexed_db_metadata.h
blobe294868f9f1f6cc067178fa7846e5640bba7a26c
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 CONTENT_EXPORT 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 IndexedDBIndexMetadata(const IndexedDBIndexMetadata& other);
26 ~IndexedDBIndexMetadata();
27 IndexedDBIndexMetadata& operator=(const IndexedDBIndexMetadata& other);
29 base::string16 name;
30 int64 id;
31 IndexedDBKeyPath key_path;
32 bool unique;
33 bool multi_entry;
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,
43 int64 id,
44 const IndexedDBKeyPath& key_path,
45 bool auto_increment,
46 int64 max_index_id);
47 IndexedDBObjectStoreMetadata(const IndexedDBObjectStoreMetadata& other);
48 ~IndexedDBObjectStoreMetadata();
49 IndexedDBObjectStoreMetadata& operator=(
50 const IndexedDBObjectStoreMetadata& other);
52 base::string16 name;
53 int64 id;
54 IndexedDBKeyPath key_path;
55 bool auto_increment;
56 int64 max_index_id;
58 IndexMap indexes;
61 struct CONTENT_EXPORT IndexedDBDatabaseMetadata {
62 // TODO(jsbell): These can probably be collapsed into 0.
63 enum {
64 NO_INT_VERSION = -1,
65 DEFAULT_INT_VERSION = 0
68 typedef std::map<int64, IndexedDBObjectStoreMetadata> ObjectStoreMap;
70 IndexedDBDatabaseMetadata();
71 IndexedDBDatabaseMetadata(const base::string16& name,
72 int64 id,
73 const base::string16& version,
74 int64 int_version,
75 int64 max_object_store_id);
76 IndexedDBDatabaseMetadata(const IndexedDBDatabaseMetadata& other);
77 ~IndexedDBDatabaseMetadata();
78 IndexedDBDatabaseMetadata& operator=(IndexedDBDatabaseMetadata& other);
80 base::string16 name;
81 int64 id;
82 base::string16 version;
83 int64 int_version;
84 int64 max_object_store_id;
86 ObjectStoreMap object_stores;
88 } // namespace content
90 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_