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

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

Issue 742033002: IDB: Make readonly transactions wait for earlier readwrite transactions (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
« no previous file with comments | « no previous file | 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) 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_transaction_coordinator.h" 5 #include "content/browser/indexed_db/indexed_db_transaction_coordinator.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "content/browser/indexed_db/indexed_db_transaction.h" 9 #include "content/browser/indexed_db/indexed_db_transaction.h"
10 #include "third_party/WebKit/public/platform/WebIDBTypes.h" 10 #include "third_party/WebKit/public/platform/WebIDBTypes.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 const std::set<int64>& locked_scope) const { 139 const std::set<int64>& locked_scope) const {
140 DCHECK(queued_transactions_.count(transaction)); 140 DCHECK(queued_transactions_.count(transaction));
141 switch (transaction->mode()) { 141 switch (transaction->mode()) {
142 case blink::WebIDBTransactionModeVersionChange: 142 case blink::WebIDBTransactionModeVersionChange:
143 DCHECK_EQ(1u, queued_transactions_.size()); 143 DCHECK_EQ(1u, queued_transactions_.size());
144 DCHECK(started_transactions_.empty()); 144 DCHECK(started_transactions_.empty());
145 DCHECK(locked_scope.empty()); 145 DCHECK(locked_scope.empty());
146 return true; 146 return true;
147 147
148 case blink::WebIDBTransactionModeReadOnly: 148 case blink::WebIDBTransactionModeReadOnly:
149 return true;
150
151 case blink::WebIDBTransactionModeReadWrite: 149 case blink::WebIDBTransactionModeReadWrite:
152 return !DoSetsIntersect(transaction->scope(), locked_scope); 150 return !DoSetsIntersect(transaction->scope(), locked_scope);
153 } 151 }
154 NOTREACHED(); 152 NOTREACHED();
155 return false; 153 return false;
156 } 154 }
157 155
158 } // namespace content 156 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698