| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/child/indexed_db/webidbfactory_impl.h" | 5 #include "content/child/indexed_db/webidbfactory_impl.h" |
| 6 | 6 |
| 7 #include "content/child/indexed_db/indexed_db_dispatcher.h" | 7 #include "content/child/indexed_db/indexed_db_dispatcher.h" |
| 8 #include "content/child/storage_util.h" | 8 #include "content/child/storage_util.h" |
| 9 #include "content/child/thread_safe_sender.h" | 9 #include "content/child/thread_safe_sender.h" |
| 10 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 10 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 11 #include "third_party/WebKit/public/platform/WebString.h" | 11 #include "third_party/WebKit/public/platform/WebString.h" |
| 12 #include "third_party/WebKit/public/platform/modules/indexeddb/indexed_db.mojom.
h" |
| 12 | 13 |
| 13 using blink::WebIDBCallbacks; | 14 using blink::WebIDBCallbacks; |
| 14 using blink::WebIDBDatabase; | 15 using blink::WebIDBDatabase; |
| 15 using blink::WebIDBDatabaseCallbacks; | |
| 16 using blink::WebSecurityOrigin; | 16 using blink::WebSecurityOrigin; |
| 17 using blink::WebString; | 17 using blink::WebString; |
| 18 | 18 |
| 19 namespace content { | 19 namespace content { |
| 20 | 20 |
| 21 WebIDBFactoryImpl::WebIDBFactoryImpl(ThreadSafeSender* thread_safe_sender) | 21 WebIDBFactoryImpl::WebIDBFactoryImpl(ThreadSafeSender* thread_safe_sender) |
| 22 : thread_safe_sender_(thread_safe_sender) {} | 22 : thread_safe_sender_(thread_safe_sender) {} |
| 23 | 23 |
| 24 WebIDBFactoryImpl::~WebIDBFactoryImpl() {} | 24 WebIDBFactoryImpl::~WebIDBFactoryImpl() {} |
| 25 | 25 |
| 26 void WebIDBFactoryImpl::getDatabaseNames(WebIDBCallbacks* callbacks, | 26 void WebIDBFactoryImpl::getDatabaseNames(WebIDBCallbacks* callbacks, |
| 27 const WebSecurityOrigin& origin) { | 27 const WebSecurityOrigin& origin) { |
| 28 IndexedDBDispatcher* dispatcher = | 28 IndexedDBDispatcher* dispatcher = |
| 29 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); | 29 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
| 30 dispatcher->RequestIDBFactoryGetDatabaseNames(callbacks, origin); | 30 dispatcher->RequestIDBFactoryGetDatabaseNames(callbacks, origin); |
| 31 } | 31 } |
| 32 | 32 |
| 33 void WebIDBFactoryImpl::open(const WebString& name, | 33 void WebIDBFactoryImpl::open( |
| 34 long long version, | 34 const WebString& name, |
| 35 long long transaction_id, | 35 long long version, |
| 36 WebIDBCallbacks* callbacks, | 36 long long transaction_id, |
| 37 WebIDBDatabaseCallbacks* database_callbacks, | 37 WebIDBCallbacks* callbacks, |
| 38 const WebSecurityOrigin& origin) { | 38 mojo::ScopedInterfaceEndpointHandle* client_interface_endpoint, |
| 39 const WebSecurityOrigin& origin) { |
| 39 IndexedDBDispatcher* dispatcher = | 40 IndexedDBDispatcher* dispatcher = |
| 40 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); | 41 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
| 41 | 42 dispatcher->RequestIDBFactoryOpen(name.utf8(), version, transaction_id, |
| 42 dispatcher->RequestIDBFactoryOpen(name, version, transaction_id, callbacks, | 43 callbacks, client_interface_endpoint, |
| 43 database_callbacks, origin); | 44 origin); |
| 44 } | 45 } |
| 45 | 46 |
| 46 void WebIDBFactoryImpl::deleteDatabase(const WebString& name, | 47 void WebIDBFactoryImpl::deleteDatabase(const WebString& name, |
| 47 WebIDBCallbacks* callbacks, | 48 WebIDBCallbacks* callbacks, |
| 48 const WebSecurityOrigin& origin) { | 49 const WebSecurityOrigin& origin) { |
| 49 IndexedDBDispatcher* dispatcher = | 50 IndexedDBDispatcher* dispatcher = |
| 50 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); | 51 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
| 51 dispatcher->RequestIDBFactoryDeleteDatabase(name, callbacks, origin); | 52 dispatcher->RequestIDBFactoryDeleteDatabase(name, callbacks, origin); |
| 52 } | 53 } |
| 53 | 54 |
| 54 } // namespace content | 55 } // namespace content |
| OLD | NEW |