summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/renderer_webidbobjectstore_impl.h
blob: 462f02ed449c498948392d19ecb6a6d818f40f6a (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
// Copyright (c) 2010 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 CHROME_RENDERER_RENDERER_WEBIDBOBJECTSTORE_IMPL_H_
#define CHROME_RENDERER_RENDERER_WEBIDBOBJECTSTORE_IMPL_H_

#include "base/basictypes.h"
#include "third_party/WebKit/WebKit/chromium/public/WebIDBCallbacks.h"
#include "third_party/WebKit/WebKit/chromium/public/WebIDBObjectStore.h"

namespace WebKit {
class WebFrame;
class WebIDBCallbacks;
class WebIDBIndex;
class WebIDBKey;
class WebString;
}

class RendererWebIDBObjectStoreImpl : public WebKit::WebIDBObjectStore {
 public:
  explicit RendererWebIDBObjectStoreImpl(int32 idb_object_store_id);
  ~RendererWebIDBObjectStoreImpl();

  // WebKit::WebIDBObjectStore
  WebKit::WebString name() const;
  WebKit::WebString keyPath() const;
  WebKit::WebDOMStringList indexNames() const;

  void get(const WebKit::WebIDBKey& key, WebKit::WebIDBCallbacks* callbacks);
  void put(const WebKit::WebSerializedScriptValue& value,
           const WebKit::WebIDBKey& key, bool add_only,
           WebKit::WebIDBCallbacks* callbacks);
  void remove(const WebKit::WebIDBKey& key, WebKit::WebIDBCallbacks* callbacks);

  void createIndex(const WebKit::WebString& name,
                   const WebKit::WebString& key_path, bool unique,
                   WebKit::WebIDBCallbacks* callbacks);
  // Transfers ownership of the WebIDBIndex to the caller.
  WebKit::WebIDBIndex* index(const WebKit::WebString& name);
  void removeIndex(const WebKit::WebString& name,
                   WebKit::WebIDBCallbacks* callbacks);

 private:
  int32 idb_object_store_id_;
};

#endif  // CHROME_RENDERER_RENDERER_WEBIDBOBJECTSTORE_IMPL_H_