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

Side by Side Diff: content/browser/indexed_db/indexed_db_database.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 | « no previous file | content/browser/indexed_db/indexed_db_dispatcher_host.cc » ('j') | 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) 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/indexed_db_database.h" 5 #include "content/browser/indexed_db/indexed_db_database.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 1380 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 } 1391 }
1392 } 1392 }
1393 1393
1394 void IndexedDBDatabase::CreateTransaction( 1394 void IndexedDBDatabase::CreateTransaction(
1395 int64 transaction_id, 1395 int64 transaction_id,
1396 IndexedDBConnection* connection, 1396 IndexedDBConnection* connection,
1397 const std::vector<int64>& object_store_ids, 1397 const std::vector<int64>& object_store_ids,
1398 uint16 mode) { 1398 uint16 mode) {
1399 1399
1400 DCHECK(connections_.has(connection)); 1400 DCHECK(connections_.has(connection));
1401 DCHECK(transactions_.find(transaction_id) == transactions_.end());
1402 if (transactions_.find(transaction_id) != transactions_.end())
1403 return;
1401 1404
1402 scoped_refptr<IndexedDBTransaction> transaction = new IndexedDBTransaction( 1405 scoped_refptr<IndexedDBTransaction> transaction = new IndexedDBTransaction(
1403 transaction_id, 1406 transaction_id,
1404 connection->callbacks(), 1407 connection->callbacks(),
1405 std::set<int64>(object_store_ids.begin(), object_store_ids.end()), 1408 std::set<int64>(object_store_ids.begin(), object_store_ids.end()),
1406 static_cast<indexed_db::TransactionMode>(mode), 1409 static_cast<indexed_db::TransactionMode>(mode),
1407 this); 1410 this);
1408 DCHECK(transactions_.find(transaction_id) == transactions_.end());
1409 transactions_[transaction_id] = transaction; 1411 transactions_[transaction_id] = transaction;
1410 } 1412 }
1411 1413
1412 bool IndexedDBDatabase::IsOpenConnectionBlocked() const { 1414 bool IndexedDBDatabase::IsOpenConnectionBlocked() const {
1413 return !pending_delete_calls_.empty() || 1415 return !pending_delete_calls_.empty() ||
1414 running_version_change_transaction_ || 1416 running_version_change_transaction_ ||
1415 pending_run_version_change_transaction_call_; 1417 pending_run_version_change_transaction_call_;
1416 } 1418 }
1417 1419
1418 void IndexedDBDatabase::OpenConnection( 1420 void IndexedDBDatabase::OpenConnection(
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1721 const string16& previous_version, 1723 const string16& previous_version,
1722 int64 previous_int_version, 1724 int64 previous_int_version,
1723 IndexedDBTransaction* transaction) { 1725 IndexedDBTransaction* transaction) {
1724 IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation"); 1726 IDB_TRACE("IndexedDBDatabase::VersionChangeAbortOperation");
1725 DCHECK(!transaction); 1727 DCHECK(!transaction);
1726 metadata_.version = previous_version; 1728 metadata_.version = previous_version;
1727 metadata_.int_version = previous_int_version; 1729 metadata_.int_version = previous_int_version;
1728 } 1730 }
1729 1731
1730 } // namespace content 1732 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/indexed_db/indexed_db_dispatcher_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698