summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/renderer_webidbcursor_impl.cc
blob: b647173da6fbc5eceb0a9e63759235f5a7ce3382 (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
// 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.

#include "chrome/renderer/renderer_webidbcursor_impl.h"

#include "chrome/common/render_messages.h"
#include "chrome/renderer/render_thread.h"

using WebKit::WebIDBCallbacks;
using WebKit::WebIDBKey;
using WebKit::WebSerializedScriptValue;

RendererWebIDBCursorImpl::RendererWebIDBCursorImpl(int32 idb_cursor_id)
    : idb_cursor_id_(idb_cursor_id) {
}

RendererWebIDBCursorImpl::~RendererWebIDBCursorImpl() {
  RenderThread::current()->Send(new ViewHostMsg_IDBCursorDestroyed(
      idb_cursor_id_));
}

unsigned short RendererWebIDBCursorImpl::direction() const {
  int direction;
  RenderThread::current()->Send(
      new ViewHostMsg_IDBCursorDirection(idb_cursor_id_, &direction));
  return direction;
}

WebIDBKey RendererWebIDBCursorImpl::key() const {
  IndexedDBKey key;
  RenderThread::current()->Send(
      new ViewHostMsg_IDBCursorKey(idb_cursor_id_, &key));
  return key;
}

WebSerializedScriptValue RendererWebIDBCursorImpl::value() const {
  SerializedScriptValue value;
  RenderThread::current()->Send(
      new ViewHostMsg_IDBCursorValue(idb_cursor_id_, &value));
  return value;
}

void RendererWebIDBCursorImpl::update(const WebSerializedScriptValue& value,
                                      WebIDBCallbacks* callback) {
  // TODO(bulach): implement this.
  NOTREACHED();
}

void RendererWebIDBCursorImpl::continueFunction(const WebIDBKey& key,
                                                WebIDBCallbacks* callback) {
  // TODO(bulach): implement this.
  NOTREACHED();
}

void RendererWebIDBCursorImpl::remove(WebIDBCallbacks* callback) {
  // TODO(bulach): implement this.
  NOTREACHED();
}