summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstgao@chromium.org <stgao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-04 23:02:31 +0000
committerstgao@chromium.org <stgao@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-04 23:02:31 +0000
commitcfb3ef9704a1a189a3fc0f07b89ccdf68b2bb5bf (patch)
tree17f0b2e241f6b350f86296ae5237c18026b4e8d6
parent15291383f6143453ff1925dc53bbadadb4b3f4d3 (diff)
downloadchromium_src-cfb3ef9704a1a189a3fc0f07b89ccdf68b2bb5bf.zip
chromium_src-cfb3ef9704a1a189a3fc0f07b89ccdf68b2bb5bf.tar.gz
chromium_src-cfb3ef9704a1a189a3fc0f07b89ccdf68b2bb5bf.tar.bz2
Revert of IndexedDB: Don't timeout read-only transactions (https://codereview.chromium.org/180163010/)
Reason for revert: Break Chromium Memory on Linux ASan+LSan Tests (2) http://build.chromium.org/p/chromium.memory/builders/Linux%20ASan%2BLSan%20Tests%20%282%29/builds/65/steps/content_unittests/logs/NoTimeoutReadOnly Original issue's description: > IndexedDB: Don't timeout read-only transactions > > Chrome introduced a transaction timeout to deal with potentially wedged > renderers (e.g. JS execution halted, etc) failing to complete transactions, > leaving the browser's transaction queue in a bad state. This was done > for all transactions, but since read-only transactions don't hold up > the queue it's safe to ignore them, which can reduce false-positives. > > BUG=339229 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=254846 TBR=dgrogan@chromium.org,cmumford@chromium.org,jsbell@chromium.org NOTREECHECKS=true NOTRY=true BUG=339229 Review URL: https://codereview.chromium.org/185403019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254868 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/browser/indexed_db/indexed_db_transaction.cc13
-rw-r--r--content/browser/indexed_db/indexed_db_transaction_unittest.cc29
2 files changed, 6 insertions, 36 deletions
diff --git a/content/browser/indexed_db/indexed_db_transaction.cc b/content/browser/indexed_db/indexed_db_transaction.cc
index ff7ba2b..91a851f 100644
--- a/content/browser/indexed_db/indexed_db_transaction.cc
+++ b/content/browser/indexed_db/indexed_db_transaction.cc
@@ -318,14 +318,11 @@ void IndexedDBTransaction::ProcessTaskQueue() {
return;
// Otherwise, start a timer in case the front-end gets wedged and
- // never requests further activity. Read-only transactions don't
- // block other transactions, so don't time those out.
- if (mode_ != indexed_db::TRANSACTION_READ_ONLY) {
- timeout_timer_.Start(
- FROM_HERE,
- base::TimeDelta::FromSeconds(kInactivityTimeoutPeriodSeconds),
- base::Bind(&IndexedDBTransaction::Timeout, this));
- }
+ // never requests further activity.
+ timeout_timer_.Start(
+ FROM_HERE,
+ base::TimeDelta::FromSeconds(kInactivityTimeoutPeriodSeconds),
+ base::Bind(&IndexedDBTransaction::Timeout, this));
}
void IndexedDBTransaction::Timeout() {
diff --git a/content/browser/indexed_db/indexed_db_transaction_unittest.cc b/content/browser/indexed_db/indexed_db_transaction_unittest.cc
index 5ad1ff4..d0228bc 100644
--- a/content/browser/indexed_db/indexed_db_transaction_unittest.cc
+++ b/content/browser/indexed_db/indexed_db_transaction_unittest.cc
@@ -48,7 +48,7 @@ TEST_F(IndexedDBTransactionTest, Timeout) {
id,
new MockIndexedDBDatabaseCallbacks(),
scope,
- indexed_db::TRANSACTION_READ_WRITE,
+ indexed_db::TRANSACTION_READ_ONLY,
db_,
new IndexedDBFakeBackingStore::FakeTransaction(commit_success));
db_->TransactionCreated(transaction);
@@ -77,33 +77,6 @@ TEST_F(IndexedDBTransactionTest, Timeout) {
EXPECT_FALSE(transaction->IsTimeoutTimerRunning());
}
-TEST_F(IndexedDBTransactionTest, NoTimeoutReadOnly) {
- const int64 id = 0;
- const std::set<int64> scope;
- const bool commit_success = true;
- scoped_refptr<IndexedDBTransaction> transaction = new IndexedDBTransaction(
- id,
- new MockIndexedDBDatabaseCallbacks(),
- scope,
- indexed_db::TRANSACTION_READ_ONLY,
- db_,
- new IndexedDBFakeBackingStore::FakeTransaction(commit_success));
- db_->TransactionCreated(transaction);
-
- // No conflicting transactions, so coordinator will start it immediately:
- EXPECT_EQ(IndexedDBTransaction::STARTED, transaction->state());
- EXPECT_FALSE(transaction->IsTimeoutTimerRunning());
-
- // Schedule a task - timer won't be started until it's processed.
- transaction->ScheduleTask(base::Bind(
- &IndexedDBTransactionTest::DummyOperation, base::Unretained(this)));
- EXPECT_FALSE(transaction->IsTimeoutTimerRunning());
-
- // Transaction is read-only, so no need to time it out
- RunPostedTasks();
- EXPECT_FALSE(transaction->IsTimeoutTimerRunning());
-}
-
class AbortObserver {
public:
AbortObserver() : abort_task_called_(false) {}