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" | |
15 #include "base/stringprintf.h" | |
16 #include "base/strings/string_split.h" | 14 #include "base/strings/string_split.h" |
| 15 #include "base/strings/string_util.h" |
| 16 #include "base/strings/stringprintf.h" |
17 #include "base/strings/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; |
(...skipping 776 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 } | 803 } |
804 | 804 |
805 // Best effort to put things back as they were before. | 805 // Best effort to put things back as they were before. |
806 const char kNoWritableSchema[] = "PRAGMA writable_schema = OFF"; | 806 const char kNoWritableSchema[] = "PRAGMA writable_schema = OFF"; |
807 ignore_result(Execute(kNoWritableSchema)); | 807 ignore_result(Execute(kNoWritableSchema)); |
808 | 808 |
809 return ret; | 809 return ret; |
810 } | 810 } |
811 | 811 |
812 } // namespace sql | 812 } // namespace sql |
OLD | NEW |