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

Side by Side Diff: sql/scoped_attach.h

Issue 18180013: Scoped recovery module for sql/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Oops, add recover_unittest.cc Created 7 years, 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef SQL_SCOPED_ATTACH_H_
6 #define SQL_SCOPED_ATTACH_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "sql/sql_export.h"
12
13 namespace base {
14 class FilePath;
15 }
16
17 namespace sql {
18
19 // Helper to automatically detach attached database when things go out
20 // of scope.
21
22 class Connection;
23
24 // TODO(shess): Make the attach/detach code part of sql::Connection,
25 // and the scoper simply calls that.
26 // TODO(shess): Break transactions on detach?
27 class SQL_EXPORT ScopedAttach {
28 public:
29 explicit ScopedAttach(Connection* connection);
30 ~ScopedAttach();
31
32 bool Attach(const base::FilePath& other_db_path,
33 const char* attach_as);
34 void Detach();
35
36 private:
37 Connection* db_;
38 std::string attached_as_;
39
40 DISALLOW_COPY_AND_ASSIGN(ScopedAttach);
41 };
42
43 } // namespace sql
44
45 #endif // SQL_SCOPED_ATTACH_H_
OLDNEW
« sql/recovery.h ('K') | « sql/recovery.cc ('k') | sql/scoped_attach.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698