+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
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;
+++ /dev/null
-/*
- * 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
#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"
{
}
-void SQLStatement::setBackend(AbstractSQLStatementBackend* backend)
+void SQLStatement::setBackend(SQLStatementBackend* backend)
{
m_backend = backend;
}
namespace WebCore {
-class AbstractSQLStatementBackend;
class Database;
class SQLError;
+class SQLStatementBackend;
class SQLStatementCallback;
class SQLStatementErrorCallback;
class SQLTransaction;
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;
#include "DatabaseBackend.h"
#include "Logging.h"
#include "SQLError.h"
+#include "SQLResultSet.h"
#include "SQLValue.h"
#include "SQLiteDatabase.h"
#include "SQLiteStatement.h"
m_frontend->setBackend(this);
}
+SQLStatementBackend::~SQLStatementBackend()
+{
+}
+
AbstractSQLStatement* SQLStatementBackend::frontend()
{
return m_frontend.get();
#if ENABLE(SQL_DATABASE)
-#include "AbstractSQLStatementBackend.h"
#include "SQLValue.h"
#include <wtf/Forward.h>
#include <wtf/Vector.h>
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;
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,
<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" />
<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>
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 */,