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 #ifndef SQL_CONNECTION_H_ | 5 #ifndef SQL_CONNECTION_H_ |
6 #define SQL_CONNECTION_H_ | 6 #define SQL_CONNECTION_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
12 #include <set> | 12 #include <set> |
13 #include <string> | 13 #include <string> |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "base/callback.h" | 16 #include "base/callback.h" |
17 #include "base/compiler_specific.h" | 17 #include "base/compiler_specific.h" |
18 #include "base/gtest_prod_util.h" | 18 #include "base/gtest_prod_util.h" |
19 #include "base/macros.h" | 19 #include "base/macros.h" |
20 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
21 #include "base/threading/thread_restrictions.h" | 21 #include "base/threading/thread_restrictions.h" |
22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
23 #include "sql/db_diagnostic_map.h" | |
michaeln
2016/07/09 03:00:38
probably overkill to add a new file for using a st
Scott Hess - ex-Googler
2016/07/10 05:16:52
Honestly, I'm not sure I see why this is in sql/ o
afakhry
2016/07/11 16:47:46
The reasons behind my decision to put it there wer
Scott Hess - ex-Googler
2016/07/13 01:18:46
sql/init_status.h is also really client code which
afakhry
2016/07/13 19:57:59
Nothing other than the reason I stated above. I'm
| |
23 #include "sql/sql_export.h" | 24 #include "sql/sql_export.h" |
24 | 25 |
25 struct sqlite3; | 26 struct sqlite3; |
26 struct sqlite3_stmt; | 27 struct sqlite3_stmt; |
27 | 28 |
28 namespace base { | 29 namespace base { |
29 class FilePath; | 30 class FilePath; |
30 class HistogramBase; | 31 class HistogramBase; |
31 } | 32 } |
32 | 33 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
232 // results into |messages|. Returns the success of running the | 233 // results into |messages|. Returns the success of running the |
233 // statement - per the SQLite documentation, if no errors are found the | 234 // statement - per the SQLite documentation, if no errors are found the |
234 // call should succeed, and a single value "ok" should be in messages. | 235 // call should succeed, and a single value "ok" should be in messages. |
235 bool FullIntegrityCheck(std::vector<std::string>* messages); | 236 bool FullIntegrityCheck(std::vector<std::string>* messages); |
236 | 237 |
237 // Runs "PRAGMA quick_check" and, unlike the FullIntegrityCheck method, | 238 // Runs "PRAGMA quick_check" and, unlike the FullIntegrityCheck method, |
238 // interprets the results returning true if the the statement executes | 239 // interprets the results returning true if the the statement executes |
239 // without error and results in a single "ok" value. | 240 // without error and results in a single "ok" value. |
240 bool QuickIntegrityCheck() WARN_UNUSED_RESULT; | 241 bool QuickIntegrityCheck() WARN_UNUSED_RESULT; |
241 | 242 |
243 sql::DatabaseDiagnosticMap GetDiagnosticMap(); | |
244 | |
242 // Initialization ------------------------------------------------------------ | 245 // Initialization ------------------------------------------------------------ |
243 | 246 |
244 // Initializes the SQL connection for the given file, returning true if the | 247 // Initializes the SQL connection for the given file, returning true if the |
245 // file could be opened. You can call this or OpenInMemory. | 248 // file could be opened. You can call this or OpenInMemory. |
246 bool Open(const base::FilePath& path) WARN_UNUSED_RESULT; | 249 bool Open(const base::FilePath& path) WARN_UNUSED_RESULT; |
247 | 250 |
248 // Initializes the SQL connection for a temporary in-memory database. There | 251 // Initializes the SQL connection for a temporary in-memory database. There |
249 // will be no associated file on disk, and the initial database will be | 252 // will be no associated file on disk, and the initial database will be |
250 // empty. You can call this or Open. | 253 // empty. You can call this or Open. |
251 bool OpenInMemory() WARN_UNUSED_RESULT; | 254 bool OpenInMemory() WARN_UNUSED_RESULT; |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
797 | 800 |
798 // Stores the dump provider object when db is open. | 801 // Stores the dump provider object when db is open. |
799 std::unique_ptr<ConnectionMemoryDumpProvider> memory_dump_provider_; | 802 std::unique_ptr<ConnectionMemoryDumpProvider> memory_dump_provider_; |
800 | 803 |
801 DISALLOW_COPY_AND_ASSIGN(Connection); | 804 DISALLOW_COPY_AND_ASSIGN(Connection); |
802 }; | 805 }; |
803 | 806 |
804 } // namespace sql | 807 } // namespace sql |
805 | 808 |
806 #endif // SQL_CONNECTION_H_ | 809 #endif // SQL_CONNECTION_H_ |
OLD | NEW |