Remove AbstractSQLStatement
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jan 2015 00:22:01 +0000 (00:22 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 8 Jan 2015 00:22:01 +0000 (00:22 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140223

Reviewed by Sam Weinig.

* Modules/webdatabase/AbstractSQLStatement.h: Removed.
* Modules/webdatabase/AbstractSQLTransactionBackend.h:
* Modules/webdatabase/SQLStatement.h:
* Modules/webdatabase/SQLStatementBackend.cpp:
(WebCore::SQLStatementBackend::create):
(WebCore::SQLStatementBackend::SQLStatementBackend):
(WebCore::SQLStatementBackend::frontend):
* Modules/webdatabase/SQLStatementBackend.h:
* Modules/webdatabase/SQLTransaction.cpp:
(WebCore::SQLTransaction::deliverStatementCallback):
* Modules/webdatabase/SQLTransactionBackend.cpp:
(WebCore::SQLTransactionBackend::currentStatement):
(WebCore::SQLTransactionBackend::executeSQL):
* Modules/webdatabase/SQLTransactionBackend.h:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@178066 268f45cc-cd09-0410-ab3c-d52691b4dbfc

12 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/webdatabase/AbstractSQLStatement.h [deleted file]
Source/WebCore/Modules/webdatabase/AbstractSQLTransactionBackend.h
Source/WebCore/Modules/webdatabase/SQLStatement.h
Source/WebCore/Modules/webdatabase/SQLStatementBackend.cpp
Source/WebCore/Modules/webdatabase/SQLStatementBackend.h
Source/WebCore/Modules/webdatabase/SQLTransaction.cpp
Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp
Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj

index 1b6a550..eca3958 100644 (file)
@@ -1,3 +1,28 @@
+2015-01-07  Anders Carlsson  <andersca@apple.com>
+
+        Remove AbstractSQLStatement
+        https://bugs.webkit.org/show_bug.cgi?id=140223
+
+        Reviewed by Sam Weinig.
+
+        * Modules/webdatabase/AbstractSQLStatement.h: Removed.
+        * Modules/webdatabase/AbstractSQLTransactionBackend.h:
+        * Modules/webdatabase/SQLStatement.h:
+        * Modules/webdatabase/SQLStatementBackend.cpp:
+        (WebCore::SQLStatementBackend::create):
+        (WebCore::SQLStatementBackend::SQLStatementBackend):
+        (WebCore::SQLStatementBackend::frontend):
+        * Modules/webdatabase/SQLStatementBackend.h:
+        * Modules/webdatabase/SQLTransaction.cpp:
+        (WebCore::SQLTransaction::deliverStatementCallback):
+        * Modules/webdatabase/SQLTransactionBackend.cpp:
+        (WebCore::SQLTransactionBackend::currentStatement):
+        (WebCore::SQLTransactionBackend::executeSQL):
+        * Modules/webdatabase/SQLTransactionBackend.h:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+
 2015-01-07  Timothy Horton  <timothy_horton@apple.com>
 
         Manually-animated TextIndicator fades out blue selection if you click inside it
diff --git a/Source/WebCore/Modules/webdatabase/AbstractSQLStatement.h b/Source/WebCore/Modules/webdatabase/AbstractSQLStatement.h
deleted file mode 100644 (file)
index 9f5d161..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2013 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * 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. 
- */
-
-#ifndef AbstractSQLStatement_h
-#define AbstractSQLStatement_h
-
-#if ENABLE(SQL_DATABASE)
-
-#include <wtf/ThreadSafeRefCounted.h>
-
-namespace WebCore {
-
-class SQLStatementBackend;
-
-class AbstractSQLStatement {
-public:
-    virtual ~AbstractSQLStatement() { }
-
-    virtual void setBackend(SQLStatementBackend*) = 0;
-
-    virtual bool hasCallback() = 0;
-    virtual bool hasErrorCallback() = 0;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SQL_DATABASE)
-
-#endif // AbstractSQLStatement_h
index f248097..156192c 100644 (file)
@@ -28,7 +28,6 @@
 
 #if ENABLE(SQL_DATABASE)
 
-#include "AbstractSQLStatement.h"
 #include "SQLError.h"
 #include "SQLTransactionState.h"
 #include "SQLValue.h"
@@ -39,6 +38,8 @@
 
 namespace WebCore {
 
+class SQLStatement;
+
 class AbstractSQLTransactionBackend : public ThreadSafeRefCounted<AbstractSQLTransactionBackend> {
 public:
     virtual ~AbstractSQLTransactionBackend() { }
@@ -46,10 +47,10 @@ public:
     virtual void requestTransitToState(SQLTransactionState) = 0;
 
     virtual PassRefPtr<SQLError> transactionError() = 0;
-    virtual AbstractSQLStatement* currentStatement() = 0;
+    virtual SQLStatement* currentStatement() = 0;
     virtual void setShouldRetryCurrentStatement(bool) = 0;
 
-    virtual void executeSQL(std::unique_ptr<AbstractSQLStatement>, const String& statement,
+    virtual void executeSQL(std::unique_ptr<SQLStatement>, const String& statement,
         const Vector<SQLValue>& arguments, int permissions) = 0;
 
 };
index 16f8534..4bd0754 100644 (file)
@@ -30,7 +30,6 @@
 
 #if ENABLE(SQL_DATABASE)
 
-#include "AbstractSQLStatement.h"
 #include "SQLCallbackWrapper.h"
 #include "SQLResultSet.h"
 #include "SQLValue.h"
@@ -47,16 +46,16 @@ class SQLStatementCallback;
 class SQLStatementErrorCallback;
 class SQLTransaction;
 
-class SQLStatement : public AbstractSQLStatement {
+class SQLStatement {
 public:
     SQLStatement(Database&, PassRefPtr<SQLStatementCallback>, PassRefPtr<SQLStatementErrorCallback>);
 
     bool performCallback(SQLTransaction*);
 
-    virtual void setBackend(SQLStatementBackend*);
+    void setBackend(SQLStatementBackend*);
 
-    virtual bool hasCallback();
-    virtual bool hasErrorCallback();
+    bool hasCallback();
+    bool hasErrorCallback();
 
 private:
     // The SQLStatementBackend owns the SQLStatement. Hence, the backend is
index a68267a..b0919f2 100644 (file)
 
 #if ENABLE(SQL_DATABASE)
 
-#include "AbstractSQLStatement.h"
 #include "DatabaseBackend.h"
 #include "Logging.h"
 #include "SQLError.h"
 #include "SQLResultSet.h"
+#include "SQLStatement.h"
 #include "SQLValue.h"
 #include "SQLiteDatabase.h"
 #include "SQLiteStatement.h"
 
 namespace WebCore {
 
-PassRefPtr<SQLStatementBackend> SQLStatementBackend::create(std::unique_ptr<AbstractSQLStatement> frontend,
+PassRefPtr<SQLStatementBackend> SQLStatementBackend::create(std::unique_ptr<SQLStatement> frontend,
     const String& statement, const Vector<SQLValue>& arguments, int permissions)
 {
     return adoptRef(new SQLStatementBackend(WTF::move(frontend), statement, arguments, permissions));
 }
 
-SQLStatementBackend::SQLStatementBackend(std::unique_ptr<AbstractSQLStatement> frontend,
+SQLStatementBackend::SQLStatementBackend(std::unique_ptr<SQLStatement> frontend,
     const String& statement, const Vector<SQLValue>& arguments, int permissions)
     : m_frontend(WTF::move(frontend))
     , m_statement(statement.isolatedCopy())
@@ -97,7 +97,7 @@ SQLStatementBackend::~SQLStatementBackend()
 {
 }
 
-AbstractSQLStatement* SQLStatementBackend::frontend()
+SQLStatement* SQLStatementBackend::frontend()
 {
     return m_frontend.get();
 }
index 39b5c0d..f3e39a3 100644 (file)
 
 namespace WebCore {
 
-class AbstractSQLStatement;
 class DatabaseBackend;
 class SQLError;
 class SQLResultSet;
+class SQLStatement;
 class SQLTransactionBackend;
 
 class SQLStatementBackend : public ThreadSafeRefCounted<SQLStatementBackend> {
 public:
-    static PassRefPtr<SQLStatementBackend> create(std::unique_ptr<AbstractSQLStatement>,
+    static PassRefPtr<SQLStatementBackend> create(std::unique_ptr<SQLStatement>,
         const String& sqlStatement, const Vector<SQLValue>& arguments, int permissions);
     virtual ~SQLStatementBackend();
 
@@ -58,18 +58,18 @@ public:
     void setDatabaseDeletedError();
     void setVersionMismatchedError();
 
-    AbstractSQLStatement* frontend();
+    SQLStatement* frontend();
     PassRefPtr<SQLError> sqlError() const;
     PassRefPtr<SQLResultSet> sqlResultSet() const;
 
 private:
-    SQLStatementBackend(std::unique_ptr<AbstractSQLStatement>, const String& statement,
+    SQLStatementBackend(std::unique_ptr<SQLStatement>, const String& statement,
         const Vector<SQLValue>& arguments, int permissions);
 
     void setFailureDueToQuota();
     void clearFailureDueToQuota();
 
-    std::unique_ptr<AbstractSQLStatement> m_frontend;
+    std::unique_ptr<SQLStatement> m_frontend;
     String m_statement;
     Vector<SQLValue> m_arguments;
     bool m_hasCallback;
index 97bcb2a..38dc942 100644 (file)
@@ -182,8 +182,7 @@ SQLTransactionState SQLTransaction::deliverStatementCallback()
     // Otherwise, continue to loop through the statement queue
     m_executeSqlAllowed = true;
 
-    AbstractSQLStatement* currentAbstractStatement = m_backend->currentStatement();
-    SQLStatement* currentStatement = static_cast<SQLStatement*>(currentAbstractStatement);
+    SQLStatement* currentStatement = m_backend->currentStatement();
     ASSERT(currentStatement);
 
     bool result = currentStatement->performCallback(this);
index 28a3bf4..99be9d0 100644 (file)
@@ -43,6 +43,9 @@
 #include "OriginLock.h"
 #include "SQLError.h"
 #include "SQLStatementBackend.h"
+#include "SQLStatementCallback.h"
+#include "SQLStatementErrorCallback.h"
+#include "SQLTransaction.h"
 #include "SQLTransactionClient.h"
 #include "SQLTransactionCoordinator.h"
 #include "SQLValue.h"
@@ -426,7 +429,7 @@ void SQLTransactionBackend::doCleanup()
     m_wrapper = 0;
 }
 
-AbstractSQLStatement* SQLTransactionBackend::currentStatement()
+SQLStatement* SQLTransactionBackend::currentStatement()
 {
     return m_currentStatementBackend->frontend();
 }
@@ -526,8 +529,7 @@ bool SQLTransactionBackend::shouldPerformWhilePaused() const
 }
 #endif
 
-void SQLTransactionBackend::executeSQL(std::unique_ptr<AbstractSQLStatement> statement,
-    const String& sqlStatement, const Vector<SQLValue>& arguments, int permissions)
+void SQLTransactionBackend::executeSQL(std::unique_ptr<SQLStatement> statement, const String& sqlStatement, const Vector<SQLValue>& arguments, int permissions)
 {
     RefPtr<SQLStatementBackend> statementBackend;
     statementBackend = SQLStatementBackend::create(WTF::move(statement), sqlStatement, arguments, permissions);
index b0fa92b..fee2a7a 100644 (file)
@@ -30,7 +30,6 @@
 
 #if ENABLE(SQL_DATABASE)
 
-#include "AbstractSQLStatement.h"
 #include "AbstractSQLTransactionBackend.h"
 #include "DatabaseBasicTypes.h"
 #include "SQLTransactionStateMachine.h"
@@ -84,9 +83,9 @@ private:
     // APIs called from the frontend published via AbstractSQLTransactionBackend:
     virtual void requestTransitToState(SQLTransactionState) override;
     virtual PassRefPtr<SQLError> transactionError() override;
-    virtual AbstractSQLStatement* currentStatement() override;
+    virtual SQLStatement* currentStatement() override;
     virtual void setShouldRetryCurrentStatement(bool) override;
-    virtual void executeSQL(std::unique_ptr<AbstractSQLStatement>, const String& statement,
+    virtual void executeSQL(std::unique_ptr<SQLStatement>, const String& statement,
         const Vector<SQLValue>& arguments, int permissions) override;
 
     void doCleanup();
index aac1f27..8b66cdf 100644 (file)
     <ClInclude Include="..\Modules\notifications\WorkerGlobalScopeNotifications.h" />
     <ClInclude Include="..\Modules\plugins\PluginReplacement.h" />
     <ClInclude Include="..\Modules\webdatabase\AbstractDatabaseServer.h" />
-    <ClInclude Include="..\Modules\webdatabase\AbstractSQLStatement.h" />
     <ClInclude Include="..\Modules\webdatabase\ChangeVersionData.h" />
     <ClInclude Include="..\Modules\webdatabase\ChangeVersionWrapper.h" />
     <ClInclude Include="..\Modules\webdatabase\Database.h" />
index 2d2ad80..b162689 100644 (file)
     <ClInclude Include="..\Modules\webdatabase\AbstractDatabaseServer.h">
       <Filter>Modules\webdatabase</Filter>
     </ClInclude>
-    <ClInclude Include="..\Modules\webdatabase\AbstractSQLStatement.h">
-      <Filter>Modules\webdatabase</Filter>
-    </ClInclude>
     <ClInclude Include="..\Modules\webdatabase\ChangeVersionData.h">
       <Filter>Modules\webdatabase</Filter>
     </ClInclude>
index 3011893..c90daeb 100644 (file)
                FE36FD1816C7826500F887C1 /* SQLTransactionState.h in Headers */ = {isa = PBXBuildFile; fileRef = FE36FD1416C7826400F887C1 /* SQLTransactionState.h */; };
                FE456F181677D74E005EDDF9 /* DatabaseManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE456F161677D74E005EDDF9 /* DatabaseManager.cpp */; };
                FE456F191677D74E005EDDF9 /* DatabaseManager.h in Headers */ = {isa = PBXBuildFile; fileRef = FE456F171677D74E005EDDF9 /* DatabaseManager.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               FE4AADEE16D2C37400026FFC /* AbstractSQLStatement.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4AADEC16D2C37400026FFC /* AbstractSQLStatement.h */; settings = {ATTRIBUTES = (Private, ); }; };
                FE6938B61045D67E008EABB6 /* EventHandlerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */; };
                FE699871192087E7006936BD /* FloatingPointEnvironment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE69986F192087E7006936BD /* FloatingPointEnvironment.cpp */; };
                FE699872192087E7006936BD /* FloatingPointEnvironment.h in Headers */ = {isa = PBXBuildFile; fileRef = FE699870192087E7006936BD /* FloatingPointEnvironment.h */; settings = {ATTRIBUTES = (Private, ); }; };
                FE36FD1416C7826400F887C1 /* SQLTransactionState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SQLTransactionState.h; sourceTree = "<group>"; };
                FE456F161677D74E005EDDF9 /* DatabaseManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DatabaseManager.cpp; sourceTree = "<group>"; };
                FE456F171677D74E005EDDF9 /* DatabaseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DatabaseManager.h; sourceTree = "<group>"; };
-               FE4AADEC16D2C37400026FFC /* AbstractSQLStatement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractSQLStatement.h; sourceTree = "<group>"; };
                FE6938B51045D67E008EABB6 /* EventHandlerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventHandlerIOS.mm; sourceTree = "<group>"; };
                FE69986F192087E7006936BD /* FloatingPointEnvironment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FloatingPointEnvironment.cpp; path = ios/wak/FloatingPointEnvironment.cpp; sourceTree = "<group>"; };
                FE699870192087E7006936BD /* FloatingPointEnvironment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FloatingPointEnvironment.h; path = ios/wak/FloatingPointEnvironment.h; sourceTree = "<group>"; };
                        isa = PBXGroup;
                        children = (
                                FE115FA9167988CD00249134 /* AbstractDatabaseServer.h */,
-                               FE4AADEC16D2C37400026FFC /* AbstractSQLStatement.h */,
                                1A40CDD01A5DF74700E9D4DB /* AbstractSQLTransaction.h */,
                                1A40CDD11A5DF76200E9D4DB /* AbstractSQLTransactionBackend.h */,
                                FE36FD1116C7826400F887C1 /* ChangeVersionData.h */,
                        files = (
                                A172182619DE183F00464D17 /* _UIHighlightViewSPI.h in Headers */,
                                FE115FAB167988CD00249134 /* AbstractDatabaseServer.h in Headers */,
-                               FE4AADEE16D2C37400026FFC /* AbstractSQLStatement.h in Headers */,
                                41E1B1D10FF5986900576B3B /* AbstractWorker.h in Headers */,
                                29A8122E0FBB9C1D00510293 /* AccessibilityARIAGridCell.h in Headers */,
                                29A812330FBB9C1D00510293 /* AccessibilityARIAGridRow.h in Headers */,