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/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 new IndexedDBCallbacks( | 284 new IndexedDBCallbacks( |
285 this, params.ipc_thread_id, params.ipc_callbacks_id), | 285 this, params.ipc_thread_id, params.ipc_callbacks_id), |
286 origin_url, | 286 origin_url, |
287 indexed_db_path, | 287 indexed_db_path, |
288 request_context_); | 288 request_context_); |
289 } | 289 } |
290 | 290 |
291 void IndexedDBDispatcherHost::OnIDBFactoryOpen( | 291 void IndexedDBDispatcherHost::OnIDBFactoryOpen( |
292 const IndexedDBHostMsg_FactoryOpen_Params& params) { | 292 const IndexedDBHostMsg_FactoryOpen_Params& params) { |
293 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); | 293 DCHECK(indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); |
294 base::TimeTicks begin_time = base::TimeTicks::Now(); | |
jsbell
2014/08/14 22:58:06
Why a temporary here rather than just passing in N
cmumford
2014/08/14 23:53:03
Just being cautious. The stack value is super smal
jsbell
2014/08/15 00:05:16
It's fine as is, and I agree with your logic. :)
| |
294 base::FilePath indexed_db_path = indexed_db_context_->data_path(); | 295 base::FilePath indexed_db_path = indexed_db_context_->data_path(); |
295 | 296 |
296 GURL origin_url = | 297 GURL origin_url = |
297 webkit_database::GetOriginFromIdentifier(params.database_identifier); | 298 webkit_database::GetOriginFromIdentifier(params.database_identifier); |
298 | 299 |
299 int64 host_transaction_id = HostTransactionId(params.transaction_id); | 300 int64 host_transaction_id = HostTransactionId(params.transaction_id); |
300 | 301 |
301 // TODO(dgrogan): Don't let a non-existing database be opened (and therefore | 302 // TODO(dgrogan): Don't let a non-existing database be opened (and therefore |
302 // created) if this origin is already over quota. | 303 // created) if this origin is already over quota. |
303 scoped_refptr<IndexedDBCallbacks> callbacks = | 304 scoped_refptr<IndexedDBCallbacks> callbacks = |
304 new IndexedDBCallbacks(this, | 305 new IndexedDBCallbacks(this, |
305 params.ipc_thread_id, | 306 params.ipc_thread_id, |
306 params.ipc_callbacks_id, | 307 params.ipc_callbacks_id, |
307 params.ipc_database_callbacks_id, | 308 params.ipc_database_callbacks_id, |
308 host_transaction_id, | 309 host_transaction_id, |
309 origin_url); | 310 origin_url); |
311 callbacks->SetDatbaseOpenStartTime(begin_time); | |
310 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks = | 312 scoped_refptr<IndexedDBDatabaseCallbacks> database_callbacks = |
311 new IndexedDBDatabaseCallbacks( | 313 new IndexedDBDatabaseCallbacks( |
312 this, params.ipc_thread_id, params.ipc_database_callbacks_id); | 314 this, params.ipc_thread_id, params.ipc_database_callbacks_id); |
313 IndexedDBPendingConnection connection(callbacks, | 315 IndexedDBPendingConnection connection(callbacks, |
314 database_callbacks, | 316 database_callbacks, |
315 ipc_process_id_, | 317 ipc_process_id_, |
316 host_transaction_id, | 318 host_transaction_id, |
317 params.version); | 319 params.version); |
318 DCHECK(request_context_); | 320 DCHECK(request_context_); |
319 Context()->GetIDBFactory()->Open( | 321 Context()->GetIDBFactory()->Open( |
(...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
991 } | 993 } |
992 | 994 |
993 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( | 995 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( |
994 int32 ipc_object_id) { | 996 int32 ipc_object_id) { |
995 DCHECK( | 997 DCHECK( |
996 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); | 998 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); |
997 parent_->DestroyObject(&map_, ipc_object_id); | 999 parent_->DestroyObject(&map_, ipc_object_id); |
998 } | 1000 } |
999 | 1001 |
1000 } // namespace content | 1002 } // namespace content |
OLD | NEW |