summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/renderer_webidbfactory_impl.cc
blob: f06e190fe8c748c8ee08cd8f644d612f3afdd0b9 (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
// 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_webidbfactory_impl.h"

#include "chrome/common/render_messages.h"
#include "chrome/renderer/render_thread.h"
#include "chrome/renderer/indexed_db_dispatcher.h"
#include "third_party/WebKit/WebKit/chromium/public/WebDOMStringList.h"
#include "third_party/WebKit/WebKit/chromium/public/WebString.h"

using WebKit::WebDOMStringList;
using WebKit::WebFrame;
using WebKit::WebIDBCallbacks;
using WebKit::WebIDBDatabase;
using WebKit::WebSecurityOrigin;
using WebKit::WebString;

RendererWebIDBFactoryImpl::RendererWebIDBFactoryImpl() {
}

RendererWebIDBFactoryImpl::~RendererWebIDBFactoryImpl() {
}

void RendererWebIDBFactoryImpl::open(
    const WebString& name, const WebString& description,
    WebIDBCallbacks* callbacks, const WebSecurityOrigin& origin,
    WebFrame* web_frame, const WebString& dataDir) {
  // Don't send the dataDir. We know what we want on the Browser side of things.
  IndexedDBDispatcher* dispatcher =
      RenderThread::current()->indexed_db_dispatcher();
  dispatcher->RequestIDBFactoryOpen(
      name, description, callbacks, origin.databaseIdentifier(), web_frame);
}

void RendererWebIDBFactoryImpl::abortPendingTransactions(
    const WebKit::WebVector<int>& pendingIDs) {
  std::vector<int> ids;
  for (size_t i = 0; i < pendingIDs.size(); ++i) {
    ids.push_back(pendingIDs[i]);
  }
  RenderThread::current()->Send(
      new ViewHostMsg_IDBFactoryAbortPendingTransactions(ids));
}