Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: Source/bindings/modules/v8/custom/V8SQLTransactionCustom.cpp

Issue 970403003: bindings: Use V8 MaybeLocal APIs in V8DeviceMotionEventCustom (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« Source/bindings/core/v8/V8MaybeLocalToLocal.h ('K') | « Source/bindings/core/v8/v8.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698