| 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 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1138 // Mark the outermost transaction as needing rollback. | 1138 // Mark the outermost transaction as needing rollback. |
| 1139 needs_rollback_ = true; | 1139 needs_rollback_ = true; |
| 1140 return; | 1140 return; |
| 1141 } | 1141 } |
| 1142 | 1142 |
| 1143 DoRollback(); | 1143 DoRollback(); |
| 1144 } | 1144 } |
| 1145 | 1145 |
| 1146 bool Connection::CommitTransaction() { | 1146 bool Connection::CommitTransaction() { |
| 1147 if (!transaction_nesting_) { | 1147 if (!transaction_nesting_) { |
| 1148 DLOG_IF(FATAL, !poisoned_) << "Committing back a nonexistent transaction"; | 1148 DLOG_IF(FATAL, !poisoned_) << "Committing a nonexistent transaction"; |
| 1149 return false; | 1149 return false; |
| 1150 } | 1150 } |
| 1151 transaction_nesting_--; | 1151 transaction_nesting_--; |
| 1152 | 1152 |
| 1153 if (transaction_nesting_ > 0) { | 1153 if (transaction_nesting_ > 0) { |
| 1154 // Mark any nested transactions as failing after we've already got one. | 1154 // Mark any nested transactions as failing after we've already got one. |
| 1155 return !needs_rollback_; | 1155 return !needs_rollback_; |
| 1156 } | 1156 } |
| 1157 | 1157 |
| 1158 if (needs_rollback_) { | 1158 if (needs_rollback_) { |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1830 ignore_result(Execute(kNoWritableSchema)); | 1830 ignore_result(Execute(kNoWritableSchema)); |
| 1831 | 1831 |
| 1832 return ret; | 1832 return ret; |
| 1833 } | 1833 } |
| 1834 | 1834 |
| 1835 base::TimeTicks TimeSource::Now() { | 1835 base::TimeTicks TimeSource::Now() { |
| 1836 return base::TimeTicks::Now(); | 1836 return base::TimeTicks::Now(); |
| 1837 } | 1837 } |
| 1838 | 1838 |
| 1839 } // namespace sql | 1839 } // namespace sql |
| OLD | NEW |