| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 class SQLTransactionErrorCallback; | 49 class SQLTransactionErrorCallback; |
| 50 class SQLValue; | 50 class SQLValue; |
| 51 class VoidCallback; | 51 class VoidCallback; |
| 52 | 52 |
| 53 class SQLTransaction FINAL | 53 class SQLTransaction FINAL |
| 54 : public ThreadSafeRefCountedWillBeGarbageCollectedFinalized<SQLTransaction> | 54 : public ThreadSafeRefCountedWillBeGarbageCollectedFinalized<SQLTransaction> |
| 55 , public SQLTransactionStateMachine<SQLTransaction> | 55 , public SQLTransactionStateMachine<SQLTransaction> |
| 56 , public ScriptWrappable { | 56 , public ScriptWrappable { |
| 57 DEFINE_WRAPPERTYPEINFO(); | 57 DEFINE_WRAPPERTYPEINFO(); |
| 58 public: | 58 public: |
| 59 static PassRefPtrWillBeRawPtr<SQLTransaction> create(Database*, PassOwnPtrWi
llBeRawPtr<SQLTransactionCallback>, | 59 static PassRefPtrWillBeRawPtr<SQLTransaction> create(Database*, SQLTransacti
onCallback*, |
| 60 PassOwnPtrWillBeRawPtr<VoidCallback> successCallback, PassOwnPtrWillBeRa
wPtr<SQLTransactionErrorCallback>, | 60 VoidCallback* successCallback, SQLTransactionErrorCallback*, |
| 61 bool readOnly); | 61 bool readOnly); |
| 62 ~SQLTransaction(); | 62 ~SQLTransaction(); |
| 63 void trace(Visitor*); | 63 void trace(Visitor*); |
| 64 | 64 |
| 65 void performPendingCallback(); | 65 void performPendingCallback(); |
| 66 | 66 |
| 67 void executeSQL(const String& sqlStatement, const Vector<SQLValue>& argument
s, | 67 void executeSQL(const String& sqlStatement, const Vector<SQLValue>& argument
s, |
| 68 PassOwnPtrWillBeRawPtr<SQLStatementCallback>, PassOwnPtrWillBeRawPtr<SQL
StatementErrorCallback>, ExceptionState&); | 68 SQLStatementCallback*, SQLStatementErrorCallback*, ExceptionState&); |
| 69 | 69 |
| 70 Database* database() { return m_database.get(); } | 70 Database* database() { return m_database.get(); } |
| 71 | 71 |
| 72 PassOwnPtrWillBeRawPtr<SQLTransactionErrorCallback> releaseErrorCallback(); | 72 SQLTransactionErrorCallback* releaseErrorCallback(); |
| 73 | 73 |
| 74 // APIs called from the backend published: | 74 // APIs called from the backend published: |
| 75 void requestTransitToState(SQLTransactionState); | 75 void requestTransitToState(SQLTransactionState); |
| 76 bool hasCallback() const; | 76 bool hasCallback() const; |
| 77 bool hasSuccessCallback() const; | 77 bool hasSuccessCallback() const; |
| 78 bool hasErrorCallback() const; | 78 bool hasErrorCallback() const; |
| 79 void setBackend(SQLTransactionBackend*); | 79 void setBackend(SQLTransactionBackend*); |
| 80 | 80 |
| 81 private: | 81 private: |
| 82 SQLTransaction(Database*, PassOwnPtrWillBeRawPtr<SQLTransactionCallback>, | 82 SQLTransaction(Database*, SQLTransactionCallback*, |
| 83 PassOwnPtrWillBeRawPtr<VoidCallback> successCallback, PassOwnPtrWillBeRa
wPtr<SQLTransactionErrorCallback>, | 83 VoidCallback* successCallback, SQLTransactionErrorCallback*, |
| 84 bool readOnly); | 84 bool readOnly); |
| 85 | 85 |
| 86 void clearCallbackWrappers(); | 86 void clearCallbackWrappers(); |
| 87 | 87 |
| 88 // State Machine functions: | 88 // State Machine functions: |
| 89 virtual StateFunction stateFunctionFor(SQLTransactionState) OVERRIDE; | 89 virtual StateFunction stateFunctionFor(SQLTransactionState) OVERRIDE; |
| 90 bool computeNextStateAndCleanupIfNeeded(); | 90 bool computeNextStateAndCleanupIfNeeded(); |
| 91 | 91 |
| 92 // State functions: | 92 // State functions: |
| 93 SQLTransactionState deliverTransactionCallback(); | 93 SQLTransactionState deliverTransactionCallback(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 109 | 109 |
| 110 bool m_executeSqlAllowed; | 110 bool m_executeSqlAllowed; |
| 111 OwnPtr<SQLErrorData> m_transactionError; | 111 OwnPtr<SQLErrorData> m_transactionError; |
| 112 | 112 |
| 113 bool m_readOnly; | 113 bool m_readOnly; |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 } // namespace blink | 116 } // namespace blink |
| 117 | 117 |
| 118 #endif // SQLTransaction_h | 118 #endif // SQLTransaction_h |
| OLD | NEW |