Changeset 143264 in webkit
- Timestamp:
- Feb 18, 2013 2:31:54 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 added
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r143263 r143264 1 2013-02-18 Mark Lam <mark.lam@apple.com> 2 3 Introduced AbstractSQLStatement and AbstractSQLStatementBackend. 4 https://bugs.webkit.org/show_bug.cgi?id=110148. 5 6 Reviewed by Geoff Garen. 7 8 This is part of the webdatabase refactoring for webkit2. 9 - Also changed the frontend and backend to only refer to the 10 abstract interface of each other. 11 12 No new tests. 13 14 * GNUmakefile.list.am: 15 * Modules/webdatabase/AbstractSQLStatement.h: Added. 16 (AbstractSQLStatement): 17 (WebCore::AbstractSQLStatement::~AbstractSQLStatement): 18 * Modules/webdatabase/AbstractSQLStatementBackend.h: Added. 19 (AbstractSQLStatementBackend): 20 (WebCore::AbstractSQLStatementBackend::~AbstractSQLStatementBackend): 21 * Modules/webdatabase/SQLStatement.cpp: 22 (WebCore::SQLStatement::setBackend): 23 * Modules/webdatabase/SQLStatement.h: 24 (SQLStatement): 25 * Modules/webdatabase/SQLStatementBackend.cpp: 26 (WebCore::SQLStatementBackend::create): 27 (WebCore::SQLStatementBackend::SQLStatementBackend): 28 (WebCore::SQLStatementBackend::frontend): 29 * Modules/webdatabase/SQLStatementBackend.h: 30 (SQLStatementBackend): 31 * Modules/webdatabase/SQLTransaction.cpp: 32 (WebCore::SQLTransaction::deliverStatementCallback): 33 * Modules/webdatabase/SQLTransactionBackend.cpp: 34 (WebCore::SQLTransactionBackend::currentStatement): 35 (WebCore::SQLTransactionBackend::executeSQL): 36 * Modules/webdatabase/SQLTransactionBackend.h: 37 (SQLTransactionBackend): 38 * Target.pri: 39 * WebCore.gypi: 40 * WebCore.vcproj/WebCore.vcproj: 41 * WebCore.vcxproj/WebCore.vcxproj: 42 * WebCore.vcxproj/WebCore.vcxproj.filters: 43 * WebCore.xcodeproj/project.pbxproj: 44 1 45 2013-02-18 David Kilzer <ddkilzer@apple.com> 2 46 -
trunk/Source/WebCore/GNUmakefile.list.am
r143223 r143264 2101 2101 Source/WebCore/Modules/webaudio/WaveTable.h \ 2102 2102 Source/WebCore/Modules/webdatabase/AbstractDatabaseServer.h \ 2103 Source/WebCore/Modules/webdatabase/AbstractSQLStatement.h \ 2104 Source/WebCore/Modules/webdatabase/AbstractSQLStatementBackend.h \ 2103 2105 Source/WebCore/Modules/webdatabase/ChangeVersionData.h \ 2104 2106 Source/WebCore/Modules/webdatabase/ChangeVersionWrapper.cpp \ -
trunk/Source/WebCore/Modules/webdatabase/SQLStatement.cpp
r143090 r143264 32 32 33 33 #include "AbstractDatabaseServer.h" 34 #include "AbstractSQLStatementBackend.h" 34 35 #include "Database.h" 35 36 #include "DatabaseManager.h" 36 37 #include "Logging.h" 37 #include "SQLError.h"38 #include "SQLStatementBackend.h"39 38 #include "SQLStatementCallback.h" 40 39 #include "SQLStatementErrorCallback.h" … … 60 59 } 61 60 62 void SQLStatement::setBackend( SQLStatementBackend* backend)61 void SQLStatement::setBackend(AbstractSQLStatementBackend* backend) 63 62 { 64 63 m_backend = backend; -
trunk/Source/WebCore/Modules/webdatabase/SQLStatement.h
r143090 r143264 31 31 #if ENABLE(SQL_DATABASE) 32 32 33 #include "AbstractSQLStatement.h" 33 34 #include "SQLCallbackWrapper.h" 34 35 #include "SQLResultSet.h" … … 40 41 namespace WebCore { 41 42 43 class AbstractSQLStatementBackend; 42 44 class Database; 43 45 class SQLError; 44 class SQLStatementBackend;45 46 class SQLStatementCallback; 46 47 class SQLStatementErrorCallback; 47 48 class SQLTransaction; 48 49 49 class SQLStatement {50 class SQLStatement : public AbstractSQLStatement { 50 51 public: 51 52 static PassOwnPtr<SQLStatement> create(Database*, … … 54 55 bool performCallback(SQLTransaction*); 55 56 56 v oid setBackend(SQLStatementBackend*);57 virtual void setBackend(AbstractSQLStatementBackend*); 57 58 58 bool hasCallback();59 bool hasErrorCallback();59 virtual bool hasCallback(); 60 virtual bool hasErrorCallback(); 60 61 61 62 private: 62 63 SQLStatement(Database*, PassRefPtr<SQLStatementCallback>, PassRefPtr<SQLStatementErrorCallback>); 63 64 64 // The SQLStatementBackend owns the SQLStatement. Hence, the backend is65 // The AbstractSQLStatementBackend owns the SQLStatement. Hence, the backend is 65 66 // guaranteed to be outlive the SQLStatement, and it is safe for us to refer 66 67 // to the backend using a raw pointer here. 67 SQLStatementBackend* m_backend;68 AbstractSQLStatementBackend* m_backend; 68 69 69 70 SQLCallbackWrapper<SQLStatementCallback> m_statementCallbackWrapper; -
trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.cpp
r143090 r143264 31 31 #if ENABLE(SQL_DATABASE) 32 32 33 #include "AbstractSQLStatement.h" 33 34 #include "DatabaseBackendAsync.h" 34 35 #include "Logging.h" 35 36 #include "SQLError.h" 36 #include "SQLStatement.h"37 #include "SQLStatementCallback.h"38 #include "SQLStatementErrorCallback.h"39 37 #include "SQLValue.h" 40 38 #include "SQLiteDatabase.h" … … 77 75 namespace WebCore { 78 76 79 PassRefPtr<SQLStatementBackend> SQLStatementBackend::create(PassOwnPtr< SQLStatement> frontend,77 PassRefPtr<SQLStatementBackend> SQLStatementBackend::create(PassOwnPtr<AbstractSQLStatement> frontend, 80 78 const String& statement, const Vector<SQLValue>& arguments, int permissions) 81 79 { … … 83 81 } 84 82 85 SQLStatementBackend::SQLStatementBackend(PassOwnPtr< SQLStatement> frontend,83 SQLStatementBackend::SQLStatementBackend(PassOwnPtr<AbstractSQLStatement> frontend, 86 84 const String& statement, const Vector<SQLValue>& arguments, int permissions) 87 85 : m_frontend(frontend) … … 95 93 } 96 94 97 SQLStatement* SQLStatementBackend::frontend()95 AbstractSQLStatement* SQLStatementBackend::frontend() 98 96 { 99 97 return m_frontend.get(); -
trunk/Source/WebCore/Modules/webdatabase/SQLStatementBackend.h
r143090 r143264 31 31 #if ENABLE(SQL_DATABASE) 32 32 33 #include " SQLResultSet.h"33 #include "AbstractSQLStatementBackend.h" 34 34 #include "SQLValue.h" 35 35 #include <wtf/Forward.h> 36 #include <wtf/PassOwnPtr.h> 36 37 #include <wtf/Vector.h> 37 38 #include <wtf/text/WTFString.h> … … 39 40 namespace WebCore { 40 41 42 class AbstractSQLStatement; 41 43 class DatabaseBackendAsync; 42 44 class SQLError; 43 class SQLStatement;44 45 class SQLTransactionBackend; 45 46 46 class SQLStatementBackend : public ThreadSafeRefCounted<SQLStatementBackend>{47 class SQLStatementBackend : public AbstractSQLStatementBackend { 47 48 public: 48 static PassRefPtr<SQLStatementBackend> create(PassOwnPtr< SQLStatement>,49 static PassRefPtr<SQLStatementBackend> create(PassOwnPtr<AbstractSQLStatement>, 49 50 const String& sqlStatement, const Vector<SQLValue>& arguments, int permissions); 50 51 … … 58 59 void setVersionMismatchedError(DatabaseBackendAsync*); 59 60 60 SQLStatement* frontend();61 PassRefPtr<SQLError> sqlError() const;62 PassRefPtr<SQLResultSet> sqlResultSet() const;61 AbstractSQLStatement* frontend(); 62 virtual PassRefPtr<SQLError> sqlError() const; 63 virtual PassRefPtr<SQLResultSet> sqlResultSet() const; 63 64 64 65 private: 65 SQLStatementBackend(PassOwnPtr< SQLStatement>, const String& statement,66 SQLStatementBackend(PassOwnPtr<AbstractSQLStatement>, const String& statement, 66 67 const Vector<SQLValue>& arguments, int permissions); 67 68 … … 69 70 void clearFailureDueToQuota(); 70 71 71 OwnPtr< SQLStatement> m_frontend;72 OwnPtr<AbstractSQLStatement> m_frontend; 72 73 String m_statement; 73 74 Vector<SQLValue> m_arguments; -
trunk/Source/WebCore/Modules/webdatabase/SQLTransaction.cpp
r143090 r143264 175 175 m_executeSqlAllowed = true; 176 176 177 SQLStatement* currentStatement = m_backend->currentStatement(); 177 AbstractSQLStatement* currentAbstractStatement = m_backend->currentStatement(); 178 SQLStatement* currentStatement = static_cast<SQLStatement*>(currentAbstractStatement); 178 179 ASSERT(currentStatement); 179 180 -
trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.cpp
r143090 r143264 40 40 #include "Logging.h" 41 41 #include "SQLError.h" 42 #include "SQLStatement.h"43 42 #include "SQLStatementBackend.h" 44 #include "SQLStatementCallback.h" // FIXME: remove when SQLStatement has been refactored.45 #include "SQLStatementErrorCallback.h" // FIXME: remove when SQLStatement has been refactored.46 43 #include "SQLTransaction.h" 47 44 #include "SQLTransactionClient.h" … … 378 375 } 379 376 380 SQLStatement* SQLTransactionBackend::currentStatement()377 AbstractSQLStatement* SQLTransactionBackend::currentStatement() 381 378 { 382 379 return m_currentStatementBackend->frontend(); … … 464 461 } 465 462 466 void SQLTransactionBackend::executeSQL(PassOwnPtr< SQLStatement> statement,463 void SQLTransactionBackend::executeSQL(PassOwnPtr<AbstractSQLStatement> statement, 467 464 const String& sqlStatement, const Vector<SQLValue>& arguments, int permissions) 468 465 { -
trunk/Source/WebCore/Modules/webdatabase/SQLTransactionBackend.h
r143090 r143264 31 31 #if ENABLE(SQL_DATABASE) 32 32 33 #include "AbstractSQLStatement.h" 33 34 #include "DatabaseBasicTypes.h" 34 35 #include "SQLTransactionStateMachine.h" … … 42 43 class SQLError; 43 44 class SQLiteTransaction; 44 class SQLStatement;45 45 class SQLStatementBackend; 46 46 class SQLTransaction; … … 72 72 73 73 // APIs for the frontend: 74 SQLStatement* currentStatement();74 AbstractSQLStatement* currentStatement(); 75 75 PassRefPtr<SQLError> transactionError(); 76 76 void setShouldRetryCurrentStatement(bool); 77 77 78 void executeSQL(PassOwnPtr< SQLStatement>, const String& statement,78 void executeSQL(PassOwnPtr<AbstractSQLStatement>, const String& statement, 79 79 const Vector<SQLValue>& arguments, int permissions); 80 80 -
trunk/Source/WebCore/Target.pri
r143136 r143264 1458 1458 \ 1459 1459 Modules/webdatabase/AbstractDatabaseServer.h \ 1460 Modules/webdatabase/AbstractSQLStatement.h \ 1461 Modules/webdatabase/AbstractSQLStatementBackend.h \ 1460 1462 Modules/webdatabase/ChangeVersionData.h \ 1461 1463 Modules/webdatabase/ChangeVersionWrapper.h \ -
trunk/Source/WebCore/WebCore.gypi
r143196 r143264 985 985 'Modules/webaudio/WaveTable.h', 986 986 'Modules/webdatabase/AbstractDatabaseServer.h', 987 'Modules/webdatabase/AbstractSQLStatement.h', 988 'Modules/webdatabase/AbstractSQLStatementBackend.h', 987 989 'Modules/webdatabase/ChangeVersionData.h', 988 990 'Modules/webdatabase/ChangeVersionWrapper.cpp', -
trunk/Source/WebCore/WebCore.vcproj/WebCore.vcproj
r143196 r143264 25379 25379 </File> 25380 25380 <File 25381 RelativePath="..\Modules\webdatabase\AbstractSQLStatement.h" 25382 > 25383 </File> 25384 <File 25385 RelativePath="..\Modules\webdatabase\AbstractSQLStatementBackend.h" 25386 > 25387 </File> 25388 <File 25381 25389 RelativePath="..\Modules\webdatabase\ChangeVersionData.h" 25382 25390 > -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj
r143090 r143264 6419 6419 <ClInclude Include="..\Modules\notifications\WorkerContextNotifications.h" /> 6420 6420 <ClInclude Include="..\Modules\webdatabase\AbstractDatabaseServer.h" /> 6421 <ClInclude Include="..\Modules\webdatabase\AbstractSQLStatement.h" /> 6422 <ClInclude Include="..\Modules\webdatabase\AbstractSQLStatementBackend.h" /> 6421 6423 <ClInclude Include="..\Modules\webdatabase\ChangeVersionData.h" /> 6422 6424 <ClInclude Include="..\Modules\webdatabase\ChangeVersionWrapper.h" /> -
trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters
r143090 r143264 8485 8485 <Filter>Modules\webdatabase</Filter> 8486 8486 </ClInclude> 8487 <ClInclude Include="..\Modules\webdatabase\AbstractSQLStatement.h"> 8488 <Filter>Modules\webdatabase</Filter> 8489 </ClInclude> 8490 <ClInclude Include="..\Modules\webdatabase\AbstractSQLStatementBackend.h"> 8491 <Filter>Modules\webdatabase</Filter> 8492 </ClInclude> 8487 8493 <ClInclude Include="..\Modules\webdatabase\ChangeVersionData.h"> 8488 8494 <Filter>Modules\webdatabase</Filter> -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r143259 r143264 6790 6790 FE456F181677D74E005EDDF9 /* DatabaseManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE456F161677D74E005EDDF9 /* DatabaseManager.cpp */; }; 6791 6791 FE456F191677D74E005EDDF9 /* DatabaseManager.h in Headers */ = {isa = PBXBuildFile; fileRef = FE456F171677D74E005EDDF9 /* DatabaseManager.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6792 FE4AADEE16D2C37400026FFC /* AbstractSQLStatement.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4AADEC16D2C37400026FFC /* AbstractSQLStatement.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6793 FE4AADEF16D2C37400026FFC /* AbstractSQLStatementBackend.h in Headers */ = {isa = PBXBuildFile; fileRef = FE4AADED16D2C37400026FFC /* AbstractSQLStatementBackend.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6792 6794 FE6F6AAF169E057500FC30A2 /* DatabaseBackendContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FE6F6AAD169E057500FC30A2 /* DatabaseBackendContext.cpp */; }; 6793 6795 FE6F6AB0169E057500FC30A2 /* DatabaseBackendContext.h in Headers */ = {isa = PBXBuildFile; fileRef = FE6F6AAE169E057500FC30A2 /* DatabaseBackendContext.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 14543 14545 FE456F161677D74E005EDDF9 /* DatabaseManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DatabaseManager.cpp; path = Modules/webdatabase/DatabaseManager.cpp; sourceTree = "<group>"; }; 14544 14546 FE456F171677D74E005EDDF9 /* DatabaseManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DatabaseManager.h; path = Modules/webdatabase/DatabaseManager.h; sourceTree = "<group>"; }; 14547 FE4AADEC16D2C37400026FFC /* AbstractSQLStatement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AbstractSQLStatement.h; path = Modules/webdatabase/AbstractSQLStatement.h; sourceTree = "<group>"; }; 14548 FE4AADED16D2C37400026FFC /* AbstractSQLStatementBackend.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AbstractSQLStatementBackend.h; path = Modules/webdatabase/AbstractSQLStatementBackend.h; sourceTree = "<group>"; }; 14545 14549 FE6F6AAD169E057500FC30A2 /* DatabaseBackendContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DatabaseBackendContext.cpp; path = Modules/webdatabase/DatabaseBackendContext.cpp; sourceTree = "<group>"; }; 14546 14550 FE6F6AAE169E057500FC30A2 /* DatabaseBackendContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DatabaseBackendContext.h; path = Modules/webdatabase/DatabaseBackendContext.h; sourceTree = "<group>"; }; … … 18660 18664 children = ( 18661 18665 FE115FA9167988CD00249134 /* AbstractDatabaseServer.h */, 18666 FE4AADEC16D2C37400026FFC /* AbstractSQLStatement.h */, 18667 FE4AADED16D2C37400026FFC /* AbstractSQLStatementBackend.h */, 18662 18668 FE36FD1116C7826400F887C1 /* ChangeVersionData.h */, 18663 18669 97BC69D81505F076001B74AC /* ChangeVersionWrapper.cpp */, … … 23186 23192 files = ( 23187 23193 FE115FAB167988CD00249134 /* AbstractDatabaseServer.h in Headers */, 23194 FE4AADEE16D2C37400026FFC /* AbstractSQLStatement.h in Headers */, 23195 FE4AADEF16D2C37400026FFC /* AbstractSQLStatementBackend.h in Headers */, 23188 23196 41E1B1D10FF5986900576B3B /* AbstractWorker.h in Headers */, 23189 23197 29A8122E0FBB9C1D00510293 /* AccessibilityARIAGridCell.h in Headers */,
Note: See TracChangeset
for help on using the changeset viewer.