Title: [202676] trunk/Source/WebCore
Revision
202676
Author
gyuyoung....@webkit.org
Date
2016-06-30 01:14:35 -0700 (Thu, 30 Jun 2016)

Log Message

Purge PassRefPtr in Modules/webdatabase
https://bugs.webkit.org/show_bug.cgi?id=159255

Reviewed by Benjamin Poulain.

As a step to remove PassRefPtr use, this patch cleans it up in Modules/webdatabase.

Additionally unnecessary spaces and tabs are removed too.

* Modules/webdatabase/ChangeVersionWrapper.cpp:
* Modules/webdatabase/DOMWindowWebDatabase.h:
* Modules/webdatabase/Database.cpp:
(WebCore::Database::Database):
(WebCore::Database::~Database):
(WebCore::Database::scheduleTransaction):
(WebCore::Database::runTransaction):
* Modules/webdatabase/Database.h:
* Modules/webdatabase/DatabaseAuthorizer.cpp:
(WebCore::DatabaseAuthorizer::allowRead):
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::openDatabase):
(WebCore::DatabaseManager::fullPathForDatabase):
(WebCore::DatabaseManager::detailsForNameAndOrigin):
* Modules/webdatabase/DatabaseManager.h:
* Modules/webdatabase/DatabaseTask.cpp:
(WebCore::DatabaseTransactionTask::DatabaseTransactionTask):
* Modules/webdatabase/DatabaseTask.h:
* Modules/webdatabase/SQLCallbackWrapper.h:
(WebCore::SQLCallbackWrapper::SQLCallbackWrapper):
* Modules/webdatabase/SQLResultSetRowList.h:
* Modules/webdatabase/SQLStatement.cpp:
(WebCore::SQLStatement::SQLStatement):
(WebCore::SQLStatement::sqlError):
(WebCore::SQLStatement::sqlResultSet):
* Modules/webdatabase/SQLStatement.h:
* Modules/webdatabase/SQLTransaction.h:
* Modules/webdatabase/SQLTransactionBackend.cpp:
(WebCore::SQLTransactionBackend::create):
(WebCore::SQLTransactionBackend::SQLTransactionBackend):
(WebCore::SQLTransactionBackend::transactionError):
* Modules/webdatabase/SQLTransactionBackend.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (202675 => 202676)


--- trunk/Source/WebCore/ChangeLog	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/ChangeLog	2016-06-30 08:14:35 UTC (rev 202676)
@@ -1,3 +1,47 @@
+2016-06-30  Gyuyoung Kim  <gyuyoung....@webkit.org>
+
+        Purge PassRefPtr in Modules/webdatabase
+        https://bugs.webkit.org/show_bug.cgi?id=159255
+
+        Reviewed by Benjamin Poulain.
+
+        As a step to remove PassRefPtr use, this patch cleans it up in Modules/webdatabase.
+
+        Additionally unnecessary spaces and tabs are removed too.
+
+        * Modules/webdatabase/ChangeVersionWrapper.cpp:
+        * Modules/webdatabase/DOMWindowWebDatabase.h:
+        * Modules/webdatabase/Database.cpp:
+        (WebCore::Database::Database):
+        (WebCore::Database::~Database):
+        (WebCore::Database::scheduleTransaction):
+        (WebCore::Database::runTransaction):
+        * Modules/webdatabase/Database.h:
+        * Modules/webdatabase/DatabaseAuthorizer.cpp:
+        (WebCore::DatabaseAuthorizer::allowRead):
+        * Modules/webdatabase/DatabaseManager.cpp:
+        (WebCore::DatabaseManager::openDatabase):
+        (WebCore::DatabaseManager::fullPathForDatabase):
+        (WebCore::DatabaseManager::detailsForNameAndOrigin):
+        * Modules/webdatabase/DatabaseManager.h:
+        * Modules/webdatabase/DatabaseTask.cpp:
+        (WebCore::DatabaseTransactionTask::DatabaseTransactionTask):
+        * Modules/webdatabase/DatabaseTask.h:
+        * Modules/webdatabase/SQLCallbackWrapper.h:
+        (WebCore::SQLCallbackWrapper::SQLCallbackWrapper):
+        * Modules/webdatabase/SQLResultSetRowList.h:
+        * Modules/webdatabase/SQLStatement.cpp:
+        (WebCore::SQLStatement::SQLStatement):
+        (WebCore::SQLStatement::sqlError):
+        (WebCore::SQLStatement::sqlResultSet):
+        * Modules/webdatabase/SQLStatement.h:
+        * Modules/webdatabase/SQLTransaction.h:
+        * Modules/webdatabase/SQLTransactionBackend.cpp:
+        (WebCore::SQLTransactionBackend::create):
+        (WebCore::SQLTransactionBackend::SQLTransactionBackend):
+        (WebCore::SQLTransactionBackend::transactionError):
+        * Modules/webdatabase/SQLTransactionBackend.h:
+
 2016-06-30  Carlos Garcia Campos  <cgar...@igalia.com>
 
         [Coordinated Graphics] Move CompositingCoordinator from platform to WebKit2 layer

Modified: trunk/Source/WebCore/Modules/webdatabase/ChangeVersionWrapper.cpp (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/ChangeVersionWrapper.cpp	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/ChangeVersionWrapper.cpp	2016-06-30 08:14:35 UTC (rev 202676)
@@ -30,7 +30,6 @@
 
 #include "Database.h"
 #include "SQLError.h"
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 
 namespace WebCore {

Modified: trunk/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.h (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.h	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/DOMWindowWebDatabase.h	2016-06-30 08:14:35 UTC (rev 202676)
@@ -21,7 +21,7 @@
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #ifndef DOMWindowWebDatabase_h
@@ -28,7 +28,6 @@
 #define DOMWindowWebDatabase_h
 
 #include "ExceptionCode.h"
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 #include <wtf/text/WTFString.h>

Modified: trunk/Source/WebCore/Modules/webdatabase/Database.cpp (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/Database.cpp	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/Database.cpp	2016-06-30 08:14:35 UTC (rev 202676)
@@ -54,7 +54,6 @@
 #include "SecurityOrigin.h"
 #include "VoidCallback.h"
 #include <wtf/NeverDestroyed.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefPtr.h>
 #include <wtf/StdLibExtras.h>
 #include <wtf/text/CString.h>
@@ -203,9 +202,9 @@
     return guid;
 }
 
-Database::Database(PassRefPtr<DatabaseContext> databaseContext, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize)
+Database::Database(RefPtr<DatabaseContext>&& databaseContext, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize)
     : m_scriptExecutionContext(databaseContext->scriptExecutionContext())
-    , m_databaseContext(databaseContext)
+    , m_databaseContext(WTFMove(databaseContext))
     , m_deleted(false)
     , m_name(name.isolatedCopy())
     , m_expectedVersion(expectedVersion.isolatedCopy())
@@ -242,12 +241,13 @@
 
 Database::~Database()
 {
-    // The reference to the ScriptExecutionContext needs to be cleared on the _javascript_ thread.  If we're on that thread already, we can just let the RefPtr's destruction do the dereffing.
+    // The reference to the ScriptExecutionContext needs to be cleared on the _javascript_ thread.
+    // If we're on that thread already, we can just let the RefPtr's destruction do the dereffing.
     if (!m_scriptExecutionContext->isContextThread()) {
         // Grab a pointer to the script execution here because we're releasing it when we pass it to
         // DerefContextTask::create.
-        PassRefPtr<ScriptExecutionContext> passedContext = m_scriptExecutionContext.release();
-        passedContext->postTask({ScriptExecutionContext::Task::CleanupTask, [passedContext] (ScriptExecutionContext& context) {
+        RefPtr<ScriptExecutionContext> passedContext;
+        passedContext->postTask({ScriptExecutionContext::Task::CleanupTask, [passedContext = WTFMove(m_scriptExecutionContext)] (ScriptExecutionContext& context) {
             ASSERT_UNUSED(context, &context == passedContext);
             RefPtr<ScriptExecutionContext> scriptExecutionContext(passedContext);
         }});
@@ -571,7 +571,7 @@
         transaction = m_transactionQueue.takeFirst();
 
     if (transaction && databaseContext()->databaseThread()) {
-        auto task = std::make_unique<DatabaseTransactionTask>(transaction);
+        auto task = std::make_unique<DatabaseTransactionTask>(WTFMove(transaction));
         LOG(StorageAPI, "Scheduling DatabaseTransactionTask %p for transaction %p\n", task.get(), task->transaction());
         m_transactionInProgress = true;
         databaseContext()->databaseThread()->scheduleTask(WTFMove(task));
@@ -589,7 +589,7 @@
     if (data)
         wrapper = ChangeVersionWrapper::create(data->oldVersion(), data->newVersion());
 
-    RefPtr<SQLTransactionBackend> transactionBackend = SQLTransactionBackend::create(this, WTFMove(transaction), wrapper, readOnly);
+    RefPtr<SQLTransactionBackend> transactionBackend = SQLTransactionBackend::create(this, WTFMove(transaction), WTFMove(wrapper), readOnly);
     m_transactionQueue.append(transactionBackend);
     if (!m_transactionInProgress)
         scheduleTransaction();

Modified: trunk/Source/WebCore/Modules/webdatabase/Database.h (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/Database.h	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/Database.h	2016-06-30 08:14:35 UTC (rev 202676)
@@ -125,7 +125,7 @@
     void performClose();
 
 private:
-    Database(PassRefPtr<DatabaseContext>, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize);
+    Database(RefPtr<DatabaseContext>&&, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize);
 
     void closeDatabase();
 

Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseAuthorizer.cpp (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/DatabaseAuthorizer.cpp	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseAuthorizer.cpp	2016-06-30 08:14:35 UTC (rev 202676)
@@ -29,7 +29,6 @@
 #include "config.h"
 #include "DatabaseAuthorizer.h"
 
-#include <wtf/PassRefPtr.h>
 #include <wtf/text/WTFString.h>
 
 namespace WebCore {
@@ -344,7 +343,7 @@
 {
     if (m_permissions & NoAccessMask && m_securityEnabled)
         return SQLAuthDeny;
-    
+
     return denyBasedOnTableName(tableName);
 }
 

Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseManager.cpp	2016-06-30 08:14:35 UTC (rev 202676)
@@ -20,7 +20,7 @@
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "config.h"
@@ -272,7 +272,7 @@
 
 RefPtr<Database> DatabaseManager::openDatabase(ScriptExecutionContext* context,
     const String& name, const String& expectedVersion, const String& displayName,
-    unsigned long estimatedSize, PassRefPtr<DatabaseCallback> creationCallback,
+    unsigned long estimatedSize, RefPtr<DatabaseCallback>&& creationCallback,
     DatabaseError& error)
 {
     ScriptController::initializeThreading();
@@ -327,7 +327,7 @@
                 return String();
         }
     }
-    
+
     return m_server->fullPathForDatabase(origin, name, createIfDoesNotExist);
 }
 
@@ -350,16 +350,16 @@
 {
     {
         std::lock_guard<Lock> lock(m_mutex);
-        
+
         for (auto* proposedDatabase : m_proposedDatabases) {
             if (proposedDatabase->details().name() == name && proposedDatabase->origin()->equal(origin)) {
                 ASSERT(proposedDatabase->details().threadID() == std::this_thread::get_id() || isMainThread());
-                
+
                 return proposedDatabase->details();
             }
         }
     }
-    
+
     return m_server->detailsForNameAndOrigin(name, origin);
 }
 

Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseManager.h (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/DatabaseManager.h	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseManager.h	2016-06-30 08:14:35 UTC (rev 202676)
@@ -20,7 +20,7 @@
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #ifndef DatabaseManager_h
@@ -33,7 +33,6 @@
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
 #include <wtf/Lock.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/Threading.h>
 
 namespace WebCore {
@@ -81,7 +80,7 @@
 
     static ExceptionCode exceptionCodeForDatabaseError(DatabaseError);
 
-    RefPtr<Database> openDatabase(ScriptExecutionContext*, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, PassRefPtr<DatabaseCallback>, DatabaseError&);
+    RefPtr<Database> openDatabase(ScriptExecutionContext*, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, RefPtr<DatabaseCallback>&&, DatabaseError&);
 
     WEBCORE_EXPORT bool hasOpenDatabases(ScriptExecutionContext*);
 

Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseServer.cpp (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/DatabaseServer.cpp	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseServer.cpp	2016-06-30 08:14:35 UTC (rev 202676)
@@ -20,7 +20,7 @@
  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
 #include "config.h"
@@ -117,7 +117,7 @@
 {
     RefPtr<Database> database;
     bool success = false; // Make some older compilers happy.
-    
+
     switch (attempt) {
     case FirstTryToOpenDatabase:
         success = DatabaseTracker::tracker().canEstablishDatabase(backendContext.get(), name, estimatedSize, error);
@@ -133,7 +133,7 @@
 
 RefPtr<Database> DatabaseServer::createDatabase(RefPtr<DatabaseContext>& backendContext, const String& name, const String& expectedVersion, const String& displayName, unsigned long estimatedSize, bool setVersionInNewDatabase, DatabaseError& error, String& errorMessage)
 {
-    RefPtr<Database> database = adoptRef(new Database(backendContext, name, expectedVersion, displayName, estimatedSize));
+    RefPtr<Database> database = adoptRef(new Database(backendContext.copyRef(), name, expectedVersion, displayName, estimatedSize));
 
     if (!database->openAndVerifyVersion(setVersionInNewDatabase, error, errorMessage))
         return nullptr;

Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.cpp (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.cpp	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.cpp	2016-06-30 08:14:35 UTC (rev 202676)
@@ -144,9 +144,9 @@
 // *** DatabaseTransactionTask ***
 // Starts a transaction that will report its results via a callback.
 
-DatabaseTransactionTask::DatabaseTransactionTask(PassRefPtr<SQLTransactionBackend> transaction)
+DatabaseTransactionTask::DatabaseTransactionTask(RefPtr<SQLTransactionBackend>&& transaction)
     : DatabaseTask(*transaction->database(), 0)
-    , m_transaction(transaction)
+    , m_transaction(WTFMove(transaction))
     , m_didPerformTask(false)
 {
 }

Modified: trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.h (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.h	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/DatabaseTask.h	2016-06-30 08:14:35 UTC (rev 202676)
@@ -33,7 +33,6 @@
 #include "SQLTransactionBackend.h"
 #include <wtf/Condition.h>
 #include <wtf/Lock.h>
-#include <wtf/PassRefPtr.h>
 #include <wtf/Vector.h>
 #include <wtf/text/WTFString.h>
 
@@ -123,7 +122,7 @@
 
 class DatabaseTransactionTask : public DatabaseTask {
 public:
-    explicit DatabaseTransactionTask(PassRefPtr<SQLTransactionBackend>);
+    explicit DatabaseTransactionTask(RefPtr<SQLTransactionBackend>&&);
     virtual ~DatabaseTransactionTask();
 
     SQLTransactionBackend* transaction() const { return m_transaction.get(); }

Modified: trunk/Source/WebCore/Modules/webdatabase/SQLCallbackWrapper.h (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/SQLCallbackWrapper.h	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLCallbackWrapper.h	2016-06-30 08:14:35 UTC (rev 202676)
@@ -41,8 +41,8 @@
 // - by unwrapping and then dereferencing normally - on context thread only
 template<typename T> class SQLCallbackWrapper {
 public:
-    SQLCallbackWrapper(PassRefPtr<T> callback, ScriptExecutionContext* scriptExecutionContext)
-        : m_callback(callback)
+    SQLCallbackWrapper(RefPtr<T>&& callback, ScriptExecutionContext* scriptExecutionContext)
+        : m_callback(WTFMove(callback))
         , m_scriptExecutionContext(m_callback ? scriptExecutionContext : 0)
     {
         ASSERT(!m_callback || (m_scriptExecutionContext.get() && m_scriptExecutionContext->isContextThread()));

Modified: trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.h (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.h	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLResultSetRowList.h	2016-06-30 08:14:35 UTC (rev 202676)
@@ -29,7 +29,6 @@
 #ifndef SQLResultSetRowList_h
 #define SQLResultSetRowList_h
 
-#include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include "SQLValue.h"
 

Modified: trunk/Source/WebCore/Modules/webdatabase/SQLStatement.cpp (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/SQLStatement.cpp	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLStatement.cpp	2016-06-30 08:14:35 UTC (rev 202676)
@@ -40,7 +40,7 @@
 #include <wtf/text/CString.h>
 
 
-// The Life-Cycle of a SQLStatement i.e. Who's keeping the SQLStatement alive? 
+// The Life-Cycle of a SQLStatement i.e. Who's keeping the SQLStatement alive?
 // ==========================================================================
 // The RefPtr chain goes something like this:
 //
@@ -74,11 +74,11 @@
 
 namespace WebCore {
 
-SQLStatement::SQLStatement(Database& database, const String& statement, const Vector<SQLValue>& arguments, PassRefPtr<SQLStatementCallback> callback, PassRefPtr<SQLStatementErrorCallback> errorCallback, int permissions)
+SQLStatement::SQLStatement(Database& database, const String& statement, const Vector<SQLValue>& arguments, RefPtr<SQLStatementCallback>&& callback, RefPtr<SQLStatementErrorCallback>&& errorCallback, int permissions)
     : m_statement(statement.isolatedCopy())
     , m_arguments(arguments)
-    , m_statementCallbackWrapper(callback, database.scriptExecutionContext())
-    , m_statementErrorCallbackWrapper(errorCallback, database.scriptExecutionContext())
+    , m_statementCallbackWrapper(WTFMove(callback), database.scriptExecutionContext())
+    , m_statementErrorCallbackWrapper(WTFMove(errorCallback), database.scriptExecutionContext())
     , m_permissions(permissions)
 {
 }
@@ -87,14 +87,14 @@
 {
 }
 
-PassRefPtr<SQLError> SQLStatement::sqlError() const
+SQLError* SQLStatement::sqlError() const
 {
-    return m_error;
+    return m_error.get();
 }
 
-PassRefPtr<SQLResultSet> SQLStatement::sqlResultSet() const
+SQLResultSet* SQLStatement::sqlResultSet() const
 {
-    return m_resultSet;
+    return m_resultSet.get();
 }
 
 bool SQLStatement::execute(Database& db)

Modified: trunk/Source/WebCore/Modules/webdatabase/SQLStatement.h (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/SQLStatement.h	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLStatement.h	2016-06-30 08:14:35 UTC (rev 202676)
@@ -45,7 +45,7 @@
 
 class SQLStatement {
 public:
-    SQLStatement(Database&, const String&, const Vector<SQLValue>&, PassRefPtr<SQLStatementCallback>, PassRefPtr<SQLStatementErrorCallback>, int permissions);
+    SQLStatement(Database&, const String&, const Vector<SQLValue>&, RefPtr<SQLStatementCallback>&&, RefPtr<SQLStatementErrorCallback>&&, int permissions);
     ~SQLStatement();
 
     bool execute(Database&);
@@ -58,8 +58,8 @@
     void setDatabaseDeletedError();
     void setVersionMismatchedError();
 
-    PassRefPtr<SQLError> sqlError() const;
-    PassRefPtr<SQLResultSet> sqlResultSet() const;
+    SQLError* sqlError() const;
+    SQLResultSet* sqlResultSet() const;
 
 private:
     void setFailureDueToQuota();

Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.h (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.h	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.h	2016-06-30 08:14:35 UTC (rev 202676)
@@ -32,7 +32,6 @@
 #include "EventTarget.h"
 #include "SQLCallbackWrapper.h"
 #include "SQLTransactionStateMachine.h"
-#include <wtf/PassRefPtr.h>
 #include <wtf/Ref.h>
 #include <wtf/RefPtr.h>
 

Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp	2016-06-30 08:14:35 UTC (rev 202676)
@@ -230,7 +230,7 @@
 // to wait for further action.
 
 
-// The Life-Cycle of a SQLTransaction i.e. Who's keeping the SQLTransaction alive? 
+// The Life-Cycle of a SQLTransaction i.e. Who's keeping the SQLTransaction alive?
 // ==============================================================================
 // The RefPtr chain goes something like this:
 //
@@ -307,7 +307,7 @@
 //     - DatabaseBackend::close() will iterate
 //       DatabaseBackend::m_transactionQueue and call
 //       notifyDatabaseThreadIsShuttingDown() on each transaction there.
-//        
+//
 //     Phase 2. After scheduling, before state AcquireLock
 //
 //     - If the interruption occures before the DatabaseTransactionTask is
@@ -343,15 +343,15 @@
 
 namespace WebCore {
 
-Ref<SQLTransactionBackend> SQLTransactionBackend::create(Database* db, PassRefPtr<SQLTransaction> frontend, PassRefPtr<SQLTransactionWrapper> wrapper, bool readOnly)
+Ref<SQLTransactionBackend> SQLTransactionBackend::create(Database* db, RefPtr<SQLTransaction>&& frontend, RefPtr<SQLTransactionWrapper>&& wrapper, bool readOnly)
 {
-    return adoptRef(*new SQLTransactionBackend(db, frontend, wrapper, readOnly));
+    return adoptRef(*new SQLTransactionBackend(db, WTFMove(frontend), WTFMove(wrapper), readOnly));
 }
 
-SQLTransactionBackend::SQLTransactionBackend(Database* db, PassRefPtr<SQLTransaction> frontend, PassRefPtr<SQLTransactionWrapper> wrapper, bool readOnly)
-    : m_frontend(frontend)
+SQLTransactionBackend::SQLTransactionBackend(Database* db, RefPtr<SQLTransaction>&& frontend, RefPtr<SQLTransactionWrapper>&& wrapper, bool readOnly)
+    : m_frontend(WTFMove(frontend))
     , m_database(db)
-    , m_wrapper(wrapper)
+    , m_wrapper(WTFMove(wrapper))
     , m_hasCallback(m_frontend->hasCallback())
     , m_hasSuccessCallback(m_frontend->hasSuccessCallback())
     , m_hasErrorCallback(m_frontend->hasErrorCallback())
@@ -428,9 +428,9 @@
     return m_currentStatementBackend.get();
 }
 
-PassRefPtr<SQLError> SQLTransactionBackend::transactionError()
+SQLError* SQLTransactionBackend::transactionError()
 {
-    return m_transactionError;
+    return m_transactionError.get();
 }
 
 void SQLTransactionBackend::setShouldRetryCurrentStatement(bool shouldRetry)

Modified: trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h (202675 => 202676)


--- trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h	2016-06-30 07:32:32 UTC (rev 202675)
+++ trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h	2016-06-30 08:14:35 UTC (rev 202676)
@@ -58,7 +58,7 @@
 
 class SQLTransactionBackend : public ThreadSafeRefCounted<SQLTransactionBackend>, public SQLTransactionStateMachine<SQLTransactionBackend> {
 public:
-    static Ref<SQLTransactionBackend> create(Database*, PassRefPtr<SQLTransaction>, PassRefPtr<SQLTransactionWrapper>, bool readOnly);
+    static Ref<SQLTransactionBackend> create(Database*, RefPtr<SQLTransaction>&&, RefPtr<SQLTransactionWrapper>&&, bool readOnly);
 
     virtual ~SQLTransactionBackend();
 
@@ -71,13 +71,13 @@
 
     // APIs called from the frontend published via SQLTransactionBackend:
     void requestTransitToState(SQLTransactionState);
-    PassRefPtr<SQLError> transactionError();
+    SQLError* transactionError();
     SQLStatement* currentStatement();
     void setShouldRetryCurrentStatement(bool);
     void executeSQL(std::unique_ptr<SQLStatement>);
-    
+
 private:
-    SQLTransactionBackend(Database*, PassRefPtr<SQLTransaction>, PassRefPtr<SQLTransactionWrapper>, bool readOnly);
+    SQLTransactionBackend(Database*, RefPtr<SQLTransaction>&&, RefPtr<SQLTransactionWrapper>&&, bool readOnly);
 
     void doCleanup();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to