Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(118)

Side by Side Diff: content/browser/indexed_db/indexed_db_dispatcher_host.cc

Issue 24702002: IndexedDB: Ignore duplicate transaction IDs sent by renderer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « content/browser/indexed_db/indexed_db_database.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/process/process.h" 10 #include "base/process/process.h"
(...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 const IndexedDBHostMsg_DatabaseCreateTransaction_Params& params) { 469 const IndexedDBHostMsg_DatabaseCreateTransaction_Params& params) {
470 DCHECK( 470 DCHECK(
471 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); 471 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());
472 IndexedDBConnection* connection = 472 IndexedDBConnection* connection =
473 parent_->GetOrTerminateProcess(&map_, params.ipc_database_id); 473 parent_->GetOrTerminateProcess(&map_, params.ipc_database_id);
474 if (!connection) 474 if (!connection)
475 return; 475 return;
476 476
477 int64 host_transaction_id = parent_->HostTransactionId(params.transaction_id); 477 int64 host_transaction_id = parent_->HostTransactionId(params.transaction_id);
478 478
479 if (transaction_database_map_.find(host_transaction_id) !=
480 transaction_database_map_.end()) {
481 DLOG(ERROR) << "Duplicate host_transaction_id.";
482 return;
483 }
484
479 connection->database()->CreateTransaction( 485 connection->database()->CreateTransaction(
480 host_transaction_id, connection, params.object_store_ids, params.mode); 486 host_transaction_id, connection, params.object_store_ids, params.mode);
481 transaction_database_map_[host_transaction_id] = params.ipc_database_id; 487 transaction_database_map_[host_transaction_id] = params.ipc_database_id;
482 parent_->RegisterTransactionId(host_transaction_id, 488 parent_->RegisterTransactionId(host_transaction_id,
483 database_url_map_[params.ipc_database_id]); 489 database_url_map_[params.ipc_database_id]);
484 } 490 }
485 491
486 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnClose( 492 void IndexedDBDispatcherHost::DatabaseDispatcherHost::OnClose(
487 int32 ipc_database_id) { 493 int32 ipc_database_id) {
488 DCHECK( 494 DCHECK(
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 } 867 }
862 868
863 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed( 869 void IndexedDBDispatcherHost::CursorDispatcherHost::OnDestroyed(
864 int32 ipc_object_id) { 870 int32 ipc_object_id) {
865 DCHECK( 871 DCHECK(
866 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread()); 872 parent_->indexed_db_context_->TaskRunner()->RunsTasksOnCurrentThread());
867 parent_->DestroyObject(&map_, ipc_object_id); 873 parent_->DestroyObject(&map_, ipc_object_id);
868 } 874 }
869 875
870 } // namespace content 876 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/indexed_db/indexed_db_database.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698