| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 SQLStatementCallback* callback, SQLStatementErrorCallback* errorCallback) | 47 SQLStatementCallback* callback, SQLStatementErrorCallback* errorCallback) |
| 48 { | 48 { |
| 49 return new SQLStatement(database, callback, errorCallback); | 49 return new SQLStatement(database, callback, errorCallback); |
| 50 } | 50 } |
| 51 | 51 |
| 52 SQLStatement::SQLStatement(Database* database, SQLStatementCallback* callback, | 52 SQLStatement::SQLStatement(Database* database, SQLStatementCallback* callback, |
| 53 SQLStatementErrorCallback* errorCallback) | 53 SQLStatementErrorCallback* errorCallback) |
| 54 : m_statementCallback(callback) | 54 : m_statementCallback(callback) |
| 55 , m_statementErrorCallback(errorCallback) | 55 , m_statementErrorCallback(errorCallback) |
| 56 { | 56 { |
| 57 DCHECK(isMainThread()); | |
| 58 | |
| 59 if (hasCallback() || hasErrorCallback()) | 57 if (hasCallback() || hasErrorCallback()) |
| 60 InspectorInstrumentation::asyncTaskScheduled(database->getExecutionConte
xt(), "SQLStatement", this); | 58 InspectorInstrumentation::asyncTaskScheduled(database->getExecutionConte
xt(), "SQLStatement", this); |
| 61 } | 59 } |
| 62 | 60 |
| 63 DEFINE_TRACE(SQLStatement) | 61 DEFINE_TRACE(SQLStatement) |
| 64 { | 62 { |
| 65 visitor->trace(m_backend); | 63 visitor->trace(m_backend); |
| 66 visitor->trace(m_statementCallback); | 64 visitor->trace(m_statementCallback); |
| 67 visitor->trace(m_statementErrorCallback); | 65 visitor->trace(m_statementErrorCallback); |
| 68 } | 66 } |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 if (errorCallback) | 99 if (errorCallback) |
| 102 callbackError = errorCallback->handleEvent(transaction, SQLError::cr
eate(*error)); | 100 callbackError = errorCallback->handleEvent(transaction, SQLError::cr
eate(*error)); |
| 103 } else if (callback) { | 101 } else if (callback) { |
| 104 callbackError = !callback->handleEvent(transaction, m_backend->sqlResult
Set()); | 102 callbackError = !callback->handleEvent(transaction, m_backend->sqlResult
Set()); |
| 105 } | 103 } |
| 106 | 104 |
| 107 return callbackError; | 105 return callbackError; |
| 108 } | 106 } |
| 109 | 107 |
| 110 } // namespace blink | 108 } // namespace blink |
| OLD | NEW |