Roll src/third_party/WebKit 9301d6f:4619053 (svn 201058:201059)
[chromium-blink-merge.git] / content / child / indexed_db / webidbdatabase_impl.h
blob0d9d7abeb880c7bd939a17032d380bc82a857e03
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"
14 namespace blink {
15 class WebBlobInfo;
16 class WebIDBCallbacks;
17 class WebIDBDatabaseCallbacks;
18 class WebString;
21 namespace content {
22 class ThreadSafeSender;
24 class WebIDBDatabaseImpl : public blink::WebIDBDatabase {
25 public:
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,
36 bool auto_increment);
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);
44 virtual void close();
45 virtual void versionChangeIgnored();
47 virtual void get(long long transactionId,
48 long long objectStoreId,
49 long long indexId,
50 const blink::WebIDBKeyRange&,
51 bool keyOnly,
52 blink::WebIDBCallbacks*);
53 virtual void getAll(long long transactionId,
54 long long objectStoreId,
55 long long indexId,
56 const blink::WebIDBKeyRange&,
57 long long maxCount,
58 bool keyOnly,
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&,
65 blink::WebIDBPutMode,
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,
79 long long indexId,
80 const blink::WebIDBKeyRange&,
81 blink::WebIDBCursorDirection direction,
82 bool keyOnly,
83 blink::WebIDBTaskType,
84 blink::WebIDBCallbacks*);
85 virtual void count(long long transactionId,
86 long long objectStoreId,
87 long long indexId,
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,
99 long long indexId,
100 const blink::WebString& name,
101 const blink::WebIDBKeyPath&,
102 bool unique,
103 bool multiEntry);
104 virtual void deleteIndex(long long transactionId,
105 long long objectStoreId,
106 long long indexId);
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);
112 private:
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_