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 <limits.h> | 7 #include <limits.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 DCHECK_EQ(pages, 1); | 109 DCHECK_EQ(pages, 1); |
110 | 110 |
111 return rc; | 111 return rc; |
112 } | 112 } |
113 | 113 |
114 // Be very strict on attachment point. SQLite can handle a much wider | 114 // Be very strict on attachment point. SQLite can handle a much wider |
115 // character set with appropriate quoting, but Chromium code should | 115 // character set with appropriate quoting, but Chromium code should |
116 // just use clean names to start with. | 116 // just use clean names to start with. |
117 bool ValidAttachmentPoint(const char* attachment_point) { | 117 bool ValidAttachmentPoint(const char* attachment_point) { |
118 for (size_t i = 0; attachment_point[i]; ++i) { | 118 for (size_t i = 0; attachment_point[i]; ++i) { |
119 if (!((attachment_point[i] >= '0' && attachment_point[i] <= '9') || | 119 if (!(base::IsAsciiDigit(attachment_point[i]) || |
120 (attachment_point[i] >= 'a' && attachment_point[i] <= 'z') || | 120 base::IsAsciiAlpha(attachment_point[i]) || |
121 (attachment_point[i] >= 'A' && attachment_point[i] <= 'Z') || | |
122 attachment_point[i] == '_')) { | 121 attachment_point[i] == '_')) { |
123 return false; | 122 return false; |
124 } | 123 } |
125 } | 124 } |
126 return true; | 125 return true; |
127 } | 126 } |
128 | 127 |
129 void RecordSqliteMemory10Min() { | 128 void RecordSqliteMemory10Min() { |
130 const int64_t used = sqlite3_memory_used(); | 129 const int64_t used = sqlite3_memory_used(); |
131 UMA_HISTOGRAM_COUNTS("Sqlite.MemoryKB.TenMinutes", used / 1024); | 130 UMA_HISTOGRAM_COUNTS("Sqlite.MemoryKB.TenMinutes", used / 1024); |
(...skipping 1850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1982 ignore_result(Execute(kNoWritableSchema)); | 1981 ignore_result(Execute(kNoWritableSchema)); |
1983 | 1982 |
1984 return ret; | 1983 return ret; |
1985 } | 1984 } |
1986 | 1985 |
1987 base::TimeTicks TimeSource::Now() { | 1986 base::TimeTicks TimeSource::Now() { |
1988 return base::TimeTicks::Now(); | 1987 return base::TimeTicks::Now(); |
1989 } | 1988 } |
1990 | 1989 |
1991 } // namespace sql | 1990 } // namespace sql |
OLD | NEW |