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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
310 exception_state); | 310 exception_state); |
311 } | 311 } |
312 | 312 |
313 void SQLTransaction::executeSql(ScriptState* script_state, | 313 void SQLTransaction::executeSql(ScriptState* script_state, |
314 const String& sql_statement, | 314 const String& sql_statement, |
315 const Nullable<Vector<ScriptValue>>& arguments, | 315 const Nullable<Vector<ScriptValue>>& arguments, |
316 SQLStatementCallback* callback, | 316 SQLStatementCallback* callback, |
317 SQLStatementErrorCallback* callback_error, | 317 SQLStatementErrorCallback* callback_error, |
318 ExceptionState& exception_state) { | 318 ExceptionState& exception_state) { |
319 Vector<SQLValue> sql_values; | 319 Vector<SQLValue> sql_values; |
320 if (!arguments.IsNull()) | 320 sql_values.ReserveInitialCapacity(arguments.Get().size()); |
321 sql_values = ToImplArray<Vector<SQLValue>>( | 321 for (const auto& script_value : arguments.Get()) { |
322 arguments.Get(), script_state->GetIsolate(), exception_state); | 322 sql_values.emplace_back(ScriptValue::To<SQLValue>( |
323 ExecuteSQL(sql_statement, sql_values, callback, callback_error, | 323 script_state->GetIsolate(), script_value, exception_state)); |
jsbell
2017/04/10 21:09:24
What happened to this ExecuteSQL() call?
| |
324 exception_state); | 324 } |
325 } | 325 } |
326 | 326 |
327 bool SQLTransaction::ComputeNextStateAndCleanupIfNeeded() { | 327 bool SQLTransaction::ComputeNextStateAndCleanupIfNeeded() { |
328 // Only honor the requested state transition if we're not supposed to be | 328 // Only honor the requested state transition if we're not supposed to be |
329 // cleaning up and shutting down: | 329 // cleaning up and shutting down: |
330 if (database_->Opened()) { | 330 if (database_->Opened()) { |
331 SetStateToRequestedState(); | 331 SetStateToRequestedState(); |
332 ASSERT(next_state_ == SQLTransactionState::kEnd || | 332 ASSERT(next_state_ == SQLTransactionState::kEnd || |
333 next_state_ == SQLTransactionState::kDeliverTransactionCallback || | 333 next_state_ == SQLTransactionState::kDeliverTransactionCallback || |
334 next_state_ == | 334 next_state_ == |
(...skipping 17 matching lines...) Expand all Loading... | |
352 callback_.Clear(); | 352 callback_.Clear(); |
353 success_callback_.Clear(); | 353 success_callback_.Clear(); |
354 error_callback_.Clear(); | 354 error_callback_.Clear(); |
355 } | 355 } |
356 | 356 |
357 SQLTransactionErrorCallback* SQLTransaction::ReleaseErrorCallback() { | 357 SQLTransactionErrorCallback* SQLTransaction::ReleaseErrorCallback() { |
358 return error_callback_.Release(); | 358 return error_callback_.Release(); |
359 } | 359 } |
360 | 360 |
361 } // namespace blink | 361 } // namespace blink |
OLD | NEW |