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

Unified Diff: Source/modules/webdatabase/SQLStatement.cpp

Issue 103473002: Manage WebSQL callbacks with OwnPtr instead of refcounting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years 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
Index: Source/modules/webdatabase/SQLStatement.cpp
diff --git a/Source/modules/webdatabase/SQLStatement.cpp b/Source/modules/webdatabase/SQLStatement.cpp
index e94e70ed6b224f7ceb40975cd2e8fa6665746dff..0d77191d5ffaf08c224c94ff08494288d530e217 100644
--- a/Source/modules/webdatabase/SQLStatement.cpp
+++ b/Source/modules/webdatabase/SQLStatement.cpp
@@ -43,13 +43,13 @@
namespace WebCore {
PassOwnPtr<SQLStatement> SQLStatement::create(Database* database,
- PassRefPtr<SQLStatementCallback> callback, PassRefPtr<SQLStatementErrorCallback> errorCallback)
+ PassOwnPtr<SQLStatementCallback> callback, PassOwnPtr<SQLStatementErrorCallback> errorCallback)
{
return adoptPtr(new SQLStatement(database, callback, errorCallback));
}
-SQLStatement::SQLStatement(Database* database, PassRefPtr<SQLStatementCallback> callback,
- PassRefPtr<SQLStatementErrorCallback> errorCallback)
+SQLStatement::SQLStatement(Database* database, PassOwnPtr<SQLStatementCallback> callback,
+ PassOwnPtr<SQLStatementErrorCallback> errorCallback)
: m_statementCallbackWrapper(callback, database->executionContext())
, m_statementErrorCallbackWrapper(errorCallback, database->executionContext())
{
@@ -77,8 +77,8 @@ bool SQLStatement::performCallback(SQLTransaction* transaction)
bool callbackError = false;
- RefPtr<SQLStatementCallback> callback = m_statementCallbackWrapper.unwrap();
- RefPtr<SQLStatementErrorCallback> errorCallback = m_statementErrorCallbackWrapper.unwrap();
+ OwnPtr<SQLStatementCallback> callback = m_statementCallbackWrapper.unwrap();
+ OwnPtr<SQLStatementErrorCallback> errorCallback = m_statementErrorCallbackWrapper.unwrap();
RefPtr<SQLError> error = m_backend->sqlError();
// Call the appropriate statement callback and track if it resulted in an error,

Powered by Google App Engine
This is Rietveld 408576698