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/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
13 #include "base/metrics/sparse_histogram.h" | 13 #include "base/metrics/sparse_histogram.h" |
14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
16 #include "base/strings/string_split.h" | 16 #include "base/strings/string_split.h" |
17 #include "base/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
18 #include "sql/statement.h" | 18 #include "sql/statement.h" |
19 #include "third_party/sqlite/sqlite3.h" | 19 #include "third_party/sqlite/sqlite3.h" |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 // Spin for up to a second waiting for the lock to clear when setting | 23 // Spin for up to a second waiting for the lock to clear when setting |
24 // up the database. | 24 // up the database. |
25 // TODO(shess): Better story on this. http://crbug.com/56559 | 25 // TODO(shess): Better story on this. http://crbug.com/56559 |
26 const int kBusyTimeoutSeconds = 1; | 26 const int kBusyTimeoutSeconds = 1; |
27 | 27 |
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
779 // as a single string. This doesn't appear to be an API contract, | 779 // as a single string. This doesn't appear to be an API contract, |
780 // it could return separate lines, so loop _and_ split. | 780 // it could return separate lines, so loop _and_ split. |
781 while (stmt.Step()) { | 781 while (stmt.Step()) { |
782 std::string result(stmt.ColumnString(0)); | 782 std::string result(stmt.ColumnString(0)); |
783 base::SplitString(result, '\n', messages); | 783 base::SplitString(result, '\n', messages); |
784 } | 784 } |
785 return stmt.Succeeded(); | 785 return stmt.Succeeded(); |
786 } | 786 } |
787 | 787 |
788 } // namespace sql | 788 } // namespace sql |
OLD | NEW |