OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/indexed_db_dispatcher_host.h" | 5 #include "content/browser/indexed_db/indexed_db_dispatcher_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/guid.h" | 9 #include "base/guid.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 DCHECK(indexed_db_context_.get()); | 46 DCHECK(indexed_db_context_.get()); |
47 } | 47 } |
48 | 48 |
49 IndexedDBDispatcherHost::~IndexedDBDispatcherHost() {} | 49 IndexedDBDispatcherHost::~IndexedDBDispatcherHost() {} |
50 | 50 |
51 void IndexedDBDispatcherHost::AddBinding( | 51 void IndexedDBDispatcherHost::AddBinding( |
52 ::indexed_db::mojom::FactoryAssociatedRequest request) { | 52 ::indexed_db::mojom::FactoryAssociatedRequest request) { |
53 bindings_.AddBinding(this, std::move(request)); | 53 bindings_.AddBinding(this, std::move(request)); |
54 } | 54 } |
55 | 55 |
| 56 void IndexedDBDispatcherHost::AddDatabaseBinding( |
| 57 std::unique_ptr<::indexed_db::mojom::Database> database, |
| 58 ::indexed_db::mojom::DatabaseAssociatedRequest request) { |
| 59 database_bindings_.AddBinding(std::move(database), std::move(request)); |
| 60 } |
| 61 |
| 62 void IndexedDBDispatcherHost::AddCursorBinding( |
| 63 std::unique_ptr<::indexed_db::mojom::Cursor> cursor, |
| 64 ::indexed_db::mojom::CursorAssociatedRequest request) { |
| 65 cursor_bindings_.AddBinding(std::move(cursor), std::move(request)); |
| 66 } |
| 67 |
56 std::string IndexedDBDispatcherHost::HoldBlobData( | 68 std::string IndexedDBDispatcherHost::HoldBlobData( |
57 const IndexedDBBlobInfo& blob_info) { | 69 const IndexedDBBlobInfo& blob_info) { |
58 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 70 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
59 std::string uuid = blob_info.uuid(); | 71 std::string uuid = blob_info.uuid(); |
60 storage::BlobStorageContext* context = blob_storage_context_->context(); | 72 storage::BlobStorageContext* context = blob_storage_context_->context(); |
61 std::unique_ptr<storage::BlobDataHandle> blob_data_handle; | 73 std::unique_ptr<storage::BlobDataHandle> blob_data_handle; |
62 if (uuid.empty()) { | 74 if (uuid.empty()) { |
63 uuid = base::GenerateGUID(); | 75 uuid = base::GenerateGUID(); |
64 storage::BlobDataBuilder blob_data_builder(uuid); | 76 storage::BlobDataBuilder blob_data_builder(uuid); |
65 blob_data_builder.set_content_type(base::UTF16ToUTF8(blob_info.type())); | 77 blob_data_builder.set_content_type(base::UTF16ToUTF8(blob_info.type())); |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); | 214 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); |
203 | 215 |
204 base::FilePath indexed_db_path = indexed_db_context_->data_path(); | 216 base::FilePath indexed_db_path = indexed_db_context_->data_path(); |
205 DCHECK(request_context_getter_); | 217 DCHECK(request_context_getter_); |
206 context()->GetIDBFactory()->DeleteDatabase( | 218 context()->GetIDBFactory()->DeleteDatabase( |
207 name, request_context_getter_, callbacks, origin, indexed_db_path, | 219 name, request_context_getter_, callbacks, origin, indexed_db_path, |
208 force_close); | 220 force_close); |
209 } | 221 } |
210 | 222 |
211 } // namespace content | 223 } // namespace content |
OLD | NEW |