| 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 | 28 |
| 29 #ifndef SQLTransaction_h | 29 #ifndef SQLTransaction_h |
| 30 #define SQLTransaction_h | 30 #define SQLTransaction_h |
| 31 | 31 |
| 32 #include "bindings/core/v8/Nullable.h" |
| 32 #include "bindings/core/v8/ScriptWrappable.h" | 33 #include "bindings/core/v8/ScriptWrappable.h" |
| 34 #include "bindings/modules/v8/V8BindingForModules.h" |
| 33 #include "modules/webdatabase/SQLStatement.h" | 35 #include "modules/webdatabase/SQLStatement.h" |
| 34 #include "modules/webdatabase/SQLTransactionStateMachine.h" | 36 #include "modules/webdatabase/SQLTransactionStateMachine.h" |
| 35 #include "platform/heap/Handle.h" | 37 #include "platform/heap/Handle.h" |
| 36 | 38 |
| 37 namespace blink { | 39 namespace blink { |
| 38 | 40 |
| 39 class Database; | 41 class Database; |
| 40 class ExceptionState; | 42 class ExceptionState; |
| 41 class SQLErrorData; | 43 class SQLErrorData; |
| 42 class SQLStatementCallback; | 44 class SQLStatementCallback; |
| 43 class SQLStatementErrorCallback; | 45 class SQLStatementErrorCallback; |
| 44 class SQLTransactionBackend; | 46 class SQLTransactionBackend; |
| 45 class SQLTransactionCallback; | 47 class SQLTransactionCallback; |
| 46 class SQLTransactionErrorCallback; | 48 class SQLTransactionErrorCallback; |
| 47 class SQLValue; | 49 class SQLValue; |
| 50 class ScriptValue; |
| 48 class VoidCallback; | 51 class VoidCallback; |
| 49 | 52 |
| 50 class SQLTransaction final | 53 class SQLTransaction final |
| 51 : public GarbageCollectedFinalized<SQLTransaction> | 54 : public GarbageCollectedFinalized<SQLTransaction> |
| 52 , public SQLTransactionStateMachine<SQLTransaction> | 55 , public SQLTransactionStateMachine<SQLTransaction> |
| 53 , public ScriptWrappable { | 56 , public ScriptWrappable { |
| 54 DEFINE_WRAPPERTYPEINFO(); | 57 DEFINE_WRAPPERTYPEINFO(); |
| 55 public: | 58 public: |
| 56 static SQLTransaction* create(Database*, SQLTransactionCallback*, | 59 static SQLTransaction* create(Database*, SQLTransactionCallback*, |
| 57 VoidCallback* successCallback, SQLTransactionErrorCallback*, bool readOn
ly); | 60 VoidCallback* successCallback, SQLTransactionErrorCallback*, bool readOn
ly); |
| 58 ~SQLTransaction(); | 61 ~SQLTransaction(); |
| 59 DECLARE_TRACE(); | 62 DECLARE_TRACE(); |
| 60 | 63 |
| 61 void performPendingCallback(); | 64 void performPendingCallback(); |
| 62 | 65 |
| 63 void executeSQL(const String& sqlStatement, const Vector<SQLValue>& argument
s, | 66 void executeSQL(const String& sqlStatement, const Vector<SQLValue>& argument
s, |
| 64 SQLStatementCallback*, SQLStatementErrorCallback*, ExceptionState&); | 67 SQLStatementCallback*, SQLStatementErrorCallback*, ExceptionState&); |
| 68 void executeSql(ScriptState*, const String& sqlStatement, ExceptionState&); |
| 69 void executeSql(ScriptState*, const String& sqlStatement, const Nullable<Vec
tor<ScriptValue>>& arguments, |
| 70 SQLStatementCallback*, SQLStatementErrorCallback*, ExceptionState&); |
| 65 | 71 |
| 66 Database* database() { return m_database.get(); } | 72 Database* database() { return m_database.get(); } |
| 67 | 73 |
| 68 SQLTransactionErrorCallback* releaseErrorCallback(); | 74 SQLTransactionErrorCallback* releaseErrorCallback(); |
| 69 | 75 |
| 70 // APIs called from the backend published: | 76 // APIs called from the backend published: |
| 71 void requestTransitToState(SQLTransactionState); | 77 void requestTransitToState(SQLTransactionState); |
| 72 bool hasCallback() const; | 78 bool hasCallback() const; |
| 73 bool hasSuccessCallback() const; | 79 bool hasSuccessCallback() const; |
| 74 bool hasErrorCallback() const; | 80 bool hasErrorCallback() const; |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 bool m_executeSqlAllowed; | 112 bool m_executeSqlAllowed; |
| 107 OwnPtr<SQLErrorData> m_transactionError; | 113 OwnPtr<SQLErrorData> m_transactionError; |
| 108 | 114 |
| 109 bool m_readOnly; | 115 bool m_readOnly; |
| 110 int m_asyncOperationId; | 116 int m_asyncOperationId; |
| 111 }; | 117 }; |
| 112 | 118 |
| 113 } // namespace blink | 119 } // namespace blink |
| 114 | 120 |
| 115 #endif // SQLTransaction_h | 121 #endif // SQLTransaction_h |
| OLD | NEW |