Remove AbstractSQLStatementBackend
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Jan 2015 23:50:17 +0000 (23:50 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 Jan 2015 23:50:17 +0000 (23:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=140222

Reviewed by Sam Weinig.

We're unlikely to fully take advantage of the SQL implementation being abstract anyway, so let's just simplify the code instead.

* Modules/webdatabase/AbstractSQLStatement.h:
* Modules/webdatabase/AbstractSQLStatementBackend.h: Removed.
* Modules/webdatabase/SQLStatement.cpp:
(WebCore::SQLStatement::setBackend):
* Modules/webdatabase/SQLStatement.h:
* Modules/webdatabase/SQLStatementBackend.cpp:
(WebCore::SQLStatementBackend::~SQLStatementBackend):
* Modules/webdatabase/SQLStatementBackend.h:
* WebCore.vcxproj/WebCore.vcxproj:
* WebCore.vcxproj/WebCore.vcxproj.filters:
* WebCore.xcodeproj/project.pbxproj:

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

Source/WebCore/ChangeLog
Source/WebCore/Modules/webdatabase/AbstractSQLStatement.h
Source/WebCore/Modules/webdatabase/AbstractSQLStatementBackend.h [deleted file]
Source/WebCore/Modules/webdatabase/SQLStatement.cpp
Source/WebCore/Modules/webdatabase/SQLStatement.h
Source/WebCore/Modules/webdatabase/SQLStatementBackend.cpp
Source/WebCore/Modules/webdatabase/SQLStatementBackend.h
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
Source/WebCore/WebCore.xcodeproj/project.pbxproj

index eb8a3c88a40ae6b7e097faa1c67687e9d41013b2..6d61c68d56f1c8083a570918ae1119019bcaa08a 100644 (file)
@@ -1,3 +1,24 @@
+2015-01-07  Anders Carlsson  <andersca@apple.com>
+
+        Remove AbstractSQLStatementBackend
+        https://bugs.webkit.org/show_bug.cgi?id=140222
+
+        Reviewed by Sam Weinig.
+
+        We're unlikely to fully take advantage of the SQL implementation being abstract anyway, so let's just simplify the code instead.
+
+        * Modules/webdatabase/AbstractSQLStatement.h:
+        * Modules/webdatabase/AbstractSQLStatementBackend.h: Removed.
+        * Modules/webdatabase/SQLStatement.cpp:
+        (WebCore::SQLStatement::setBackend):
+        * Modules/webdatabase/SQLStatement.h:
+        * Modules/webdatabase/SQLStatementBackend.cpp:
+        (WebCore::SQLStatementBackend::~SQLStatementBackend):
+        * Modules/webdatabase/SQLStatementBackend.h:
+        * WebCore.vcxproj/WebCore.vcxproj:
+        * WebCore.vcxproj/WebCore.vcxproj.filters:
+        * WebCore.xcodeproj/project.pbxproj:
+
 2015-01-07  Brian J. Burg  <burg@cs.washington.edu>
 
         Web Inspector: purge PassRefPtr from Inspector code and use Ref for typed and untyped protocol objects
index 2196a9fc80e096ada3b8282f26ea23edfa3df87d..9f5d161b4604e5cd19c9880ba5d50e56944527b5 100644 (file)
 
 namespace WebCore {
 
-class AbstractSQLStatementBackend;
+class SQLStatementBackend;
 
 class AbstractSQLStatement {
 public:
     virtual ~AbstractSQLStatement() { }
 
-    virtual void setBackend(AbstractSQLStatementBackend*) = 0;
+    virtual void setBackend(SQLStatementBackend*) = 0;
 
     virtual bool hasCallback() = 0;
     virtual bool hasErrorCallback() = 0;
diff --git a/Source/WebCore/Modules/webdatabase/AbstractSQLStatementBackend.h b/Source/WebCore/Modules/webdatabase/AbstractSQLStatementBackend.h
deleted file mode 100644 (file)
index 0450763..0000000
+++ /dev/null
@@ -1,49 +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 AbstractSQLStatementBackend_h
-#define AbstractSQLStatementBackend_h
-
-#if ENABLE(SQL_DATABASE)
-
-#include "SQLError.h"
-#include "SQLResultSet.h"
-#include <wtf/ThreadSafeRefCounted.h>
-
-namespace WebCore {
-
-class AbstractSQLStatementBackend : public ThreadSafeRefCounted<AbstractSQLStatementBackend> {
-public:
-    virtual ~AbstractSQLStatementBackend() { }
-
-    virtual PassRefPtr<SQLError> sqlError() const = 0;
-    virtual PassRefPtr<SQLResultSet> sqlResultSet() const = 0;
-};
-
-} // namespace WebCore
-
-#endif // ENABLE(SQL_DATABASE)
-
-#endif // AbstractSQLStatementBackend_h
index 80d7d2be576aa6e2e108fef4539465be795b9f0c..d48e623a978d42934d5972cf03652001aa9675f8 100644 (file)
 #if ENABLE(SQL_DATABASE)
 
 #include "AbstractDatabaseServer.h"
-#include "AbstractSQLStatementBackend.h"
 #include "Database.h"
 #include "DatabaseManager.h"
 #include "Logging.h"
+#include "SQLError.h"
+#include "SQLStatementBackend.h"
 #include "SQLStatementCallback.h"
 #include "SQLStatementErrorCallback.h"
 #include "SQLTransaction.h"
@@ -51,7 +52,7 @@ SQLStatement::SQLStatement(Database& database, PassRefPtr<SQLStatementCallback>
 {
 }
 
-void SQLStatement::setBackend(AbstractSQLStatementBackend* backend)
+void SQLStatement::setBackend(SQLStatementBackend* backend)
 {
     m_backend = backend;
 }
index a80541ced2a3c117e791bf02eff3bf452b471df4..16f85343a388d930ebd71be263caf68794fb96d2 100644 (file)
@@ -40,9 +40,9 @@
 
 namespace WebCore {
 
-class AbstractSQLStatementBackend;
 class Database;
 class SQLError;
+class SQLStatementBackend;
 class SQLStatementCallback;
 class SQLStatementErrorCallback;
 class SQLTransaction;
@@ -53,16 +53,16 @@ public:
 
     bool performCallback(SQLTransaction*);
 
-    virtual void setBackend(AbstractSQLStatementBackend*);
+    virtual void setBackend(SQLStatementBackend*);
 
     virtual bool hasCallback();
     virtual bool hasErrorCallback();
 
 private:
-    // The AbstractSQLStatementBackend owns the SQLStatement. Hence, the backend is
+    // The SQLStatementBackend owns the SQLStatement. Hence, the backend is
     // guaranteed to be outlive the SQLStatement, and it is safe for us to refer
     // to the backend using a raw pointer here.
-    AbstractSQLStatementBackend* m_backend;
+    SQLStatementBackend* m_backend;
 
     SQLCallbackWrapper<SQLStatementCallback> m_statementCallbackWrapper;
     SQLCallbackWrapper<SQLStatementErrorCallback> m_statementErrorCallbackWrapper;
index f3dbf466cecc642914c9c02d7972a5c803dd0ce7..a68267a68143d0e561b7b215478cd0187978fe21 100644 (file)
@@ -34,6 +34,7 @@
 #include "DatabaseBackend.h"
 #include "Logging.h"
 #include "SQLError.h"
+#include "SQLResultSet.h"
 #include "SQLValue.h"
 #include "SQLiteDatabase.h"
 #include "SQLiteStatement.h"
@@ -92,6 +93,10 @@ SQLStatementBackend::SQLStatementBackend(std::unique_ptr<AbstractSQLStatement> f
     m_frontend->setBackend(this);
 }
 
+SQLStatementBackend::~SQLStatementBackend()
+{
+}
+
 AbstractSQLStatement* SQLStatementBackend::frontend()
 {
     return m_frontend.get();
index cefb6ffe579ad630d7a2cb3e45b84c3f76ce8057..39b5c0d37a5b93d89c532dfcfe8bf59962261f99 100644 (file)
@@ -30,7 +30,6 @@
 
 #if ENABLE(SQL_DATABASE)
 
-#include "AbstractSQLStatementBackend.h"
 #include "SQLValue.h"
 #include <wtf/Forward.h>
 #include <wtf/Vector.h>
@@ -41,12 +40,14 @@ namespace WebCore {
 class AbstractSQLStatement;
 class DatabaseBackend;
 class SQLError;
+class SQLResultSet;
 class SQLTransactionBackend;
 
-class SQLStatementBackend : public AbstractSQLStatementBackend {
+class SQLStatementBackend : public ThreadSafeRefCounted<SQLStatementBackend> {
 public:
     static PassRefPtr<SQLStatementBackend> create(std::unique_ptr<AbstractSQLStatement>,
         const String& sqlStatement, const Vector<SQLValue>& arguments, int permissions);
+    virtual ~SQLStatementBackend();
 
     bool execute(DatabaseBackend*);
     bool lastExecutionFailedDueToQuota() const;
@@ -58,8 +59,8 @@ public:
     void setVersionMismatchedError();
 
     AbstractSQLStatement* frontend();
-    virtual PassRefPtr<SQLError> sqlError() const;
-    virtual PassRefPtr<SQLResultSet> sqlResultSet() const;
+    PassRefPtr<SQLError> sqlError() const;
+    PassRefPtr<SQLResultSet> sqlResultSet() const;
 
 private:
     SQLStatementBackend(std::unique_ptr<AbstractSQLStatement>, const String& statement,
index 613978c4de9c4e0fcf5636d7a2b526727adaac99..aac1f27b63a15d10f3be947a5e4c6c93f5cbfb20 100644 (file)
     <ClInclude Include="..\Modules\plugins\PluginReplacement.h" />
     <ClInclude Include="..\Modules\webdatabase\AbstractDatabaseServer.h" />
     <ClInclude Include="..\Modules\webdatabase\AbstractSQLStatement.h" />
-    <ClInclude Include="..\Modules\webdatabase\AbstractSQLStatementBackend.h" />
     <ClInclude Include="..\Modules\webdatabase\ChangeVersionData.h" />
     <ClInclude Include="..\Modules\webdatabase\ChangeVersionWrapper.h" />
     <ClInclude Include="..\Modules\webdatabase\Database.h" />
index c5540b28183867f95c23871f721ed01e6ec15939..2d2ad80cd1abe50220ff3b9e6245e20baba32387 100644 (file)
     <ClInclude Include="..\Modules\webdatabase\AbstractSQLStatement.h">
       <Filter>Modules\webdatabase</Filter>
     </ClInclude>
-    <ClInclude Include="..\Modules\webdatabase\AbstractSQLStatementBackend.h">
-      <Filter>Modules\webdatabase</Filter>
-    </ClInclude>
     <ClInclude Include="..\Modules\webdatabase\ChangeVersionData.h">
       <Filter>Modules\webdatabase</Filter>
     </ClInclude>
index cac2b8d413b873edbf1cfe627534c59048e7b141..3011893cc4337bc49b103d5e6d692a9bc5ff1a15 100644 (file)
                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, ); }; };
-               FE4AADEF16D2C37400026FFC /* AbstractSQLStatementBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4AADED16D2C37400026FFC /* AbstractSQLStatementBackend.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, ); }; };
                1A3586DE15264C450022A659 /* RenderMultiColumnFlowThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RenderMultiColumnFlowThread.h; sourceTree = "<group>"; };
                1A3763691A2E68BB009A7EE2 /* StorageNamespaceProvider.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StorageNamespaceProvider.cpp; sourceTree = "<group>"; };
                1A37636A1A2E68BB009A7EE2 /* StorageNamespaceProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StorageNamespaceProvider.h; sourceTree = "<group>"; };
+               1A40CDD01A5DF74700E9D4DB /* AbstractSQLTransaction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractSQLTransaction.h; sourceTree = "<group>"; };
+               1A40CDD11A5DF76200E9D4DB /* AbstractSQLTransactionBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractSQLTransactionBackend.h; sourceTree = "<group>"; };
                1A494BBB0A122DCD00FDAFC1 /* HTMLElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HTMLElement.idl; sourceTree = "<group>"; };
                1A494BF80A122F4400FDAFC1 /* JSHTMLElement.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLElement.cpp; sourceTree = "<group>"; };
                1A494BF90A122F4400FDAFC1 /* JSHTMLElement.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLElement.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>"; };
-               FE4AADED16D2C37400026FFC /* AbstractSQLStatementBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AbstractSQLStatementBackend.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>"; };
                        children = (
                                FE115FA9167988CD00249134 /* AbstractDatabaseServer.h */,
                                FE4AADEC16D2C37400026FFC /* AbstractSQLStatement.h */,
-                               FE4AADED16D2C37400026FFC /* AbstractSQLStatementBackend.h */,
+                               1A40CDD01A5DF74700E9D4DB /* AbstractSQLTransaction.h */,
+                               1A40CDD11A5DF76200E9D4DB /* AbstractSQLTransactionBackend.h */,
                                FE36FD1116C7826400F887C1 /* ChangeVersionData.h */,
                                97BC69D81505F076001B74AC /* ChangeVersionWrapper.cpp */,
                                97BC69D91505F076001B74AC /* ChangeVersionWrapper.h */,
                                A172182619DE183F00464D17 /* _UIHighlightViewSPI.h in Headers */,
                                FE115FAB167988CD00249134 /* AbstractDatabaseServer.h in Headers */,
                                FE4AADEE16D2C37400026FFC /* AbstractSQLStatement.h in Headers */,
-                               FE4AADEF16D2C37400026FFC /* AbstractSQLStatementBackend.h in Headers */,
                                41E1B1D10FF5986900576B3B /* AbstractWorker.h in Headers */,
                                29A8122E0FBB9C1D00510293 /* AccessibilityARIAGridCell.h in Headers */,
                                29A812330FBB9C1D00510293 /* AccessibilityARIAGridRow.h in Headers */,