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 "app/sql/connection.h" |
6 | 6 |
7 #include <string.h> | 7 #include <string.h> |
8 | 8 |
9 #include "app/sql/statement.h" | 9 #include "app/sql/statement.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/stringprintf.h" |
12 #include "base/string_util.h" | 13 #include "base/string_util.h" |
13 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
14 #include "third_party/sqlite/sqlite3.h" | 15 #include "third_party/sqlite/sqlite3.h" |
15 | 16 |
16 namespace { | 17 namespace { |
17 | 18 |
18 // 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 |
19 // up the database. | 20 // up the database. |
20 // TODO(shess): Better story on this. http://crbug.com/56559 | 21 // TODO(shess): Better story on this. http://crbug.com/56559 |
21 const base::TimeDelta kBusyTimeout = base::TimeDelta::FromSeconds(1); | 22 const base::TimeDelta kBusyTimeout = base::TimeDelta::FromSeconds(1); |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
410 | 411 |
411 int Connection::OnSqliteError(int err, sql::Statement *stmt) { | 412 int Connection::OnSqliteError(int err, sql::Statement *stmt) { |
412 if (error_delegate_.get()) | 413 if (error_delegate_.get()) |
413 return error_delegate_->OnError(err, this, stmt); | 414 return error_delegate_->OnError(err, this, stmt); |
414 // 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. |
415 NOTREACHED() << GetErrorMessage(); | 416 NOTREACHED() << GetErrorMessage(); |
416 return err; | 417 return err; |
417 } | 418 } |
418 | 419 |
419 } // namespace sql | 420 } // namespace sql |
OLD | NEW |