Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(304)

Side by Side Diff: sql/recovery.h

Issue 2728223002: Fix function name in toplevel doc for recovery.h. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_RECOVERY_H_ 5 #ifndef SQL_RECOVERY_H_
6 #define SQL_RECOVERY_H_ 6 #define SQL_RECOVERY_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "sql/connection.h" 13 #include "sql/connection.h"
14 14
15 namespace base { 15 namespace base {
16 class FilePath; 16 class FilePath;
17 } 17 }
18 18
19 namespace sql { 19 namespace sql {
20 20
21 // Recovery module for sql/. The basic idea is to create a fresh database and 21 // Recovery module for sql/. The basic idea is to create a fresh database and
22 // populate it with the recovered contents of the original database. If 22 // populate it with the recovered contents of the original database. If
23 // recovery is successful, the recovered database is backed up over the original 23 // recovery is successful, the recovered database is backed up over the original
24 // database. If recovery is not successful, the original database is razed. In 24 // database. If recovery is not successful, the original database is razed. In
25 // either case, the original handle is poisoned so that operations on the stack 25 // either case, the original handle is poisoned so that operations on the stack
26 // do not accidentally disrupt the restored data. 26 // do not accidentally disrupt the restored data.
27 // 27 //
28 // RecoverDatabaseOrRaze() automates this, including recoverying the schema of 28 // RecoverDatabase() automates this, including recoverying the schema of from
29 // from the suspect database. If a database requires special handling, such as 29 // the suspect database. If a database requires special handling, such as
30 // recovering between different schema, or tables requiring post-processing, 30 // recovering between different schema, or tables requiring post-processing,
31 // then the module can be used manually like: 31 // then the module can be used manually like:
32 // 32 //
33 // { 33 // {
34 // std::unique_ptr<sql::Recovery> r = 34 // std::unique_ptr<sql::Recovery> r =
35 // sql::Recovery::Begin(orig_db, orig_db_path); 35 // sql::Recovery::Begin(orig_db, orig_db_path);
36 // if (r) { 36 // if (r) {
37 // // Create the schema to recover to. On failure, clear the 37 // // Create the schema to recover to. On failure, clear the
38 // // database. 38 // // database.
39 // if (!r.db()->Execute(kCreateSchemaSql)) { 39 // if (!r.db()->Execute(kCreateSchemaSql)) {
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 Connection* db_; // Original database connection. 195 Connection* db_; // Original database connection.
196 Connection recover_db_; // Recovery connection. 196 Connection recover_db_; // Recovery connection.
197 197
198 DISALLOW_COPY_AND_ASSIGN(Recovery); 198 DISALLOW_COPY_AND_ASSIGN(Recovery);
199 }; 199 };
200 200
201 } // namespace sql 201 } // namespace sql
202 202
203 #endif // SQL_RECOVERY_H_ 203 #endif // SQL_RECOVERY_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698