| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "app/sql/transaction.h" | 5 #include "sql/transaction.h" |
| 6 | 6 |
| 7 #include "app/sql/connection.h" | |
| 8 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "sql/connection.h" |
| 9 | 9 |
| 10 namespace sql { | 10 namespace sql { |
| 11 | 11 |
| 12 Transaction::Transaction(Connection* connection) | 12 Transaction::Transaction(Connection* connection) |
| 13 : connection_(connection), | 13 : connection_(connection), |
| 14 is_open_(false) { | 14 is_open_(false) { |
| 15 } | 15 } |
| 16 | 16 |
| 17 Transaction::~Transaction() { | 17 Transaction::~Transaction() { |
| 18 if (is_open_) | 18 if (is_open_) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 42 if (!is_open_) { | 42 if (!is_open_) { |
| 43 NOTREACHED() << "Attempting to commit a nonexistent transaction. " | 43 NOTREACHED() << "Attempting to commit a nonexistent transaction. " |
| 44 << "Did you remember to call Begin() and check its return?"; | 44 << "Did you remember to call Begin() and check its return?"; |
| 45 return false; | 45 return false; |
| 46 } | 46 } |
| 47 is_open_ = false; | 47 is_open_ = false; |
| 48 return connection_->CommitTransaction(); | 48 return connection_->CommitTransaction(); |
| 49 } | 49 } |
| 50 | 50 |
| 51 } // namespace sql | 51 } // namespace sql |
| OLD | NEW |