| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/webdata/common/web_database_backend.h" | 5 #include "components/webdata/common/web_database_backend.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 WebDatabaseBackend::~WebDatabaseBackend() { | 117 WebDatabaseBackend::~WebDatabaseBackend() { |
| 118 ShutdownDatabase(); | 118 ShutdownDatabase(); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void WebDatabaseBackend::DatabaseErrorCallback(int error, | 121 void WebDatabaseBackend::DatabaseErrorCallback(int error, |
| 122 sql::Statement* statement) { | 122 sql::Statement* statement) { |
| 123 // We ignore any further error callbacks after the first catastrophic error. | 123 // We ignore any further error callbacks after the first catastrophic error. |
| 124 if (!catastrophic_error_occurred_ && sql::IsErrorCatastrophic(error)) { | 124 if (!catastrophic_error_occurred_ && sql::IsErrorCatastrophic(error)) { |
| 125 catastrophic_error_occurred_ = true; | 125 catastrophic_error_occurred_ = true; |
| 126 diagnostics_ = db_->GetDiagnosticInfo(error, statement); | 126 diagnostics_ = db_->GetDiagnosticInfo(error, statement); |
| 127 |
| 128 db_->GetSQLConnection()->RazeAndClose(); |
| 127 } | 129 } |
| 128 } | 130 } |
| 129 | 131 |
| 130 void WebDatabaseBackend::Commit() { | 132 void WebDatabaseBackend::Commit() { |
| 131 DCHECK(db_); | 133 DCHECK(db_); |
| 132 DCHECK_EQ(sql::INIT_OK, init_status_); | 134 DCHECK_EQ(sql::INIT_OK, init_status_); |
| 133 db_->CommitTransaction(); | 135 db_->CommitTransaction(); |
| 134 db_->BeginTransaction(); | 136 db_->BeginTransaction(); |
| 135 } | 137 } |
| OLD | NEW |