1 // Copyright 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_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_
6 #define CONTENT_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_
8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h"
10 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBCursor.h"
11 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBDatabase.h"
12 #include "third_party/WebKit/public/platform/modules/indexeddb/WebIDBTypes.h"
16 class WebIDBCallbacks
;
17 class WebIDBDatabaseCallbacks
;
22 class ThreadSafeSender
;
24 class WebIDBDatabaseImpl
: public blink::WebIDBDatabase
{
26 WebIDBDatabaseImpl(int32 ipc_database_id
,
27 int32 ipc_database_callbacks_id
,
28 ThreadSafeSender
* thread_safe_sender
);
29 virtual ~WebIDBDatabaseImpl();
31 // blink::WebIDBDatabase
32 virtual void createObjectStore(long long transaction_id
,
33 long long objectstore_id
,
34 const blink::WebString
& name
,
35 const blink::WebIDBKeyPath
& key_path
,
37 virtual void deleteObjectStore(long long transaction_id
,
38 long long object_store_id
);
39 virtual void createTransaction(long long transaction_id
,
40 blink::WebIDBDatabaseCallbacks
* callbacks
,
41 const blink::WebVector
<long long>& scope
,
42 blink::WebIDBTransactionMode mode
);
45 virtual void versionChangeIgnored();
47 virtual void get(long long transactionId
,
48 long long objectStoreId
,
50 const blink::WebIDBKeyRange
&,
52 blink::WebIDBCallbacks
*);
53 virtual void getAll(long long transactionId
,
54 long long objectStoreId
,
56 const blink::WebIDBKeyRange
&,
59 blink::WebIDBCallbacks
*);
60 virtual void put(long long transactionId
,
61 long long objectStoreId
,
62 const blink::WebData
& value
,
63 const blink::WebVector
<blink::WebBlobInfo
>& webBlobInfo
,
64 const blink::WebIDBKey
&,
66 blink::WebIDBCallbacks
*,
67 const blink::WebVector
<long long>& indexIds
,
68 const blink::WebVector
<WebIndexKeys
>&);
69 virtual void setIndexKeys(long long transactionId
,
70 long long objectStoreId
,
71 const blink::WebIDBKey
&,
72 const blink::WebVector
<long long>& indexIds
,
73 const blink::WebVector
<WebIndexKeys
>&);
74 virtual void setIndexesReady(long long transactionId
,
75 long long objectStoreId
,
76 const blink::WebVector
<long long>& indexIds
);
77 virtual void openCursor(long long transactionId
,
78 long long objectStoreId
,
80 const blink::WebIDBKeyRange
&,
81 blink::WebIDBCursorDirection direction
,
83 blink::WebIDBTaskType
,
84 blink::WebIDBCallbacks
*);
85 virtual void count(long long transactionId
,
86 long long objectStoreId
,
88 const blink::WebIDBKeyRange
&,
89 blink::WebIDBCallbacks
*);
90 virtual void deleteRange(long long transactionId
,
91 long long objectStoreId
,
92 const blink::WebIDBKeyRange
&,
93 blink::WebIDBCallbacks
*);
94 virtual void clear(long long transactionId
,
95 long long objectStoreId
,
96 blink::WebIDBCallbacks
*);
97 virtual void createIndex(long long transactionId
,
98 long long objectStoreId
,
100 const blink::WebString
& name
,
101 const blink::WebIDBKeyPath
&,
104 virtual void deleteIndex(long long transactionId
,
105 long long objectStoreId
,
107 virtual void abort(long long transaction_id
);
108 virtual void commit(long long transaction_id
);
109 virtual void ackReceivedBlobs(
110 const blink::WebVector
<blink::WebString
>& uuids
);
113 int32 ipc_database_id_
;
114 int32 ipc_database_callbacks_id_
;
115 scoped_refptr
<ThreadSafeSender
> thread_safe_sender_
;
118 } // namespace content
120 #endif // CONTENT_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_