| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 | 372 |
| 373 // TODO(dgrogan): Don't let a non-existing database be opened (and therefore | 373 // TODO(dgrogan): Don't let a non-existing database be opened (and therefore |
| 374 // created) if this origin is already over quota. | 374 // created) if this origin is already over quota. |
| 375 scoped_refptr<IndexedDBCallbacks> callbacks = new IndexedDBCallbacks( | 375 scoped_refptr<IndexedDBCallbacks> callbacks = new IndexedDBCallbacks( |
| 376 this, params.ipc_thread_id, params.ipc_callbacks_id, | 376 this, params.ipc_thread_id, params.ipc_callbacks_id, |
| 377 params.ipc_database_callbacks_id, host_transaction_id, params.origin); | 377 params.ipc_database_callbacks_id, host_transaction_id, params.origin); |
| 378 callbacks->SetConnectionOpenStartTime(begin_time); | 378 callbacks->SetConnectionOpenStartTime(begin_time); |
| 379 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks = | 379 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks = |
| 380 new IndexedDBDatabaseCallbacks( | 380 new IndexedDBDatabaseCallbacks( |
| 381 this, params.ipc_thread_id, params.ipc_database_callbacks_id); | 381 this, params.ipc_thread_id, params.ipc_database_callbacks_id); |
| 382 IndexedDBPendingConnection connection(callbacks, | 382 std::unique_ptr<IndexedDBPendingConnection> connection = |
| 383 database_callbacks, | 383 base::WrapUnique(new IndexedDBPendingConnection( |
| 384 ipc_process_id_, | 384 callbacks, database_callbacks, ipc_process_id_, host_transaction_id, |
| 385 host_transaction_id, | 385 params.version)); |
| 386 params.version); | |
| 387 DCHECK(request_context_); | 386 DCHECK(request_context_); |
| 388 context()->GetIDBFactory()->Open(params.name, connection, request_context_, | 387 context()->GetIDBFactory()->Open(params.name, std::move(connection), |
| 389 params.origin, indexed_db_path); | 388 request_context_, params.origin, |
| 389 indexed_db_path); |
| 390 } | 390 } |
| 391 | 391 |
| 392 void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase( | 392 void IndexedDBDispatcherHost::OnIDBFactoryDeleteDatabase( |
| 393 const IndexedDBHostMsg_FactoryDeleteDatabase_Params& params) { | 393 const IndexedDBHostMsg_FactoryDeleteDatabase_Params& params) { |
| 394 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); | 394 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); |
| 395 | 395 |
| 396 if (!IsValidOrigin(params.origin)) { | 396 if (!IsValidOrigin(params.origin)) { |
| 397 bad_message::ReceivedBadMessage(this, bad_message::IDBDH_INVALID_ORIGIN); | 397 bad_message::ReceivedBadMessage(this, bad_message::IDBDH_INVALID_ORIGIN); |
| 398 return; | 398 return; |
| 399 } | 399 } |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1094 DLOG(ERROR) << "Unable to reset prefetch"; | 1094 DLOG(ERROR) << "Unable to reset prefetch"; |
| 1095 } | 1095 } |
| 1096 | 1096 |
| 1097 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( | 1097 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( |
| 1098 int32_t ipc_object_id) { | 1098 int32_t ipc_object_id) { |
| 1099 DCHECK(parent_->context()->TaskRunner()->RunsTasksOnCurrentThread()); | 1099 DCHECK(parent_->context()->TaskRunner()->RunsTasksOnCurrentThread()); |
| 1100 parent_->DestroyObject(&map_, ipc_object_id); | 1100 parent_->DestroyObject(&map_, ipc_object_id); |
| 1101 } | 1101 } |
| 1102 | 1102 |
| 1103 } // namespace content | 1103 } // namespace content |
| OLD | NEW |