Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Side by Side Diff: content/browser/indexed_db/indexed_db_metadata.h

Issue 15564008: Migrate the IndexedDB backend from Blink to Chromium (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Accessor naming, use LevelDBSlice ctor explicitly Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #ifndef CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_
6 #define CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_
7
8 #include <map>
9
10 #include "base/string16.h"
11 #include "content/common/indexed_db/indexed_db_key_path.h"
12
13 namespace content {
14
15 struct IndexedDBIndexMetadata {
16 IndexedDBIndexMetadata() {}
17 IndexedDBIndexMetadata(const string16& name,
18 int64_t id,
19 const IndexedDBKeyPath& key_path,
20 bool unique,
21 bool multi_entry)
22 : name(name),
23 id(id),
24 key_path(key_path),
25 unique(unique),
26 multi_entry(multi_entry) {}
27 string16 name;
28 int64_t id;
29 IndexedDBKeyPath key_path;
30 bool unique;
31 bool multi_entry;
32
33 static const int64_t InvalidId = -1;
34 };
35
36 struct CONTENT_EXPORT IndexedDBObjectStoreMetadata {
37 IndexedDBObjectStoreMetadata();
38 IndexedDBObjectStoreMetadata(const string16& name,
39 int64_t id,
40 const IndexedDBKeyPath& key_path,
41 bool auto_increment,
42 int64_t max_index_id);
43 ~IndexedDBObjectStoreMetadata();
44 string16 name;
45 int64_t id;
46 IndexedDBKeyPath key_path;
47 bool auto_increment;
48 int64_t max_index_id;
49
50 static const int64_t InvalidId = -1;
51
52 typedef std::map<int64_t, IndexedDBIndexMetadata> IndexMap;
53 IndexMap indexes;
54
55 };
56
57 struct CONTENT_EXPORT IndexedDBDatabaseMetadata {
58 // TODO: These can probably be collapsed into 0.
59 enum {
60 NoIntVersion = -1,
61 DefaultIntVersion = 0
62 };
63
64 typedef std::map<int64_t, IndexedDBObjectStoreMetadata> ObjectStoreMap;
65
66 IndexedDBDatabaseMetadata();
67 IndexedDBDatabaseMetadata(const string16& name,
68 int64_t id,
69 const string16& version,
70 int64_t int_version,
71 int64_t max_object_store_id);
72 ~IndexedDBDatabaseMetadata();
73
74 string16 name;
75 int64_t id;
76 string16 version;
77 int64_t int_version;
78 int64_t max_object_store_id;
79
80 ObjectStoreMap object_stores;
81 };
82
83 }
84
85 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698