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

Side by Side Diff: Source/bindings/tests/results/core/V8TestObject.cpp

Issue 604833002: Use ExceptionState when converting string arguments to promise methods (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestObject.h" 8 #include "V8TestObject.h"
9 9
10 #include "bindings/core/v8/BindingSecurity.h" 10 #include "bindings/core/v8/BindingSecurity.h"
(...skipping 6571 matching lines...) Expand 10 before | Expand all | Expand 10 after
6582 setMinimumArityTypeError(exceptionState, 3, info.Length()); 6582 setMinimumArityTypeError(exceptionState, 3, info.Length());
6583 v8SetReturnValue(info, exceptionState.reject(ScriptState::current(info.G etIsolate())).v8Value()); 6583 v8SetReturnValue(info, exceptionState.reject(ScriptState::current(info.G etIsolate())).v8Value());
6584 return; 6584 return;
6585 } 6585 }
6586 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6586 TestObject* impl = V8TestObject::toImpl(info.Holder());
6587 int arg1; 6587 int arg1;
6588 Dictionary arg2; 6588 Dictionary arg2;
6589 V8StringResource<> arg3; 6589 V8StringResource<> arg3;
6590 Vector<String> variadic; 6590 Vector<String> variadic;
6591 { 6591 {
6592 v8::TryCatch block;
6593 V8RethrowTryCatchScope rethrow(block);
6594 TONATIVE_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(arg1, toInt32(info[0], exc eptionState), exceptionState, info, ScriptState::current(info.GetIsolate())); 6592 TONATIVE_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(arg1, toInt32(info[0], exc eptionState), exceptionState, info, ScriptState::current(info.GetIsolate()));
6595 if (!isUndefinedOrNull(info[1]) && !info[1]->IsObject()) { 6593 if (!isUndefinedOrNull(info[1]) && !info[1]->IsObject()) {
6596 exceptionState.throwTypeError("parameter 2 ('arg2') is not an object ."); 6594 exceptionState.throwTypeError("parameter 2 ('arg2') is not an object .");
6597 v8SetReturnValue(info, exceptionState.reject(ScriptState::current(in fo.GetIsolate())).v8Value()); 6595 v8SetReturnValue(info, exceptionState.reject(ScriptState::current(in fo.GetIsolate())).v8Value());
6598 return; 6596 return;
6599 } 6597 }
6600 arg2 = Dictionary(info[1], info.GetIsolate()); 6598 arg2 = Dictionary(info[1], info.GetIsolate());
6601 TOSTRING_VOID_PROMISE_INTERNAL(arg3, info[2], info); 6599 TOSTRING_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(arg3, info[2], exceptionSt ate, info, ScriptState::current(info.GetIsolate()));
6602 TONATIVE_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(variadic, toImplArguments< String>(info, 3, exceptionState), exceptionState, info, ScriptState::current(inf o.GetIsolate())); 6600 TONATIVE_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(variadic, toImplArguments< String>(info, 3, exceptionState), exceptionState, info, ScriptState::current(inf o.GetIsolate()));
6603 } 6601 }
6604 v8SetReturnValue(info, impl->promiseMethod(arg1, arg2, arg3, variadic).v8Val ue()); 6602 v8SetReturnValue(info, impl->promiseMethod(arg1, arg2, arg3, variadic).v8Val ue());
6605 } 6603 }
6606 6604
6607 static void promiseMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value >& info) 6605 static void promiseMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value >& info)
6608 { 6606 {
6609 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 6607 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
6610 TestObjectV8Internal::promiseMethodMethod(info); 6608 TestObjectV8Internal::promiseMethodMethod(info);
6611 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 6609 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
6806 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6804 TestObject* impl = V8TestObject::toImpl(info.Holder());
6807 int arg; 6805 int arg;
6808 { 6806 {
6809 TONATIVE_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(arg, toInt32(info[0], exce ptionState), exceptionState, info, ScriptState::current(info.GetIsolate())); 6807 TONATIVE_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(arg, toInt32(info[0], exce ptionState), exceptionState, info, ScriptState::current(info.GetIsolate()));
6810 } 6808 }
6811 v8SetReturnValue(info, impl->overloadedPromiseMethod(arg).v8Value()); 6809 v8SetReturnValue(info, impl->overloadedPromiseMethod(arg).v8Value());
6812 } 6810 }
6813 6811
6814 static void overloadedPromiseMethod2Method(const v8::FunctionCallbackInfo<v8::Va lue>& info) 6812 static void overloadedPromiseMethod2Method(const v8::FunctionCallbackInfo<v8::Va lue>& info)
6815 { 6813 {
6814 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedP romiseMethod", "TestObject", info.Holder(), info.GetIsolate());
6816 TestObject* impl = V8TestObject::toImpl(info.Holder()); 6815 TestObject* impl = V8TestObject::toImpl(info.Holder());
6817 V8StringResource<> arg; 6816 V8StringResource<> arg;
6818 { 6817 {
6819 v8::TryCatch block; 6818 TOSTRING_VOID_EXCEPTIONSTATE_PROMISE_INTERNAL(arg, info[0], exceptionSta te, info, ScriptState::current(info.GetIsolate()));
6820 V8RethrowTryCatchScope rethrow(block);
6821 TOSTRING_VOID_PROMISE_INTERNAL(arg, info[0], info);
6822 } 6819 }
6823 v8SetReturnValue(info, impl->overloadedPromiseMethod(arg).v8Value()); 6820 v8SetReturnValue(info, impl->overloadedPromiseMethod(arg).v8Value());
6824 } 6821 }
6825 6822
6826 static void overloadedPromiseMethodMethod(const v8::FunctionCallbackInfo<v8::Val ue>& info) 6823 static void overloadedPromiseMethodMethod(const v8::FunctionCallbackInfo<v8::Val ue>& info)
6827 { 6824 {
6828 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedP romiseMethod", "TestObject", info.Holder(), info.GetIsolate()); 6825 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedP romiseMethod", "TestObject", info.Holder(), info.GetIsolate());
6829 switch (std::min(1, info.Length())) { 6826 switch (std::min(1, info.Length())) {
6830 case 1: 6827 case 1:
6831 if (info[0]->IsNumber()) { 6828 if (info[0]->IsNumber()) {
(...skipping 4226 matching lines...) Expand 10 before | Expand all | Expand 10 after
11058 return false; 11055 return false;
11059 11056
11060 ScriptState::Scope scope(scriptState); 11057 ScriptState::Scope scope(scriptState);
11061 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 11058 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
11062 11059
11063 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate Script", "TestObject", scriptState->context()->Global(), scriptState->isolate()) ; 11060 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate Script", "TestObject", scriptState->context()->Global(), scriptState->isolate()) ;
11064 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState-> isolate(), cppValue)); 11061 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState-> isolate(), cppValue));
11065 } 11062 }
11066 11063
11067 } // namespace blink 11064 } // namespace blink
OLDNEW
« Source/bindings/core/v8/V8BindingMacros.h ('K') | « Source/bindings/scripts/v8_types.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698