| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2013 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | 22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
| 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 */ | 27 */ |
| 28 #ifndef SQLStatementBackend_h | 28 #ifndef SQLStatementBackend_h |
| 29 #define SQLStatementBackend_h | 29 #define SQLStatementBackend_h |
| 30 | 30 |
| 31 #include "modules/webdatabase/sqlite/SQLValue.h" | 31 #include "modules/webdatabase/sqlite/SQLValue.h" |
| 32 #include "modules/webdatabase/AbstractSQLStatementBackend.h" | 32 #include "platform/heap/Handle.h" |
| 33 #include "wtf/Forward.h" | 33 #include "wtf/Forward.h" |
| 34 #include "wtf/PassOwnPtr.h" | 34 #include "wtf/PassOwnPtr.h" |
| 35 #include "wtf/Vector.h" | 35 #include "wtf/Vector.h" |
| 36 #include "wtf/text/WTFString.h" | 36 #include "wtf/text/WTFString.h" |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 class AbstractSQLStatement; | |
| 41 class DatabaseBackend; | 40 class DatabaseBackend; |
| 42 class SQLErrorData; | 41 class SQLErrorData; |
| 42 class SQLResultSet; |
| 43 class SQLStatement; |
| 43 class SQLTransactionBackend; | 44 class SQLTransactionBackend; |
| 44 | 45 |
| 45 class SQLStatementBackend FINAL : public AbstractSQLStatementBackend { | 46 class SQLStatementBackend FINAL : public ThreadSafeRefCountedWillBeGarbageCollec
tedFinalized<SQLStatementBackend> { |
| 46 public: | 47 public: |
| 47 static PassRefPtrWillBeRawPtr<SQLStatementBackend> create(PassOwnPtrWillBeRa
wPtr<AbstractSQLStatement>, | 48 static PassRefPtrWillBeRawPtr<SQLStatementBackend> create(PassOwnPtrWillBeRa
wPtr<SQLStatement>, |
| 48 const String& sqlStatement, const Vector<SQLValue>& arguments, int permi
ssions); | 49 const String& sqlStatement, const Vector<SQLValue>& arguments, int permi
ssions); |
| 49 virtual void trace(Visitor*) OVERRIDE; | 50 void trace(Visitor*); |
| 50 | 51 |
| 51 bool execute(DatabaseBackend*); | 52 bool execute(DatabaseBackend*); |
| 52 bool lastExecutionFailedDueToQuota() const; | 53 bool lastExecutionFailedDueToQuota() const; |
| 53 | 54 |
| 54 bool hasStatementCallback() const { return m_hasCallback; } | 55 bool hasStatementCallback() const { return m_hasCallback; } |
| 55 bool hasStatementErrorCallback() const { return m_hasErrorCallback; } | 56 bool hasStatementErrorCallback() const { return m_hasErrorCallback; } |
| 56 | 57 |
| 57 void setVersionMismatchedError(DatabaseBackend*); | 58 void setVersionMismatchedError(DatabaseBackend*); |
| 58 | 59 |
| 59 AbstractSQLStatement* frontend(); | 60 SQLStatement* frontend(); |
| 60 virtual SQLErrorData* sqlError() const OVERRIDE; | 61 SQLErrorData* sqlError() const; |
| 61 virtual SQLResultSet* sqlResultSet() const OVERRIDE; | 62 SQLResultSet* sqlResultSet() const; |
| 62 | 63 |
| 63 private: | 64 private: |
| 64 SQLStatementBackend(PassOwnPtrWillBeRawPtr<AbstractSQLStatement>, const Stri
ng& statement, | 65 SQLStatementBackend(PassOwnPtrWillBeRawPtr<SQLStatement>, const String& stat
ement, |
| 65 const Vector<SQLValue>& arguments, int permissions); | 66 const Vector<SQLValue>& arguments, int permissions); |
| 66 | 67 |
| 67 void setFailureDueToQuota(DatabaseBackend*); | 68 void setFailureDueToQuota(DatabaseBackend*); |
| 68 void clearFailureDueToQuota(); | 69 void clearFailureDueToQuota(); |
| 69 | 70 |
| 70 OwnPtrWillBeMember<AbstractSQLStatement> m_frontend; | 71 OwnPtrWillBeMember<SQLStatement> m_frontend; |
| 71 String m_statement; | 72 String m_statement; |
| 72 Vector<SQLValue> m_arguments; | 73 Vector<SQLValue> m_arguments; |
| 73 bool m_hasCallback; | 74 bool m_hasCallback; |
| 74 bool m_hasErrorCallback; | 75 bool m_hasErrorCallback; |
| 75 | 76 |
| 76 OwnPtr<SQLErrorData> m_error; | 77 OwnPtr<SQLErrorData> m_error; |
| 77 RefPtrWillBeMember<SQLResultSet> m_resultSet; | 78 RefPtrWillBeMember<SQLResultSet> m_resultSet; |
| 78 | 79 |
| 79 int m_permissions; | 80 int m_permissions; |
| 80 }; | 81 }; |
| 81 | 82 |
| 82 } // namespace blink | 83 } // namespace blink |
| 83 | 84 |
| 84 #endif // SQLStatementBackend_h | 85 #endif // SQLStatementBackend_h |
| OLD | NEW |