summaryrefslogtreecommitdiffstats
path: root/content/common/indexed_db/proxy_webidbdatabase_impl.h
blob: 61bebe1566f5aec70d0695dcf830f14fcfd06c6f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_COMMON_INDEXED_DB_PROXY_WEBIDBDATABASE_IMPL_H_
#define CONTENT_COMMON_INDEXED_DB_PROXY_WEBIDBDATABASE_IMPL_H_

#include "base/basictypes.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIDBDatabase.h"

namespace WebKit {
class WebIDBCallbacks;
class WebIDBDatabaseCallbacks;
class WebString;
}

namespace content {

class RendererWebIDBDatabaseImpl : public WebKit::WebIDBDatabase {
 public:
  explicit RendererWebIDBDatabaseImpl(int32 ipc_database_id);
  virtual ~RendererWebIDBDatabaseImpl();

  // WebKit::WebIDBDatabase
  virtual void createObjectStore(
      long long transaction_id,
      long long objectstore_id,
      const WebKit::WebString& name,
      const WebKit::WebIDBKeyPath& key_path,
      bool auto_increment);
  virtual void deleteObjectStore(
      long long transaction_id,
      long long object_store_id);
  virtual void createTransaction(
      long long transaction_id,
      WebKit::WebIDBDatabaseCallbacks* callbacks,
      const WebKit::WebVector<long long>& scope,
      unsigned short mode);
  virtual void close();
  virtual void get(long long transactionId,
                   long long objectStoreId,
                   long long indexId,
                   const WebKit::WebIDBKeyRange&,
                   bool keyOnly,
                   WebKit::WebIDBCallbacks*);
  virtual void put(long long transactionId,
                   long long objectStoreId,
                   WebKit::WebVector<unsigned char>* value,
                   const WebKit::WebIDBKey&,
                   PutMode,
                   WebKit::WebIDBCallbacks*,
                   const WebKit::WebVector<long long>& indexIds,
                   const WebKit::WebVector<WebIndexKeys>&);
  virtual void put(long long transactionId,
                   long long objectStoreId,
                   const WebKit::WebData& value,
                   const WebKit::WebIDBKey&,
                   PutMode,
                   WebKit::WebIDBCallbacks*,
                   const WebKit::WebVector<long long>& indexIds,
                   const WebKit::WebVector<WebIndexKeys>&);
  virtual void setIndexKeys(long long transactionId,
                            long long objectStoreId,
                            const WebKit::WebIDBKey&,
                            const WebKit::WebVector<long long>& indexIds,
                            const WebKit::WebVector<WebIndexKeys>&);
  virtual void setIndexesReady(long long transactionId,
                               long long objectStoreId,
                               const WebKit::WebVector<long long>& indexIds);
  virtual void openCursor(long long transactionId,
                          long long objectStoreId,
                          long long indexId,
                          const WebKit::WebIDBKeyRange&,
                          unsigned short direction,
                          bool keyOnly,
                          TaskType,
                          WebKit::WebIDBCallbacks*);
  virtual void count(long long transactionId,
                     long long objectStoreId,
                     long long indexId,
                     const WebKit::WebIDBKeyRange&,
                     WebKit::WebIDBCallbacks*);
  virtual void deleteRange(long long transactionId,
                           long long objectStoreId,
                           const WebKit::WebIDBKeyRange&,
                           WebKit::WebIDBCallbacks*);
  virtual void clear(long long transactionId,
                     long long objectStoreId,
                     WebKit::WebIDBCallbacks*);
  virtual void createIndex(long long transactionId,
                           long long objectStoreId,
                           long long indexId,
                           const WebKit::WebString& name,
                           const WebKit::WebIDBKeyPath&,
                           bool unique,
                           bool multiEntry);
  virtual void deleteIndex(long long transactionId, long
                           long objectStoreId,
                           long long indexId);
  virtual void abort(long long transaction_id);
  virtual void commit(long long transaction_id);

 private:
  int32 ipc_database_id_;
};

}  // namespace content

#endif  // CONTENT_COMMON_INDEXED_DB_PROXY_WEBIDBDATABASE_IMPL_H_