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> |
(...skipping 10 matching lines...) Expand all Loading... |
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/sql_export.h" | 23 #include "sql/sql_export.h" |
24 | 24 |
25 struct sqlite3; | 25 struct sqlite3; |
26 struct sqlite3_stmt; | 26 struct sqlite3_stmt; |
27 | 27 |
28 namespace base { | 28 namespace base { |
29 class FilePath; | 29 class FilePath; |
30 class HistogramBase; | 30 class HistogramBase; |
| 31 namespace trace_event { |
| 32 class MemoryAllocatorDump; |
| 33 } |
31 } | 34 } |
32 | 35 |
33 namespace sql { | 36 namespace sql { |
34 | 37 |
35 class ConnectionMemoryDumpProvider; | 38 class ConnectionMemoryDumpProvider; |
36 class Recovery; | 39 class Recovery; |
37 class Statement; | 40 class Statement; |
38 | 41 |
39 // To allow some test classes to be friended. | 42 // To allow some test classes to be friended. |
40 namespace test { | 43 namespace test { |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 | 247 |
245 // Runs "PRAGMA quick_check" and, unlike the FullIntegrityCheck method, | 248 // Runs "PRAGMA quick_check" and, unlike the FullIntegrityCheck method, |
246 // interprets the results returning true if the the statement executes | 249 // interprets the results returning true if the the statement executes |
247 // without error and results in a single "ok" value. | 250 // without error and results in a single "ok" value. |
248 bool QuickIntegrityCheck() WARN_UNUSED_RESULT; | 251 bool QuickIntegrityCheck() WARN_UNUSED_RESULT; |
249 | 252 |
250 // Meant to be called from a client error callback so that it's able to | 253 // Meant to be called from a client error callback so that it's able to |
251 // get diagnostic information about the database. | 254 // get diagnostic information about the database. |
252 std::string GetDiagnosticInfo(int extended_error, Statement* statement); | 255 std::string GetDiagnosticInfo(int extended_error, Statement* statement); |
253 | 256 |
| 257 // Reports memory usage into provided memory dump. |
| 258 bool ReportMemoryUsage(base::trace_event::MemoryAllocatorDump* mad); |
| 259 |
254 // Initialization ------------------------------------------------------------ | 260 // Initialization ------------------------------------------------------------ |
255 | 261 |
256 // Initializes the SQL connection for the given file, returning true if the | 262 // Initializes the SQL connection for the given file, returning true if the |
257 // file could be opened. You can call this or OpenInMemory. | 263 // file could be opened. You can call this or OpenInMemory. |
258 bool Open(const base::FilePath& path) WARN_UNUSED_RESULT; | 264 bool Open(const base::FilePath& path) WARN_UNUSED_RESULT; |
259 | 265 |
260 // Initializes the SQL connection for a temporary in-memory database. There | 266 // Initializes the SQL connection for a temporary in-memory database. There |
261 // will be no associated file on disk, and the initial database will be | 267 // will be no associated file on disk, and the initial database will be |
262 // empty. You can call this or Open. | 268 // empty. You can call this or Open. |
263 bool OpenInMemory() WARN_UNUSED_RESULT; | 269 bool OpenInMemory() WARN_UNUSED_RESULT; |
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 | 824 |
819 // Stores the dump provider object when db is open. | 825 // Stores the dump provider object when db is open. |
820 std::unique_ptr<ConnectionMemoryDumpProvider> memory_dump_provider_; | 826 std::unique_ptr<ConnectionMemoryDumpProvider> memory_dump_provider_; |
821 | 827 |
822 DISALLOW_COPY_AND_ASSIGN(Connection); | 828 DISALLOW_COPY_AND_ASSIGN(Connection); |
823 }; | 829 }; |
824 | 830 |
825 } // namespace sql | 831 } // namespace sql |
826 | 832 |
827 #endif // SQL_CONNECTION_H_ | 833 #endif // SQL_CONNECTION_H_ |
OLD | NEW |