| 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/thread_safe_sender.h" | 8 #include "content/child/thread_safe_sender.h" |
| 9 #include "third_party/WebKit/public/platform/URLConversion.h" |
| 9 #include "third_party/WebKit/public/platform/WebCString.h" | 10 #include "third_party/WebKit/public/platform/WebCString.h" |
| 11 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 10 #include "third_party/WebKit/public/platform/WebString.h" | 12 #include "third_party/WebKit/public/platform/WebString.h" |
| 11 | 13 |
| 12 using blink::WebIDBCallbacks; | 14 using blink::WebIDBCallbacks; |
| 13 using blink::WebIDBDatabase; | 15 using blink::WebIDBDatabase; |
| 14 using blink::WebIDBDatabaseCallbacks; | 16 using blink::WebIDBDatabaseCallbacks; |
| 17 using blink::WebSecurityOrigin; |
| 15 using blink::WebString; | 18 using blink::WebString; |
| 16 | 19 |
| 17 namespace content { | 20 namespace content { |
| 18 | 21 |
| 19 WebIDBFactoryImpl::WebIDBFactoryImpl(ThreadSafeSender* thread_safe_sender) | 22 WebIDBFactoryImpl::WebIDBFactoryImpl(ThreadSafeSender* thread_safe_sender) |
| 20 : thread_safe_sender_(thread_safe_sender) {} | 23 : thread_safe_sender_(thread_safe_sender) {} |
| 21 | 24 |
| 22 WebIDBFactoryImpl::~WebIDBFactoryImpl() {} | 25 WebIDBFactoryImpl::~WebIDBFactoryImpl() {} |
| 23 | 26 |
| 24 void WebIDBFactoryImpl::getDatabaseNames(WebIDBCallbacks* callbacks, | 27 void WebIDBFactoryImpl::getDatabaseNames(WebIDBCallbacks* callbacks, |
| 25 const WebString& database_identifier) { | 28 const WebSecurityOrigin& origin) { |
| 26 IndexedDBDispatcher* dispatcher = | 29 IndexedDBDispatcher* dispatcher = |
| 27 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); | 30 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
| 28 dispatcher->RequestIDBFactoryGetDatabaseNames(callbacks, | 31 dispatcher->RequestIDBFactoryGetDatabaseNames( |
| 29 database_identifier.utf8()); | 32 callbacks, blink::WebStringToGURL(origin.toString())); |
| 30 } | 33 } |
| 31 | 34 |
| 32 void WebIDBFactoryImpl::open(const WebString& name, | 35 void WebIDBFactoryImpl::open(const WebString& name, |
| 33 long long version, | 36 long long version, |
| 34 long long transaction_id, | 37 long long transaction_id, |
| 35 WebIDBCallbacks* callbacks, | 38 WebIDBCallbacks* callbacks, |
| 36 WebIDBDatabaseCallbacks* database_callbacks, | 39 WebIDBDatabaseCallbacks* database_callbacks, |
| 37 const WebString& database_identifier) { | 40 const WebSecurityOrigin& origin) { |
| 38 IndexedDBDispatcher* dispatcher = | 41 IndexedDBDispatcher* dispatcher = |
| 39 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); | 42 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
| 40 dispatcher->RequestIDBFactoryOpen(name, | 43 dispatcher->RequestIDBFactoryOpen(name, version, transaction_id, callbacks, |
| 41 version, | |
| 42 transaction_id, | |
| 43 callbacks, | |
| 44 database_callbacks, | 44 database_callbacks, |
| 45 database_identifier.utf8()); | 45 blink::WebStringToGURL(origin.toString())); |
| 46 } | 46 } |
| 47 | 47 |
| 48 void WebIDBFactoryImpl::deleteDatabase(const WebString& name, | 48 void WebIDBFactoryImpl::deleteDatabase(const WebString& name, |
| 49 WebIDBCallbacks* callbacks, | 49 WebIDBCallbacks* callbacks, |
| 50 const WebString& database_identifier) { | 50 const WebSecurityOrigin& origin) { |
| 51 IndexedDBDispatcher* dispatcher = | 51 IndexedDBDispatcher* dispatcher = |
| 52 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); | 52 IndexedDBDispatcher::ThreadSpecificInstance(thread_safe_sender_.get()); |
| 53 dispatcher->RequestIDBFactoryDeleteDatabase( | 53 dispatcher->RequestIDBFactoryDeleteDatabase( |
| 54 name, callbacks, database_identifier.utf8()); | 54 name, callbacks, blink::WebStringToGURL(origin.toString())); |
| 55 } | 55 } |
| 56 | 56 |
| 57 } // namespace content | 57 } // namespace content |
| OLD | NEW |