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

Side by Side Diff: sql/connection.cc

Issue 1419573008: [sql] QuotaDatabase schema upgrade doesn't use transactions right. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 | storage/browser/quota/quota_database.h » ('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) 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 "sql/connection.h" 5 #include "sql/connection.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/debug/dump_without_crashing.h" 10 #include "base/debug/dump_without_crashing.h"
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
1132 // Mark the outermost transaction as needing rollback. 1132 // Mark the outermost transaction as needing rollback.
1133 needs_rollback_ = true; 1133 needs_rollback_ = true;
1134 return; 1134 return;
1135 } 1135 }
1136 1136
1137 DoRollback(); 1137 DoRollback();
1138 } 1138 }
1139 1139
1140 bool Connection::CommitTransaction() { 1140 bool Connection::CommitTransaction() {
1141 if (!transaction_nesting_) { 1141 if (!transaction_nesting_) {
1142 DLOG_IF(FATAL, !poisoned_) << "Rolling back a nonexistent transaction"; 1142 DLOG_IF(FATAL, !poisoned_) << "Committing back a nonexistent transaction";
1143 return false; 1143 return false;
1144 } 1144 }
1145 transaction_nesting_--; 1145 transaction_nesting_--;
1146 1146
1147 if (transaction_nesting_ > 0) { 1147 if (transaction_nesting_ > 0) {
1148 // Mark any nested transactions as failing after we've already got one. 1148 // Mark any nested transactions as failing after we've already got one.
1149 return !needs_rollback_; 1149 return !needs_rollback_;
1150 } 1150 }
1151 1151
1152 if (needs_rollback_) { 1152 if (needs_rollback_) {
(...skipping 647 matching lines...) Expand 10 before | Expand all | Expand 10 after
1800 ignore_result(Execute(kNoWritableSchema)); 1800 ignore_result(Execute(kNoWritableSchema));
1801 1801
1802 return ret; 1802 return ret;
1803 } 1803 }
1804 1804
1805 base::TimeTicks TimeSource::Now() { 1805 base::TimeTicks TimeSource::Now() {
1806 return base::TimeTicks::Now(); 1806 return base::TimeTicks::Now();
1807 } 1807 }
1808 1808
1809 } // namespace sql 1809 } // namespace sql
OLDNEW
« no previous file with comments | « no previous file | storage/browser/quota/quota_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698