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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp

Issue 2802223002: bindings: Throw a type error if converting an interface or callback function fails. (Closed)
Patch Set: Add |callback_function_name| to the callback function template Created 3 years, 8 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. 5 // This file has been auto-generated by code_generator_v8.py.
6 // DO NOT MODIFY! 6 // DO NOT MODIFY!
7 7
8 // This file has been generated from the Jinja2 template in 8 // This file has been generated from the Jinja2 template in
9 // third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl 9 // third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
10 10
(...skipping 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 871
872 v8::Local<v8::Object> V8TestInterface5::findInstanceInPrototypeChain(v8::Local<v 8::Value> v8Value, v8::Isolate* isolate) { 872 v8::Local<v8::Object> V8TestInterface5::findInstanceInPrototypeChain(v8::Local<v 8::Value> v8Value, v8::Isolate* isolate) {
873 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperT ypeInfo, v8Value); 873 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperT ypeInfo, v8Value);
874 } 874 }
875 875
876 TestInterface5Implementation* V8TestInterface5::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value) { 876 TestInterface5Implementation* V8TestInterface5::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value) {
877 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value) ) : nullptr; 877 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value) ) : nullptr;
878 } 878 }
879 879
880 TestInterface5Implementation* NativeValueTraits<TestInterface5Implementation>::n ativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exc eptionState) { 880 TestInterface5Implementation* NativeValueTraits<TestInterface5Implementation>::n ativeValue(v8::Isolate* isolate, v8::Local<v8::Value> value, ExceptionState& exc eptionState) {
881 return V8TestInterface5::toImplWithTypeCheck(isolate, value); 881 TestInterface5Implementation* nativeValue = V8TestInterface5::toImplWithTypeCh eck(isolate, value);
882 if (!nativeValue)
883 exceptionState.throwTypeError("Unable to convert value to TestInterface5.");
884 return nativeValue;
882 } 885 }
883 886
884 void V8TestInterface5::preparePrototypeAndInterfaceObject(v8::Local<v8::Context> context, const DOMWrapperWorld& world, v8::Local<v8::Object> prototypeObject, v 8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfac eTemplate) { 887 void V8TestInterface5::preparePrototypeAndInterfaceObject(v8::Local<v8::Context> context, const DOMWrapperWorld& world, v8::Local<v8::Object> prototypeObject, v 8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfac eTemplate) {
885 v8::Isolate* isolate = context->GetIsolate(); 888 v8::Isolate* isolate = context->GetIsolate();
886 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp late); 889 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp late);
887 ExecutionContext* executionContext = toExecutionContext(context); 890 ExecutionContext* executionContext = toExecutionContext(context);
888 DCHECK(executionContext); 891 DCHECK(executionContext);
889 892
890 if (executionContext && (executionContext->isWorkerGlobalScope())) { 893 if (executionContext && (executionContext->isWorkerGlobalScope())) {
891 static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration [] = { 894 static const V8DOMConfiguration::AccessorConfiguration accessorConfiguration [] = {
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
932 if (executionContext && (executionContext->isDocument() || executionContext->i sServiceWorkerGlobalScope())) { 935 if (executionContext && (executionContext->isDocument() || executionContext->i sServiceWorkerGlobalScope())) {
933 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExposedM ethodMethodConfiguration[] = { 936 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExposedM ethodMethodConfiguration[] = {
934 {"windowAndServiceWorkerExposedMethod", V8TestInterface5::windowAndService WorkerExposedMethodMethodCallback, 0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess, V8DOMCon figuration::AllWorlds} 937 {"windowAndServiceWorkerExposedMethod", V8TestInterface5::windowAndService WorkerExposedMethodMethodCallback, 0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder, V8DOMConfiguration::DoNotCheckAccess, V8DOMCon figuration::AllWorlds}
935 }; 938 };
936 for (const auto& methodConfig : windowAndServiceWorkerExposedMethodMethodCon figuration) 939 for (const auto& methodConfig : windowAndServiceWorkerExposedMethodMethodCon figuration)
937 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), prototypeObject, interfaceObject, signature, methodConfig); 940 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), prototypeObject, interfaceObject, signature, methodConfig);
938 } 941 }
939 } 942 }
940 943
941 } // namespace blink 944 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698