OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 , m_readOnly(readOnly) | 66 , m_readOnly(readOnly) |
67 { | 67 { |
68 ASSERT(m_database); | 68 ASSERT(m_database); |
69 ScriptWrappable::init(this); | 69 ScriptWrappable::init(this); |
70 } | 70 } |
71 | 71 |
72 void SQLTransaction::trace(Visitor* visitor) | 72 void SQLTransaction::trace(Visitor* visitor) |
73 { | 73 { |
74 visitor->trace(m_database); | 74 visitor->trace(m_database); |
75 visitor->trace(m_backend); | 75 visitor->trace(m_backend); |
| 76 visitor->trace(m_callbackWrapper); |
| 77 visitor->trace(m_successCallbackWrapper); |
| 78 visitor->trace(m_errorCallbackWrapper); |
76 AbstractSQLTransaction::trace(visitor); | 79 AbstractSQLTransaction::trace(visitor); |
77 } | 80 } |
78 | 81 |
79 bool SQLTransaction::hasCallback() const | 82 bool SQLTransaction::hasCallback() const |
80 { | 83 { |
81 return m_callbackWrapper.hasCallback(); | 84 return m_callbackWrapper.hasCallback(); |
82 } | 85 } |
83 | 86 |
84 bool SQLTransaction::hasSuccessCallback() const | 87 bool SQLTransaction::hasSuccessCallback() const |
85 { | 88 { |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 exceptionState.throwDOMException(InvalidStateError, "The database has no
t been opened."); | 274 exceptionState.throwDOMException(InvalidStateError, "The database has no
t been opened."); |
272 return; | 275 return; |
273 } | 276 } |
274 | 277 |
275 int permissions = DatabaseAuthorizer::ReadWriteMask; | 278 int permissions = DatabaseAuthorizer::ReadWriteMask; |
276 if (!m_database->databaseContext()->allowDatabaseAccess()) | 279 if (!m_database->databaseContext()->allowDatabaseAccess()) |
277 permissions |= DatabaseAuthorizer::NoAccessMask; | 280 permissions |= DatabaseAuthorizer::NoAccessMask; |
278 else if (m_readOnly) | 281 else if (m_readOnly) |
279 permissions |= DatabaseAuthorizer::ReadOnlyMask; | 282 permissions |= DatabaseAuthorizer::ReadOnlyMask; |
280 | 283 |
281 OwnPtr<SQLStatement> statement = SQLStatement::create(m_database.get(), call
back, callbackError); | 284 OwnPtrWillBeRawPtr<SQLStatement> statement = SQLStatement::create(m_database
.get(), callback, callbackError); |
282 m_backend->executeSQL(statement.release(), sqlStatement, arguments, permissi
ons); | 285 m_backend->executeSQL(statement.release(), sqlStatement, arguments, permissi
ons); |
283 } | 286 } |
284 | 287 |
285 bool SQLTransaction::computeNextStateAndCleanupIfNeeded() | 288 bool SQLTransaction::computeNextStateAndCleanupIfNeeded() |
286 { | 289 { |
287 // Only honor the requested state transition if we're not supposed to be | 290 // Only honor the requested state transition if we're not supposed to be |
288 // cleaning up and shutting down: | 291 // cleaning up and shutting down: |
289 if (m_database->opened() && !m_database->isInterrupted()) { | 292 if (m_database->opened() && !m_database->isInterrupted()) { |
290 setStateToRequestedState(); | 293 setStateToRequestedState(); |
291 ASSERT(m_nextState == SQLTransactionState::End | 294 ASSERT(m_nextState == SQLTransactionState::End |
(...skipping 20 matching lines...) Expand all Loading... |
312 m_successCallbackWrapper.clear(); | 315 m_successCallbackWrapper.clear(); |
313 m_errorCallbackWrapper.clear(); | 316 m_errorCallbackWrapper.clear(); |
314 } | 317 } |
315 | 318 |
316 PassOwnPtr<SQLTransactionErrorCallback> SQLTransaction::releaseErrorCallback() | 319 PassOwnPtr<SQLTransactionErrorCallback> SQLTransaction::releaseErrorCallback() |
317 { | 320 { |
318 return m_errorCallbackWrapper.unwrap(); | 321 return m_errorCallbackWrapper.unwrap(); |
319 } | 322 } |
320 | 323 |
321 } // namespace WebCore | 324 } // namespace WebCore |
OLD | NEW |