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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 bool SQLStatement::performCallback(SQLTransaction* transaction) | 73 bool SQLStatement::performCallback(SQLTransaction* transaction) |
74 { | 74 { |
75 ASSERT(transaction); | 75 ASSERT(transaction); |
76 ASSERT(m_backend); | 76 ASSERT(m_backend); |
77 | 77 |
78 bool callbackError = false; | 78 bool callbackError = false; |
79 | 79 |
80 OwnPtr<SQLStatementCallback> callback = m_statementCallbackWrapper.unwrap(); | 80 OwnPtr<SQLStatementCallback> callback = m_statementCallbackWrapper.unwrap(); |
81 OwnPtr<SQLStatementErrorCallback> errorCallback = m_statementErrorCallbackWr
apper.unwrap(); | 81 OwnPtr<SQLStatementErrorCallback> errorCallback = m_statementErrorCallbackWr
apper.unwrap(); |
82 RefPtr<SQLError> error = m_backend->sqlError(); | 82 SQLErrorData* error = m_backend->sqlError(); |
83 | 83 |
84 // Call the appropriate statement callback and track if it resulted in an er
ror, | 84 // Call the appropriate statement callback and track if it resulted in an er
ror, |
85 // because then we need to jump to the transaction error callback. | 85 // because then we need to jump to the transaction error callback. |
86 if (error) { | 86 if (error) { |
87 if (errorCallback) | 87 if (errorCallback) { |
88 callbackError = errorCallback->handleEvent(transaction, error.get())
; | 88 RefPtrWillBeRawPtr<SQLError> sqlError = SQLError::create(*error); |
| 89 callbackError = errorCallback->handleEvent(transaction, sqlError.get
()); |
| 90 } |
89 } else if (callback) { | 91 } else if (callback) { |
90 RefPtrWillBeRawPtr<SQLResultSet> resultSet = m_backend->sqlResultSet(); | 92 RefPtrWillBeRawPtr<SQLResultSet> resultSet = m_backend->sqlResultSet(); |
91 callbackError = !callback->handleEvent(transaction, resultSet.get()); | 93 callbackError = !callback->handleEvent(transaction, resultSet.get()); |
92 } | 94 } |
93 | 95 |
94 return callbackError; | 96 return callbackError; |
95 } | 97 } |
96 | 98 |
97 } // namespace WebCore | 99 } // namespace WebCore |
OLD | NEW |