| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |