| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 | 32 |
| 33 #include "V8SQLTransaction.h" | 33 #include "V8SQLTransaction.h" |
| 34 | 34 |
| 35 #include "V8SQLStatementCallback.h" | 35 #include "V8SQLStatementCallback.h" |
| 36 #include "V8SQLStatementErrorCallback.h" | 36 #include "V8SQLStatementErrorCallback.h" |
| 37 #include "bindings/v8/ExceptionState.h" | |
| 38 #include "bindings/v8/V8Binding.h" | 37 #include "bindings/v8/V8Binding.h" |
| 39 #include "core/dom/ExceptionCode.h" | 38 #include "core/dom/ExceptionCode.h" |
| 40 #include "core/platform/sql/SQLValue.h" | 39 #include "core/platform/sql/SQLValue.h" |
| 41 #include "modules/webdatabase/Database.h" | 40 #include "modules/webdatabase/Database.h" |
| 42 #include "wtf/Vector.h" | 41 #include "wtf/Vector.h" |
| 43 | 42 |
| 44 using namespace WTF; | 43 using namespace WTF; |
| 45 | 44 |
| 46 namespace WebCore { | 45 namespace WebCore { |
| 47 | 46 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 101 |
| 103 RefPtr<SQLStatementErrorCallback> errorCallback; | 102 RefPtr<SQLStatementErrorCallback> errorCallback; |
| 104 if (args.Length() > 3 && !isUndefinedOrNull(args[3])) { | 103 if (args.Length() > 3 && !isUndefinedOrNull(args[3])) { |
| 105 if (!args[3]->IsObject()) { | 104 if (!args[3]->IsObject()) { |
| 106 setDOMException(TypeMismatchError, args.GetIsolate()); | 105 setDOMException(TypeMismatchError, args.GetIsolate()); |
| 107 return; | 106 return; |
| 108 } | 107 } |
| 109 errorCallback = V8SQLStatementErrorCallback::create(args[3], scriptExecu
tionContext); | 108 errorCallback = V8SQLStatementErrorCallback::create(args[3], scriptExecu
tionContext); |
| 110 } | 109 } |
| 111 | 110 |
| 112 ExceptionState es(args.GetIsolate()); | 111 ExceptionCode ec = 0; |
| 113 transaction->executeSQL(statement, sqlValues, callback, errorCallback, es); | 112 transaction->executeSQL(statement, sqlValues, callback, errorCallback, ec); |
| 114 es.throwIfNeeded(); | 113 setDOMException(ec, args.GetIsolate()); |
| 115 } | 114 } |
| 116 | 115 |
| 117 } // namespace WebCore | 116 } // namespace WebCore |
| OLD | NEW |