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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 | 239 |
237 // Runs "PRAGMA quick_check" and, unlike the FullIntegrityCheck method, | 240 // Runs "PRAGMA quick_check" and, unlike the FullIntegrityCheck method, |
238 // interprets the results returning true if the the statement executes | 241 // interprets the results returning true if the the statement executes |
239 // without error and results in a single "ok" value. | 242 // without error and results in a single "ok" value. |
240 bool QuickIntegrityCheck() WARN_UNUSED_RESULT; | 243 bool QuickIntegrityCheck() WARN_UNUSED_RESULT; |
241 | 244 |
242 // Meant to be called from a client error callback so that it's able to | 245 // Meant to be called from a client error callback so that it's able to |
243 // get diagnostic information about the database. | 246 // get diagnostic information about the database. |
244 std::string GetDiagnosticInfo(int extended_error, Statement* statement); | 247 std::string GetDiagnosticInfo(int extended_error, Statement* statement); |
245 | 248 |
| 249 bool ReportMemoryUsage(base::trace_event::MemoryAllocatorDump* mad); |
| 250 |
246 // Initialization ------------------------------------------------------------ | 251 // Initialization ------------------------------------------------------------ |
247 | 252 |
248 // Initializes the SQL connection for the given file, returning true if the | 253 // Initializes the SQL connection for the given file, returning true if the |
249 // file could be opened. You can call this or OpenInMemory. | 254 // file could be opened. You can call this or OpenInMemory. |
250 bool Open(const base::FilePath& path) WARN_UNUSED_RESULT; | 255 bool Open(const base::FilePath& path) WARN_UNUSED_RESULT; |
251 | 256 |
252 // Initializes the SQL connection for a temporary in-memory database. There | 257 // Initializes the SQL connection for a temporary in-memory database. There |
253 // will be no associated file on disk, and the initial database will be | 258 // will be no associated file on disk, and the initial database will be |
254 // empty. You can call this or Open. | 259 // empty. You can call this or Open. |
255 bool OpenInMemory() WARN_UNUSED_RESULT; | 260 bool OpenInMemory() WARN_UNUSED_RESULT; |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 | 806 |
802 // Stores the dump provider object when db is open. | 807 // Stores the dump provider object when db is open. |
803 std::unique_ptr<ConnectionMemoryDumpProvider> memory_dump_provider_; | 808 std::unique_ptr<ConnectionMemoryDumpProvider> memory_dump_provider_; |
804 | 809 |
805 DISALLOW_COPY_AND_ASSIGN(Connection); | 810 DISALLOW_COPY_AND_ASSIGN(Connection); |
806 }; | 811 }; |
807 | 812 |
808 } // namespace sql | 813 } // namespace sql |
809 | 814 |
810 #endif // SQL_CONNECTION_H_ | 815 #endif // SQL_CONNECTION_H_ |
OLD | NEW |