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/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 | 805 |
806 // sqlite3_finalize() returns SQLITE_OK if the most recent sqlite3_step() | 806 // sqlite3_finalize() returns SQLITE_OK if the most recent sqlite3_step() |
807 // returned SQLITE_DONE or SQLITE_ROW, otherwise the error code. | 807 // returned SQLITE_DONE or SQLITE_ROW, otherwise the error code. |
808 rc = sqlite3_finalize(stmt); | 808 rc = sqlite3_finalize(stmt); |
809 if (rc == SQLITE_OK) | 809 if (rc == SQLITE_OK) |
810 RecordOneEvent(Connection::EVENT_STATEMENT_SUCCESS); | 810 RecordOneEvent(Connection::EVENT_STATEMENT_SUCCESS); |
811 | 811 |
812 // sqlite3_exec() does this, presumably to avoid spinning the parser for | 812 // sqlite3_exec() does this, presumably to avoid spinning the parser for |
813 // trailing whitespace. | 813 // trailing whitespace. |
814 // TODO(shess): Audit to see if this can become a DCHECK. | 814 // TODO(shess): Audit to see if this can become a DCHECK. |
815 while (IsAsciiWhitespace(*sql)) { | 815 while (base::IsAsciiWhitespace(*sql)) { |
816 sql++; | 816 sql++; |
817 } | 817 } |
818 | 818 |
819 const base::TimeDelta delta = Now() - before; | 819 const base::TimeDelta delta = Now() - before; |
820 RecordTimeAndChanges(delta, read_only); | 820 RecordTimeAndChanges(delta, read_only); |
821 } | 821 } |
822 return rc; | 822 return rc; |
823 } | 823 } |
824 | 824 |
825 bool Connection::Execute(const char* sql) { | 825 bool Connection::Execute(const char* sql) { |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1336 ignore_result(Execute(kNoWritableSchema)); | 1336 ignore_result(Execute(kNoWritableSchema)); |
1337 | 1337 |
1338 return ret; | 1338 return ret; |
1339 } | 1339 } |
1340 | 1340 |
1341 base::TimeTicks TimeSource::Now() { | 1341 base::TimeTicks TimeSource::Now() { |
1342 return base::TimeTicks::Now(); | 1342 return base::TimeTicks::Now(); |
1343 } | 1343 } |
1344 | 1344 |
1345 } // namespace sql | 1345 } // namespace sql |
OLD | NEW |