| OLD | NEW |
| 1 // Copyright (c) 2011 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/connection.h" | 5 #include "sql/connection.h" |
| 6 | 6 |
| 7 #include <string.h> | 7 #include <string.h> |
| 8 | 8 |
| 9 #include "app/sql/statement.h" | |
| 10 #include "base/file_path.h" | 9 #include "base/file_path.h" |
| 11 #include "base/logging.h" | 10 #include "base/logging.h" |
| 11 #include "base/string_util.h" |
| 12 #include "base/stringprintf.h" | 12 #include "base/stringprintf.h" |
| 13 #include "base/string_util.h" | |
| 14 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "sql/statement.h" |
| 15 #include "third_party/sqlite/sqlite3.h" | 15 #include "third_party/sqlite/sqlite3.h" |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 // Spin for up to a second waiting for the lock to clear when setting | 19 // Spin for up to a second waiting for the lock to clear when setting |
| 20 // up the database. | 20 // up the database. |
| 21 // TODO(shess): Better story on this. http://crbug.com/56559 | 21 // TODO(shess): Better story on this. http://crbug.com/56559 |
| 22 const base::TimeDelta kBusyTimeout = base::TimeDelta::FromSeconds(1); | 22 const base::TimeDelta kBusyTimeout = base::TimeDelta::FromSeconds(1); |
| 23 | 23 |
| 24 class ScopedBusyTimeout { | 24 class ScopedBusyTimeout { |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 | 411 |
| 412 int Connection::OnSqliteError(int err, sql::Statement *stmt) { | 412 int Connection::OnSqliteError(int err, sql::Statement *stmt) { |
| 413 if (error_delegate_.get()) | 413 if (error_delegate_.get()) |
| 414 return error_delegate_->OnError(err, this, stmt); | 414 return error_delegate_->OnError(err, this, stmt); |
| 415 // The default handling is to assert on debug and to ignore on release. | 415 // The default handling is to assert on debug and to ignore on release. |
| 416 NOTREACHED() << GetErrorMessage(); | 416 NOTREACHED() << GetErrorMessage(); |
| 417 return err; | 417 return err; |
| 418 } | 418 } |
| 419 | 419 |
| 420 } // namespace sql | 420 } // namespace sql |
| OLD | NEW |