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/WebIDBCursor.h"
11 #include "third_party/WebKit/public/platform/WebIDBDatabase.h"
12 #include "third_party/WebKit/public/platform/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 put(long long transactionId
,
54 long long objectStoreId
,
55 const blink::WebData
& value
,
56 const blink::WebVector
<blink::WebBlobInfo
>& webBlobInfo
,
57 const blink::WebIDBKey
&,
59 blink::WebIDBCallbacks
*,
60 const blink::WebVector
<long long>& indexIds
,
61 const blink::WebVector
<WebIndexKeys
>&);
62 virtual void setIndexKeys(long long transactionId
,
63 long long objectStoreId
,
64 const blink::WebIDBKey
&,
65 const blink::WebVector
<long long>& indexIds
,
66 const blink::WebVector
<WebIndexKeys
>&);
67 virtual void setIndexesReady(long long transactionId
,
68 long long objectStoreId
,
69 const blink::WebVector
<long long>& indexIds
);
70 virtual void openCursor(long long transactionId
,
71 long long objectStoreId
,
73 const blink::WebIDBKeyRange
&,
74 blink::WebIDBCursorDirection direction
,
76 blink::WebIDBTaskType
,
77 blink::WebIDBCallbacks
*);
78 virtual void count(long long transactionId
,
79 long long objectStoreId
,
81 const blink::WebIDBKeyRange
&,
82 blink::WebIDBCallbacks
*);
83 virtual void deleteRange(long long transactionId
,
84 long long objectStoreId
,
85 const blink::WebIDBKeyRange
&,
86 blink::WebIDBCallbacks
*);
87 virtual void clear(long long transactionId
,
88 long long objectStoreId
,
89 blink::WebIDBCallbacks
*);
90 virtual void createIndex(long long transactionId
,
91 long long objectStoreId
,
93 const blink::WebString
& name
,
94 const blink::WebIDBKeyPath
&,
97 virtual void deleteIndex(long long transactionId
,
98 long long objectStoreId
,
100 virtual void abort(long long transaction_id
);
101 virtual void commit(long long transaction_id
);
102 virtual void ackReceivedBlobs(
103 const blink::WebVector
<blink::WebString
>& uuids
);
106 int32 ipc_database_id_
;
107 int32 ipc_database_callbacks_id_
;
108 scoped_refptr
<ThreadSafeSender
> thread_safe_sender_
;
111 } // namespace content
113 #endif // CONTENT_CHILD_INDEXED_DB_WEBIDBDATABASE_IMPL_H_