Chromium Code Reviews| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 Vector<SQLValue> sqlValues; | 58 Vector<SQLValue> sqlValues; |
| 59 | 59 |
| 60 if (info.Length() > 1 && !isUndefinedOrNull(info[1])) { | 60 if (info.Length() > 1 && !isUndefinedOrNull(info[1])) { |
| 61 if (!info[1]->IsObject()) { | 61 if (!info[1]->IsObject()) { |
| 62 exceptionState.throwDOMException(TypeMismatchError, "The 'arguments' (2nd) argument provided is not an object."); | 62 exceptionState.throwDOMException(TypeMismatchError, "The 'arguments' (2nd) argument provided is not an object."); |
| 63 exceptionState.throwIfNeeded(); | 63 exceptionState.throwIfNeeded(); |
| 64 return; | 64 return; |
| 65 } | 65 } |
| 66 | 66 |
| 67 uint32_t sqlArgsLength = 0; | 67 uint32_t sqlArgsLength = 0; |
| 68 v8::Local<v8::Object> sqlArgsObject = info[1]->ToObject(info.GetIsolate( )); | 68 v8::Local<v8::Object> sqlArgsObject; |
|
bashi
2015/03/04 04:42:11
It seems that vivekg@ is going to remove this cust
| |
| 69 MAYBE_LOCAL_TO_LOCAL_VOID(info.GetIsolate()->GetCurrentContext(), info[1 ], sqlArgsObject); | |
| 69 TONATIVE_VOID(v8::Local<v8::Value>, length, sqlArgsObject->Get(v8AtomicS tring(info.GetIsolate(), "length"))); | 70 TONATIVE_VOID(v8::Local<v8::Value>, length, sqlArgsObject->Get(v8AtomicS tring(info.GetIsolate(), "length"))); |
| 70 | 71 |
| 71 if (isUndefinedOrNull(length)) | 72 if (isUndefinedOrNull(length)) |
| 72 sqlArgsLength = sqlArgsObject->GetPropertyNames()->Length(); | 73 sqlArgsLength = sqlArgsObject->GetPropertyNames()->Length(); |
| 73 else | 74 else |
| 74 sqlArgsLength = length->Uint32Value(); | 75 sqlArgsLength = length->Uint32Value(); |
| 75 | 76 |
| 76 for (unsigned i = 0; i < sqlArgsLength; ++i) { | 77 for (unsigned i = 0; i < sqlArgsLength; ++i) { |
| 77 v8::Local<v8::Integer> key = v8::Integer::New(info.GetIsolate(), i); | 78 v8::Local<v8::Integer> key = v8::Integer::New(info.GetIsolate(), i); |
| 78 TONATIVE_VOID(v8::Local<v8::Value>, value, sqlArgsObject->Get(key)); | 79 TONATIVE_VOID(v8::Local<v8::Value>, value, sqlArgsObject->Get(key)); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 errorCallback = V8SQLStatementErrorCallback::create(v8::Local<v8::Functi on>::Cast(info[3]), ScriptState::current(info.GetIsolate())); | 113 errorCallback = V8SQLStatementErrorCallback::create(v8::Local<v8::Functi on>::Cast(info[3]), ScriptState::current(info.GetIsolate())); |
| 113 } else { | 114 } else { |
| 114 errorCallback = nullptr; | 115 errorCallback = nullptr; |
| 115 } | 116 } |
| 116 | 117 |
| 117 transaction->executeSQL(statement, sqlValues, callback, errorCallback, excep tionState); | 118 transaction->executeSQL(statement, sqlValues, callback, errorCallback, excep tionState); |
| 118 exceptionState.throwIfNeeded(); | 119 exceptionState.throwIfNeeded(); |
| 119 } | 120 } |
| 120 | 121 |
| 121 } // namespace blink | 122 } // namespace blink |
| OLD | NEW |