| 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 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 class AbstractSQLTransactionBackend; | 42 class AbstractSQLTransactionBackend; |
| 43 class Database; | 43 class Database; |
| 44 class ExceptionState; | 44 class ExceptionState; |
| 45 class SQLError; | 45 class SQLError; |
| 46 class SQLStatementCallback; | 46 class SQLStatementCallback; |
| 47 class SQLStatementErrorCallback; | 47 class SQLStatementErrorCallback; |
| 48 class SQLTransactionCallback; | 48 class SQLTransactionCallback; |
| 49 class SQLTransactionErrorCallback; | 49 class SQLTransactionErrorCallback; |
| 50 class SQLValue; | 50 class SQLValue; |
| 51 class VoidCallback; | 51 class SQLVoidCallback; |
| 52 | 52 |
| 53 class SQLTransaction : public SQLTransactionStateMachine<SQLTransaction>, public
AbstractSQLTransaction, public ScriptWrappable { | 53 class SQLTransaction : public SQLTransactionStateMachine<SQLTransaction>, public
AbstractSQLTransaction, public ScriptWrappable { |
| 54 public: | 54 public: |
| 55 static PassRefPtr<SQLTransaction> create(Database*, PassRefPtr<SQLTransactio
nCallback>, | 55 static PassRefPtr<SQLTransaction> create(Database*, PassRefPtr<SQLTransactio
nCallback>, |
| 56 PassRefPtr<VoidCallback> successCallback, PassRefPtr<SQLTransactionError
Callback>, | 56 PassRefPtr<SQLVoidCallback> successCallback, PassRefPtr<SQLTransactionEr
rorCallback>, |
| 57 bool readOnly); | 57 bool readOnly); |
| 58 | 58 |
| 59 void performPendingCallback(); | 59 void performPendingCallback(); |
| 60 | 60 |
| 61 void executeSQL(const String& sqlStatement, const Vector<SQLValue>& argument
s, | 61 void executeSQL(const String& sqlStatement, const Vector<SQLValue>& argument
s, |
| 62 PassRefPtr<SQLStatementCallback>, PassRefPtr<SQLStatementErrorCallback>,
ExceptionState&); | 62 PassRefPtr<SQLStatementCallback>, PassRefPtr<SQLStatementErrorCallback>,
ExceptionState&); |
| 63 | 63 |
| 64 Database* database() { return m_database.get(); } | 64 Database* database() { return m_database.get(); } |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 SQLTransaction(Database*, PassRefPtr<SQLTransactionCallback>, | 67 SQLTransaction(Database*, PassRefPtr<SQLTransactionCallback>, |
| 68 PassRefPtr<VoidCallback> successCallback, PassRefPtr<SQLTransactionError
Callback>, | 68 PassRefPtr<SQLVoidCallback> successCallback, PassRefPtr<SQLTransactionEr
rorCallback>, |
| 69 bool readOnly); | 69 bool readOnly); |
| 70 | 70 |
| 71 void clearCallbackWrappers(); | 71 void clearCallbackWrappers(); |
| 72 | 72 |
| 73 // APIs called from the backend published via AbstractSQLTransaction: | 73 // APIs called from the backend published via AbstractSQLTransaction: |
| 74 virtual void requestTransitToState(SQLTransactionState) OVERRIDE; | 74 virtual void requestTransitToState(SQLTransactionState) OVERRIDE; |
| 75 virtual bool hasCallback() const OVERRIDE; | 75 virtual bool hasCallback() const OVERRIDE; |
| 76 virtual bool hasSuccessCallback() const OVERRIDE; | 76 virtual bool hasSuccessCallback() const OVERRIDE; |
| 77 virtual bool hasErrorCallback() const OVERRIDE; | 77 virtual bool hasErrorCallback() const OVERRIDE; |
| 78 virtual void setBackend(AbstractSQLTransactionBackend*) OVERRIDE; | 78 virtual void setBackend(AbstractSQLTransactionBackend*) OVERRIDE; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 89 SQLTransactionState deliverSuccessCallback(); | 89 SQLTransactionState deliverSuccessCallback(); |
| 90 | 90 |
| 91 SQLTransactionState unreachableState(); | 91 SQLTransactionState unreachableState(); |
| 92 SQLTransactionState sendToBackendState(); | 92 SQLTransactionState sendToBackendState(); |
| 93 | 93 |
| 94 SQLTransactionState nextStateForTransactionError(); | 94 SQLTransactionState nextStateForTransactionError(); |
| 95 | 95 |
| 96 RefPtr<Database> m_database; | 96 RefPtr<Database> m_database; |
| 97 RefPtr<AbstractSQLTransactionBackend> m_backend; | 97 RefPtr<AbstractSQLTransactionBackend> m_backend; |
| 98 SQLCallbackWrapper<SQLTransactionCallback> m_callbackWrapper; | 98 SQLCallbackWrapper<SQLTransactionCallback> m_callbackWrapper; |
| 99 SQLCallbackWrapper<VoidCallback> m_successCallbackWrapper; | 99 SQLCallbackWrapper<SQLVoidCallback> m_successCallbackWrapper; |
| 100 SQLCallbackWrapper<SQLTransactionErrorCallback> m_errorCallbackWrapper; | 100 SQLCallbackWrapper<SQLTransactionErrorCallback> m_errorCallbackWrapper; |
| 101 | 101 |
| 102 bool m_executeSqlAllowed; | 102 bool m_executeSqlAllowed; |
| 103 RefPtr<SQLError> m_transactionError; | 103 RefPtr<SQLError> m_transactionError; |
| 104 | 104 |
| 105 bool m_readOnly; | 105 bool m_readOnly; |
| 106 }; | 106 }; |
| 107 | 107 |
| 108 } // namespace WebCore | 108 } // namespace WebCore |
| 109 | 109 |
| 110 #endif // SQLTransaction_h | 110 #endif // SQLTransaction_h |
| OLD | NEW |