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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
147 | 147 |
148 // Record a sparse UMA histogram sample under | 148 // Record a sparse UMA histogram sample under |
149 // |name|+"."+|histogram_tag_|. If |histogram_tag_| is empty, no | 149 // |name|+"."+|histogram_tag_|. If |histogram_tag_| is empty, no |
150 // histogram is recorded. | 150 // histogram is recorded. |
151 void AddTaggedHistogram(const std::string& name, size_t sample) const; | 151 void AddTaggedHistogram(const std::string& name, size_t sample) const; |
152 | 152 |
153 // Run "PRAGMA integrity_check" and post each line of results into | 153 // Run "PRAGMA integrity_check" and post each line of results into |
154 // |messages|. Returns the success of running the statement - per | 154 // |messages|. Returns the success of running the statement - per |
155 // the SQLite documentation, if no errors are found the call should | 155 // the SQLite documentation, if no errors are found the call should |
156 // succeed, and a single value "ok" should be in messages. | 156 // succeed, and a single value "ok" should be in messages. |
157 bool IntegrityCheck(std::vector<std::string>* messages); | 157 bool FullIntegrityCheck(std::vector<std::string>* messages) { |
158 return IntegrityCheck(messages, false); | |
159 } | |
160 bool QuickIntegrityCheck(std::vector<std::string>* messages) { | |
161 return IntegrityCheck(messages, true); | |
162 } | |
163 bool IntegrityCheck(std::vector<std::string>* messages, bool quick); | |
Scott Hess - ex-Googler
2013/12/06 00:44:00
Move IntegrityCheck() to private, maybe call it "I
| |
158 | 164 |
159 // Initialization ------------------------------------------------------------ | 165 // Initialization ------------------------------------------------------------ |
160 | 166 |
161 // Initializes the SQL connection for the given file, returning true if the | 167 // Initializes the SQL connection for the given file, returning true if the |
162 // file could be opened. You can call this or OpenInMemory. | 168 // file could be opened. You can call this or OpenInMemory. |
163 bool Open(const base::FilePath& path) WARN_UNUSED_RESULT; | 169 bool Open(const base::FilePath& path) WARN_UNUSED_RESULT; |
164 | 170 |
165 // Initializes the SQL connection for a temporary in-memory database. There | 171 // Initializes the SQL connection for a temporary in-memory database. There |
166 // will be no associated file on disk, and the initial database will be | 172 // will be no associated file on disk, and the initial database will be |
167 // empty. You can call this or Open. | 173 // empty. You can call this or Open. |
(...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
585 | 591 |
586 // Tag for auxiliary histograms. | 592 // Tag for auxiliary histograms. |
587 std::string histogram_tag_; | 593 std::string histogram_tag_; |
588 | 594 |
589 DISALLOW_COPY_AND_ASSIGN(Connection); | 595 DISALLOW_COPY_AND_ASSIGN(Connection); |
590 }; | 596 }; |
591 | 597 |
592 } // namespace sql | 598 } // namespace sql |
593 | 599 |
594 #endif // SQL_CONNECTION_H_ | 600 #endif // SQL_CONNECTION_H_ |
OLD | NEW |