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

Unified Diff: app/sql/connection.h

Issue 360042: First patch in making destructors of refcounted objects private. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « app/gfx/font.h ('k') | base/directory_watcher.h » ('j') | base/field_trial.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: app/sql/connection.h
===================================================================
--- app/sql/connection.h (revision 30973)
+++ app/sql/connection.h (working copy)
@@ -76,7 +76,6 @@
// corruption, low-level IO errors or locking violations.
class ErrorDelegate : public base::RefCounted<ErrorDelegate> {
public:
- virtual ~ErrorDelegate() {}
// |error| is an sqlite result code as seen in sqlite\preprocessed\sqlite3.h
// |connection| is db connection where the error happened and |stmt| is
// our best guess at the statement that triggered the error. Do not store
@@ -89,6 +88,11 @@
// re-tried then returning SQLITE_OK is appropiate; otherwise is recomended
// that you return the original |error| or the appropiae error code.
virtual int OnError(int error, Connection* connection, Statement* stmt) = 0;
+
+ protected:
+ friend class base::RefCounted<ErrorDelegate>;
+
+ virtual ~ErrorDelegate() {}
};
class Connection {
@@ -286,7 +290,6 @@
// Default constructor initializes to an invalid statement.
StatementRef();
StatementRef(Connection* connection, sqlite3_stmt* stmt);
- ~StatementRef();
// When true, the statement can be used.
bool is_valid() const { return !!stmt_; }
@@ -304,6 +307,10 @@
void Close();
private:
+ friend class base::RefCounted<StatementRef>;
+
+ ~StatementRef();
+
Connection* connection_;
sqlite3_stmt* stmt_;
« no previous file with comments | « app/gfx/font.h ('k') | base/directory_watcher.h » ('j') | base/field_trial.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698