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

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

Issue 2809003004: bindings: Use ExceptionMessages when an interface/callback conversion fails. (Closed)
Patch Set: Add ExceptionMessages::FailedToConvertJSValue 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 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 TestInterface5Implementation* nativeValue = V8TestInterface5::toImplWithTypeCh eck(isolate, value); 881 TestInterface5Implementation* nativeValue = V8TestInterface5::toImplWithTypeCh eck(isolate, value);
882 if (!nativeValue) 882 if (!nativeValue) {
883 exceptionState.ThrowTypeError("Unable to convert value to TestInterface5."); 883 exceptionState.ThrowTypeError(ExceptionMessages::FailedToConvertJSValue(
884 "TestInterface5"));
885 }
884 return nativeValue; 886 return nativeValue;
885 } 887 }
886 888
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) { 889 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) {
888 v8::Isolate* isolate = context->GetIsolate(); 890 v8::Isolate* isolate = context->GetIsolate();
889 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp late); 891 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp late);
890 ExecutionContext* executionContext = ToExecutionContext(context); 892 ExecutionContext* executionContext = ToExecutionContext(context);
891 DCHECK(executionContext); 893 DCHECK(executionContext);
892 894
893 if (executionContext && (executionContext->IsWorkerGlobalScope())) { 895 if (executionContext && (executionContext->IsWorkerGlobalScope())) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 if (executionContext && (executionContext->IsDocument() || executionContext->I sServiceWorkerGlobalScope())) { 937 if (executionContext && (executionContext->IsDocument() || executionContext->I sServiceWorkerGlobalScope())) {
936 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExposedM ethodMethodConfiguration[] = { 938 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExposedM ethodMethodConfiguration[] = {
937 {"windowAndServiceWorkerExposedMethod", V8TestInterface5::windowAndService WorkerExposedMethodMethodCallback, 0, v8::None, V8DOMConfiguration::kOnPrototype , V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess, V8DOM Configuration::kAllWorlds} 939 {"windowAndServiceWorkerExposedMethod", V8TestInterface5::windowAndService WorkerExposedMethodMethodCallback, 0, v8::None, V8DOMConfiguration::kOnPrototype , V8DOMConfiguration::kCheckHolder, V8DOMConfiguration::kDoNotCheckAccess, V8DOM Configuration::kAllWorlds}
938 }; 940 };
939 for (const auto& methodConfig : windowAndServiceWorkerExposedMethodMethodCon figuration) 941 for (const auto& methodConfig : windowAndServiceWorkerExposedMethodMethodCon figuration)
940 V8DOMConfiguration::InstallMethod(isolate, world, v8::Local<v8::Object>(), prototypeObject, interfaceObject, signature, methodConfig); 942 V8DOMConfiguration::InstallMethod(isolate, world, v8::Local<v8::Object>(), prototypeObject, interfaceObject, signature, methodConfig);
941 } 943 }
942 } 944 }
943 945
944 } // namespace blink 946 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698