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

Side by Side Diff: public/platform/WebIDBDatabase.h

Issue 325683002: [IndexedDB] Use consistent enums on both sides of IPC. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Incorporated review comments as build bot was failing with previous patch. Created 6 years, 6 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
« no previous file with comments | « public/platform/WebIDBCursor.h ('k') | public/platform/WebIDBTypes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 12 matching lines...) Expand all
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef WebIDBDatabase_h 26 #ifndef WebIDBDatabase_h
27 #define WebIDBDatabase_h 27 #define WebIDBDatabase_h
28 28
29 #include "WebBlobInfo.h" 29 #include "WebBlobInfo.h"
30 #include "WebCommon.h" 30 #include "WebCommon.h"
31 #include "WebIDBCursor.h" 31 #include "WebIDBCursor.h"
32 #include "WebIDBMetadata.h" 32 #include "WebIDBMetadata.h"
33 #include "public/platform/WebIDBTypes.h"
33 34
34 namespace blink { 35 namespace blink {
35 36
36 class WebData; 37 class WebData;
37 class WebIDBCallbacks; 38 class WebIDBCallbacks;
38 class WebIDBDatabaseCallbacks; 39 class WebIDBDatabaseCallbacks;
39 class WebIDBDatabaseError; 40 class WebIDBDatabaseError;
40 class WebIDBKey; 41 class WebIDBKey;
41 class WebIDBKeyPath; 42 class WebIDBKeyPath;
42 class WebIDBKeyRange; 43 class WebIDBKeyRange;
43 44
44 // See comment in WebIDBFactory for a high level overview of these classes. 45 // See comment in WebIDBFactory for a high level overview of these classes.
45 class WebIDBDatabase { 46 class WebIDBDatabase {
46 public: 47 public:
47 virtual ~WebIDBDatabase() { } 48 virtual ~WebIDBDatabase() { }
48 49
49 enum TransactionMode { 50 // FIXME: Remove once Chromium is updated to use the new enums.
50 TransactionReadOnly = 0, 51 typedef WebIDBTransactionMode TransactionMode;
51 TransactionReadWrite, 52 static const WebIDBTransactionMode TransactionReadOnly = WebIDBTransactionMo deReadOnly;
52 TransactionVersionChange, 53 static const WebIDBTransactionMode TransactionReadWrite = WebIDBTransactionM odeReadWrite;
53 }; 54 static const WebIDBTransactionMode TransactionVersionChange = WebIDBTransact ionModeVersionChange;
54 55
55 virtual void createObjectStore(long long transactionId, long long objectStor eId, const WebString& name, const WebIDBKeyPath&, bool autoIncrement) { BLINK_AS SERT_NOT_REACHED(); } 56 virtual void createObjectStore(long long transactionId, long long objectStor eId, const WebString& name, const WebIDBKeyPath&, bool autoIncrement) { BLINK_AS SERT_NOT_REACHED(); }
56 virtual void deleteObjectStore(long long transactionId, long long objectStor eId) { BLINK_ASSERT_NOT_REACHED(); } 57 virtual void deleteObjectStore(long long transactionId, long long objectStor eId) { BLINK_ASSERT_NOT_REACHED(); }
57 virtual void createTransaction(long long id, WebIDBDatabaseCallbacks*, const WebVector<long long>& scope, TransactionMode) { BLINK_ASSERT_NOT_REACHED(); } 58 virtual void createTransaction(long long id, WebIDBDatabaseCallbacks*, const WebVector<long long>& scope, blink::WebIDBTransactionMode) { BLINK_ASSERT_NOT_R EACHED(); }
58 virtual void close() { BLINK_ASSERT_NOT_REACHED(); } 59 virtual void close() { BLINK_ASSERT_NOT_REACHED(); }
59 virtual void forceClose() { BLINK_ASSERT_NOT_REACHED(); } 60 virtual void forceClose() { BLINK_ASSERT_NOT_REACHED(); }
60 61
61 virtual void abort(long long transactionId) { BLINK_ASSERT_NOT_REACHED(); } 62 virtual void abort(long long transactionId) { BLINK_ASSERT_NOT_REACHED(); }
62 virtual void commit(long long transactionId) { BLINK_ASSERT_NOT_REACHED(); } 63 virtual void commit(long long transactionId) { BLINK_ASSERT_NOT_REACHED(); }
63 64
64 virtual void createIndex(long long transactionId, long long objectStoreId, l ong long indexId, const WebString& name, const WebIDBKeyPath&, bool unique, bool multiEntry) { BLINK_ASSERT_NOT_REACHED(); } 65 virtual void createIndex(long long transactionId, long long objectStoreId, l ong long indexId, const WebString& name, const WebIDBKeyPath&, bool unique, bool multiEntry) { BLINK_ASSERT_NOT_REACHED(); }
65 virtual void deleteIndex(long long transactionId, long long objectStoreId, l ong long indexId) { BLINK_ASSERT_NOT_REACHED(); } 66 virtual void deleteIndex(long long transactionId, long long objectStoreId, l ong long indexId) { BLINK_ASSERT_NOT_REACHED(); }
66 67
67 enum TaskType { 68 // FIXME: Remove once Chromium is updated to use the new enums.
68 NormalTask = 0, 69 typedef WebIDBTaskType TaskType;
69 PreemptiveTask, 70 static const WebIDBTaskType NormalTask = WebIDBTaskTypeNormal;
70 TaskTypeLast = PreemptiveTask 71 static const WebIDBTaskType PreemptiveTask = WebIDBTaskTypePreemptive;
71 }; 72 static const WebIDBTaskType TaskTypeLast = WebIDBTaskTypeLast;
72 73
73 enum PutMode { 74 // FIXME: Remove once Chromium is updated to use the new enums.
74 AddOrUpdate, 75 typedef WebIDBPutMode PutMode;
75 AddOnly, 76 static const WebIDBPutMode AddOrUpdate = WebIDBPutModeAddOrUpdate;
76 CursorUpdate, 77 static const WebIDBPutMode AddOnly = WebIDBPutModeAddOnly;
77 PutModeLast = CursorUpdate 78 static const WebIDBPutMode CursorUpdate = WebIDBPutModeCursorUpdate;
78 }; 79 static const WebIDBPutMode PutModeLast = WebIDBPutModeLast;
79 80
80 static const long long minimumIndexId = 30; 81 static const long long minimumIndexId = 30;
81 82
82 typedef WebVector<WebIDBKey> WebIndexKeys; 83 typedef WebVector<WebIDBKey> WebIndexKeys;
83 84
84 virtual void get(long long transactionId, long long objectStoreId, long long indexId, const WebIDBKeyRange&, bool keyOnly, WebIDBCallbacks*) { BLINK_ASSERT_ NOT_REACHED(); } 85 virtual void get(long long transactionId, long long objectStoreId, long long indexId, const WebIDBKeyRange&, bool keyOnly, WebIDBCallbacks*) { BLINK_ASSERT_ NOT_REACHED(); }
85 virtual void put(long long transactionId, long long objectStoreId, const Web Data& value, const WebVector<WebBlobInfo>&, const WebIDBKey&, PutMode, WebIDBCal lbacks*, const WebVector<long long>& indexIds, const WebVector<WebIndexKeys>&) { BLINK_ASSERT_NOT_REACHED(); } 86 virtual void put(long long transactionId, long long objectStoreId, const Web Data& value, const WebVector<WebBlobInfo>&, const WebIDBKey&, blink::WebIDBPutMo de, WebIDBCallbacks*, const WebVector<long long>& indexIds, const WebVector<WebI ndexKeys>&) { BLINK_ASSERT_NOT_REACHED(); }
86 virtual void setIndexKeys(long long transactionId, long long objectStoreId, const WebIDBKey&, const WebVector<long long>& indexIds, const WebVector<WebIndex Keys>&) { BLINK_ASSERT_NOT_REACHED(); } 87 virtual void setIndexKeys(long long transactionId, long long objectStoreId, const WebIDBKey&, const WebVector<long long>& indexIds, const WebVector<WebIndex Keys>&) { BLINK_ASSERT_NOT_REACHED(); }
87 virtual void setIndexesReady(long long transactionId, long long objectStoreI d, const WebVector<long long>& indexIds) { BLINK_ASSERT_NOT_REACHED(); } 88 virtual void setIndexesReady(long long transactionId, long long objectStoreI d, const WebVector<long long>& indexIds) { BLINK_ASSERT_NOT_REACHED(); }
88 virtual void openCursor(long long transactionId, long long objectStoreId, lo ng long indexId, const WebIDBKeyRange&, WebIDBCursor::Direction, bool keyOnly, T askType, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } 89 virtual void openCursor(long long transactionId, long long objectStoreId, lo ng long indexId, const WebIDBKeyRange&, blink::WebIDBCursorDirection, bool keyOn ly, blink::WebIDBTaskType, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); }
89 virtual void count(long long transactionId, long long objectStoreId, long lo ng indexId, const WebIDBKeyRange&, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED( ); } 90 virtual void count(long long transactionId, long long objectStoreId, long lo ng indexId, const WebIDBKeyRange&, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED( ); }
90 virtual void deleteRange(long long transactionId, long long objectStoreId, c onst WebIDBKeyRange&, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); } 91 virtual void deleteRange(long long transactionId, long long objectStoreId, c onst WebIDBKeyRange&, WebIDBCallbacks*) { BLINK_ASSERT_NOT_REACHED(); }
91 virtual void clear(long long transactionId, long long objectStoreId, WebIDBC allbacks*) { BLINK_ASSERT_NOT_REACHED(); } 92 virtual void clear(long long transactionId, long long objectStoreId, WebIDBC allbacks*) { BLINK_ASSERT_NOT_REACHED(); }
92 virtual void ackReceivedBlobs(const WebVector<WebString>& uuids) { BLINK_ASS ERT_NOT_REACHED(); } 93 virtual void ackReceivedBlobs(const WebVector<WebString>& uuids) { BLINK_ASS ERT_NOT_REACHED(); }
93 94
94 protected: 95 protected:
95 WebIDBDatabase() { } 96 WebIDBDatabase() { }
96 }; 97 };
97 98
98 } // namespace blink 99 } // namespace blink
99 100
100 #endif // WebIDBDatabase_h 101 #endif // WebIDBDatabase_h
OLDNEW
« no previous file with comments | « public/platform/WebIDBCursor.h ('k') | public/platform/WebIDBTypes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698