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

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: Coding style fixes 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 kInvalidId = -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 kInvalidId = -1;
51
52 typedef std::map<int64_t, IndexedDBIndexMetadata> IndexMap;
53 IndexMap indexes;
54 };
55
56 struct CONTENT_EXPORT IndexedDBDatabaseMetadata {
57 // TODO(jsbell): These can probably be collapsed into 0.
58 enum {
59 NO_INT_VERSION = -1,
60 DEFAULT_INT_VERSION = 0
61 };
62
63 typedef std::map<int64_t, IndexedDBObjectStoreMetadata> ObjectStoreMap;
64
65 IndexedDBDatabaseMetadata();
66 IndexedDBDatabaseMetadata(const string16& name,
67 int64_t id,
68 const string16& version,
69 int64_t int_version,
70 int64_t max_object_store_id);
71 ~IndexedDBDatabaseMetadata();
72
73 string16 name;
74 int64_t id;
75 string16 version;
76 int64_t int_version;
77 int64_t max_object_store_id;
78
79 ObjectStoreMap object_stores;
80 };
81 }
82
83 #endif // CONTENT_BROWSER_INDEXED_DB_INDEXED_DB_METADATA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698