OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 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. | |
4 | |
5 #include "webidbfactory_impl.h" | |
6 | |
7 #include "base/memory/scoped_ptr.h" | |
8 #include "content/browser/indexed_db/indexed_db_factory_impl.h" | |
9 #include "indexed_db_callbacks_wrapper.h" | |
10 #include "indexed_db_factory.h" | |
11 #include "third_party/WebKit/Source/Platform/chromium/public/WebIDBDatabaseCallb acks.h" | |
12 #include "third_party/WebKit/Source/Platform/chromium/public/WebIDBDatabaseError .h" | |
13 | |
14 using WebKit::WebIDBCallbacks; | |
15 using WebKit::WebIDBDatabaseCallbacks; | |
16 using WebKit::WebIDBFactory; | |
17 using WebKit::WebString; | |
18 | |
19 namespace content { | |
20 | |
21 WebIDBFactoryImpl::WebIDBFactoryImpl() | |
22 : idb_factory_backend_(IndexedDBFactoryImpl::Create()) {} | |
23 | |
24 WebIDBFactoryImpl::~WebIDBFactoryImpl() {} | |
25 | |
26 void WebIDBFactoryImpl::getDatabaseNames(WebIDBCallbacks* callbacks, | |
27 const WebString& database_identifier, | |
28 const WebString& data_dir) { | |
29 idb_factory_backend_->GetDatabaseNames( | |
30 IndexedDBCallbacksWrapper::Create(callbacks), | |
31 database_identifier, | |
32 0, | |
jamesr
2013/05/21 23:56:06
this looks like a pointer - should be NULL in chro
jsbell
2013/05/22 17:54:44
Done. Actually, killed that argument entirely whic
| |
33 data_dir); | |
34 } | |
35 | |
36 void WebIDBFactoryImpl::open(const WebString& name, | |
37 long long version, | |
38 long long transaction_id, | |
39 WebIDBCallbacks* callbacks, | |
40 WebIDBDatabaseCallbacks* database_callbacks, | |
41 const WebString& database_identifier, | |
42 const WebString& data_dir) { | |
43 scoped_refptr<IndexedDBCallbacksWrapper> callbacks_proxy = | |
44 IndexedDBCallbacksWrapper::Create(callbacks); | |
45 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks_proxy = | |
46 IndexedDBDatabaseCallbacksWrapper::Create(database_callbacks); | |
47 | |
48 callbacks_proxy->SetDatabaseCallbacks(database_callbacks_proxy); | |
49 idb_factory_backend_->Open(name, | |
50 version, | |
51 transaction_id, | |
52 callbacks_proxy.get(), | |
53 database_callbacks_proxy.get(), | |
54 database_identifier, | |
55 0, | |
56 data_dir); | |
57 } | |
58 | |
59 void WebIDBFactoryImpl::deleteDatabase(const WebString& name, | |
60 WebIDBCallbacks* callbacks, | |
61 const WebString& database_identifier, | |
62 const WebString& data_dir) { | |
63 idb_factory_backend_->DeleteDatabase( | |
64 name, | |
65 IndexedDBCallbacksWrapper::Create(callbacks), | |
66 database_identifier, | |
67 0, | |
68 data_dir); | |
69 } | |
70 | |
71 } // namespace WebKit | |
OLD | NEW |