Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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/browser/indexed_db/webidbfactory_impl.h" | 5 #include "content/browser/indexed_db/webidbfactory_impl.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "content/browser/indexed_db/indexed_db_callbacks_wrapper.h" | 8 #include "content/browser/indexed_db/indexed_db_callbacks_wrapper.h" |
| 9 #include "content/browser/indexed_db/indexed_db_factory.h" | 9 #include "content/browser/indexed_db/indexed_db_factory.h" |
| 10 #include "content/browser/indexed_db/indexed_db_factory.h" | 10 #include "content/browser/indexed_db/indexed_db_factory.h" |
| 11 #include "third_party/WebKit/public/platform/WebCString.h" | |
| 11 #include "third_party/WebKit/public/platform/WebIDBDatabaseError.h" | 12 #include "third_party/WebKit/public/platform/WebIDBDatabaseError.h" |
| 12 #include "webkit/base/file_path_string_conversions.h" | 13 #include "webkit/base/file_path_string_conversions.h" |
| 13 | 14 |
| 14 using WebKit::WebString; | 15 using WebKit::WebString; |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 | 18 |
| 18 WebIDBFactoryImpl::WebIDBFactoryImpl() | 19 WebIDBFactoryImpl::WebIDBFactoryImpl() |
| 19 : idb_factory_backend_(IndexedDBFactory::Create()) {} | 20 : idb_factory_backend_(IndexedDBFactory::Create()) {} |
| 20 | 21 |
| 21 WebIDBFactoryImpl::~WebIDBFactoryImpl() {} | 22 WebIDBFactoryImpl::~WebIDBFactoryImpl() {} |
| 22 | 23 |
| 23 void WebIDBFactoryImpl::getDatabaseNames(IndexedDBCallbacksBase* callbacks, | 24 void WebIDBFactoryImpl::getDatabaseNames(IndexedDBCallbacksBase* callbacks, |
| 24 const WebString& database_identifier, | 25 const WebString& database_identifier, |
| 25 const WebString& data_dir) { | 26 const WebString& data_dir) { |
| 26 idb_factory_backend_->GetDatabaseNames( | 27 idb_factory_backend_->GetDatabaseNames( |
| 27 IndexedDBCallbacksWrapper::Create(callbacks), | 28 IndexedDBCallbacksWrapper::Create(callbacks), |
| 28 database_identifier, | 29 database_identifier.utf8(), |
|
jsbell
2013/06/20 16:38:40
Despite the name, these WebIDB*Impl files no longe
jamesr
2013/06/20 16:54:32
In fact, it looks like the caller is taking a std:
| |
| 29 webkit_base::WebStringToFilePath(data_dir)); | 30 webkit_base::WebStringToFilePath(data_dir)); |
| 30 } | 31 } |
| 31 | 32 |
| 32 void WebIDBFactoryImpl::open(const WebString& name, | 33 void WebIDBFactoryImpl::open(const WebString& name, |
| 33 long long version, | 34 long long version, |
| 34 long long transaction_id, | 35 long long transaction_id, |
| 35 IndexedDBCallbacksBase* callbacks, | 36 IndexedDBCallbacksBase* callbacks, |
| 36 IndexedDBDatabaseCallbacks* database_callbacks, | 37 IndexedDBDatabaseCallbacks* database_callbacks, |
| 37 const WebString& database_identifier, | 38 const WebString& database_identifier, |
| 38 const WebString& data_dir) { | 39 const WebString& data_dir) { |
| 39 scoped_refptr<IndexedDBCallbacksWrapper> callbacks_proxy = | 40 scoped_refptr<IndexedDBCallbacksWrapper> callbacks_proxy = |
| 40 IndexedDBCallbacksWrapper::Create(callbacks); | 41 IndexedDBCallbacksWrapper::Create(callbacks); |
| 41 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks_proxy = | 42 scoped_refptr<IndexedDBDatabaseCallbacksWrapper> database_callbacks_proxy = |
| 42 IndexedDBDatabaseCallbacksWrapper::Create(database_callbacks); | 43 IndexedDBDatabaseCallbacksWrapper::Create(database_callbacks); |
| 43 | 44 |
| 44 callbacks_proxy->SetDatabaseCallbacks(database_callbacks_proxy); | 45 callbacks_proxy->SetDatabaseCallbacks(database_callbacks_proxy); |
| 45 idb_factory_backend_->Open(name, | 46 idb_factory_backend_->Open(name, |
| 46 version, | 47 version, |
| 47 transaction_id, | 48 transaction_id, |
| 48 callbacks_proxy.get(), | 49 callbacks_proxy.get(), |
| 49 database_callbacks_proxy.get(), | 50 database_callbacks_proxy.get(), |
| 50 database_identifier, | 51 database_identifier.utf8(), |
| 51 webkit_base::WebStringToFilePath(data_dir)); | 52 webkit_base::WebStringToFilePath(data_dir)); |
| 52 } | 53 } |
| 53 | 54 |
| 54 void WebIDBFactoryImpl::deleteDatabase(const WebString& name, | 55 void WebIDBFactoryImpl::deleteDatabase(const WebString& name, |
| 55 IndexedDBCallbacksBase* callbacks, | 56 IndexedDBCallbacksBase* callbacks, |
| 56 const WebString& database_identifier, | 57 const WebString& database_identifier, |
| 57 const WebString& data_dir) { | 58 const WebString& data_dir) { |
| 58 idb_factory_backend_->DeleteDatabase( | 59 idb_factory_backend_->DeleteDatabase( |
| 59 name, | 60 name, |
| 60 IndexedDBCallbacksWrapper::Create(callbacks), | 61 IndexedDBCallbacksWrapper::Create(callbacks), |
| 61 database_identifier, | 62 database_identifier.utf8(), |
| 62 webkit_base::WebStringToFilePath(data_dir)); | 63 webkit_base::WebStringToFilePath(data_dir)); |
| 63 } | 64 } |
| 64 | 65 |
| 65 } // namespace WebKit | 66 } // namespace WebKit |
| OLD | NEW |