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

Side by Side Diff: Source/bindings/tests/results/V8TestInterfaceImplementedAs.cpp

Issue 99083002: WIP: Migrate generated bindings to new ExceptionState constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Feedback. Created 7 years 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 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 124
125 static void bAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 125 static void bAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
126 { 126 {
127 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 127 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
128 RealClassV8Internal::bAttributeSetter(jsValue, info); 128 RealClassV8Internal::bAttributeSetter(jsValue, info);
129 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 129 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
130 } 130 }
131 131
132 static void func1Method(const v8::FunctionCallbackInfo<v8::Value>& info) 132 static void func1Method(const v8::FunctionCallbackInfo<v8::Value>& info)
133 { 133 {
134 ExceptionState exceptionState(ExceptionState::ExecutionContext, "func1", "Te stInterfaceImplementedAs", info.Holder(), info.GetIsolate());
134 if (UNLIKELY(info.Length() < 1)) { 135 if (UNLIKELY(info.Length() < 1)) {
135 throwTypeError(ExceptionMessages::failedToExecute("func1", "TestInterfac eImplementedAs", ExceptionMessages::notEnoughArguments(1, info.Length())), info. GetIsolate()); 136 throwTypeError(ExceptionMessages::failedToExecute("func1", "TestInterfac eImplementedAs", ExceptionMessages::notEnoughArguments(1, info.Length())), info. GetIsolate());
136 return; 137 return;
137 } 138 }
138 RealClass* imp = V8TestInterfaceImplementedAs::toNative(info.Holder()); 139 RealClass* imp = V8TestInterfaceImplementedAs::toNative(info.Holder());
139 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, a, info[0]); 140 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, a, info[0]);
140 v8SetReturnValueString(info, imp->func1(a), info.GetIsolate()); 141 v8SetReturnValueString(info, imp->func1(a), info.GetIsolate());
141 } 142 }
142 143
143 static void func1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info) 144 static void func1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
144 { 145 {
145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 146 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
146 RealClassV8Internal::func1Method(info); 147 RealClassV8Internal::func1Method(info);
147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 148 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
148 } 149 }
149 150
150 static void funcTestInterfaceImplementedAsParamMethod(const v8::FunctionCallback Info<v8::Value>& info) 151 static void funcTestInterfaceImplementedAsParamMethod(const v8::FunctionCallback Info<v8::Value>& info)
151 { 152 {
153 ExceptionState exceptionState(ExceptionState::ExecutionContext, "funcTestInt erfaceImplementedAsParam", "TestInterfaceImplementedAs", info.Holder(), info.Get Isolate());
152 if (UNLIKELY(info.Length() < 1)) { 154 if (UNLIKELY(info.Length() < 1)) {
153 throwTypeError(ExceptionMessages::failedToExecute("funcTestInterfaceImpl ementedAsParam", "TestInterfaceImplementedAs", ExceptionMessages::notEnoughArgum ents(1, info.Length())), info.GetIsolate()); 155 throwTypeError(ExceptionMessages::failedToExecute("funcTestInterfaceImpl ementedAsParam", "TestInterfaceImplementedAs", ExceptionMessages::notEnoughArgum ents(1, info.Length())), info.GetIsolate());
154 return; 156 return;
155 } 157 }
156 RealClass* imp = V8TestInterfaceImplementedAs::toNative(info.Holder()); 158 RealClass* imp = V8TestInterfaceImplementedAs::toNative(info.Holder());
157 V8TRYCATCH_VOID(RealClass*, orange, V8TestInterfaceImplementedAs::hasInstanc e(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestInterfaceImp lementedAs::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); 159 V8TRYCATCH_VOID(RealClass*, orange, V8TestInterfaceImplementedAs::hasInstanc e(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestInterfaceImp lementedAs::toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
158 v8SetReturnValueString(info, imp->funcTestInterfaceImplementedAsParam(orange ), info.GetIsolate()); 160 v8SetReturnValueString(info, imp->funcTestInterfaceImplementedAsParam(orange ), info.GetIsolate());
159 } 161 }
160 162
161 static void funcTestInterfaceImplementedAsParamMethodCallback(const v8::Function CallbackInfo<v8::Value>& info) 163 static void funcTestInterfaceImplementedAsParamMethodCallback(const v8::Function CallbackInfo<v8::Value>& info)
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 fromInternalPointer(object)->deref(); 257 fromInternalPointer(object)->deref();
256 } 258 }
257 259
258 template<> 260 template<>
259 v8::Handle<v8::Value> toV8NoInline(RealClass* impl, v8::Handle<v8::Object> creat ionContext, v8::Isolate* isolate) 261 v8::Handle<v8::Value> toV8NoInline(RealClass* impl, v8::Handle<v8::Object> creat ionContext, v8::Isolate* isolate)
260 { 262 {
261 return toV8(impl, creationContext, isolate); 263 return toV8(impl, creationContext, isolate);
262 } 264 }
263 265
264 } // namespace WebCore 266 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698