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

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

Issue 68563003: Create DOM exceptions in the correct context. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 1 month 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 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 844 static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
845 { 845 {
846 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 846 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
847 TestObjV8Internal::typedArrayAttrAttributeSetter(jsValue, info); 847 TestObjV8Internal::typedArrayAttrAttributeSetter(jsValue, info);
848 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 848 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
849 } 849 }
850 850
851 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInf o<v8::Value>& info) 851 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInf o<v8::Value>& info)
852 { 852 {
853 TestObj* imp = V8TestObject::toNative(info.Holder()); 853 TestObj* imp = V8TestObject::toNative(info.Holder());
854 ExceptionState es(info.GetIsolate()); 854 ExceptionState es(info.Holder(), info.GetIsolate());
855 int jsValue = imp->attrWithGetterException(es); 855 int jsValue = imp->attrWithGetterException(es);
856 if (UNLIKELY(es.throwIfNeeded())) 856 if (UNLIKELY(es.throwIfNeeded()))
857 return; 857 return;
858 v8SetReturnValueInt(info, jsValue); 858 v8SetReturnValueInt(info, jsValue);
859 } 859 }
860 860
861 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info) 861 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info)
862 { 862 {
863 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 863 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
864 TestObjV8Internal::attrWithGetterExceptionAttributeGetter(info); 864 TestObjV8Internal::attrWithGetterExceptionAttributeGetter(info);
(...skipping 24 matching lines...) Expand all
889 { 889 {
890 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 890 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
891 TestObjV8Internal::attrWithSetterExceptionAttributeGetter(info); 891 TestObjV8Internal::attrWithSetterExceptionAttributeGetter(info);
892 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 892 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
893 } 893 }
894 894
895 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 895 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
896 { 896 {
897 TestObj* imp = V8TestObject::toNative(info.Holder()); 897 TestObj* imp = V8TestObject::toNative(info.Holder());
898 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); 898 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
899 ExceptionState es(info.GetIsolate()); 899 ExceptionState es(info.Holder(), info.GetIsolate());
900 imp->setAttrWithSetterException(cppValue, es); 900 imp->setAttrWithSetterException(cppValue, es);
901 es.throwIfNeeded(); 901 es.throwIfNeeded();
902 } 902 }
903 903
904 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 904 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
905 { 905 {
906 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 906 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
907 TestObjV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info); 907 TestObjV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info);
908 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 908 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
909 } 909 }
910 910
911 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallb ackInfo<v8::Value>& info) 911 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallb ackInfo<v8::Value>& info)
912 { 912 {
913 TestObj* imp = V8TestObject::toNative(info.Holder()); 913 TestObj* imp = V8TestObject::toNative(info.Holder());
914 ExceptionState es(info.GetIsolate()); 914 ExceptionState es(info.Holder(), info.GetIsolate());
915 String jsValue = imp->stringAttrWithGetterException(es); 915 String jsValue = imp->stringAttrWithGetterException(es);
916 if (UNLIKELY(es.throwIfNeeded())) 916 if (UNLIKELY(es.throwIfNeeded()))
917 return; 917 return;
918 v8SetReturnValueString(info, jsValue, info.GetIsolate()); 918 v8SetReturnValueString(info, jsValue, info.GetIsolate());
919 } 919 }
920 920
921 static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::S tring>, const v8::PropertyCallbackInfo<v8::Value>& info) 921 static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::S tring>, const v8::PropertyCallbackInfo<v8::Value>& info)
922 { 922 {
923 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 923 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
924 TestObjV8Internal::stringAttrWithGetterExceptionAttributeGetter(info); 924 TestObjV8Internal::stringAttrWithGetterExceptionAttributeGetter(info);
(...skipping 24 matching lines...) Expand all
949 { 949 {
950 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 950 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
951 TestObjV8Internal::stringAttrWithSetterExceptionAttributeGetter(info); 951 TestObjV8Internal::stringAttrWithSetterExceptionAttributeGetter(info);
952 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 952 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
953 } 953 }
954 954
955 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> js Value, const v8::PropertyCallbackInfo<void>& info) 955 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> js Value, const v8::PropertyCallbackInfo<void>& info)
956 { 956 {
957 TestObj* imp = V8TestObject::toNative(info.Holder()); 957 TestObj* imp = V8TestObject::toNative(info.Holder());
958 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); 958 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
959 ExceptionState es(info.GetIsolate()); 959 ExceptionState es(info.Holder(), info.GetIsolate());
960 imp->setStringAttrWithSetterException(cppValue, es); 960 imp->setStringAttrWithSetterException(cppValue, es);
961 es.throwIfNeeded(); 961 es.throwIfNeeded();
962 } 962 }
963 963
964 static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::S tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info ) 964 static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::S tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info )
965 { 965 {
966 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 966 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
967 TestObjV8Internal::stringAttrWithSetterExceptionAttributeSetter(jsValue, inf o); 967 TestObjV8Internal::stringAttrWithSetterExceptionAttributeSetter(jsValue, inf o);
968 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 968 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
969 } 969 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1071 static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::L ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v oid>& info) 1071 static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::L ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v oid>& info)
1072 { 1072 {
1073 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1073 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1074 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(js Value, info); 1074 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(js Value, info);
1075 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1075 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1076 } 1076 }
1077 1077
1078 static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCall backInfo<v8::Value>& info) 1078 static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCall backInfo<v8::Value>& info)
1079 { 1079 {
1080 TestObj* imp = V8TestObject::toNative(info.Holder()); 1080 TestObj* imp = V8TestObject::toNative(info.Holder());
1081 ExceptionState es(info.GetIsolate()); 1081 ExceptionState es(info.Holder(), info.GetIsolate());
1082 ScriptState* currentState = ScriptState::current(); 1082 ScriptState* currentState = ScriptState::current();
1083 if (!currentState) 1083 if (!currentState)
1084 return v8Undefined(); 1084 return v8Undefined();
1085 ScriptState& state = *currentState; 1085 ScriptState& state = *currentState;
1086 RefPtr<TestObj> jsValue = imp->withScriptStateAttributeRaises(&state, es); 1086 RefPtr<TestObj> jsValue = imp->withScriptStateAttributeRaises(&state, es);
1087 if (UNLIKELY(es.throwIfNeeded())) 1087 if (UNLIKELY(es.throwIfNeeded()))
1088 return; 1088 return;
1089 if (state.hadException()) { 1089 if (state.hadException()) {
1090 throwError(state.exception(), info.GetIsolate()); 1090 throwError(state.exception(), info.GetIsolate());
1091 return; 1091 return;
(...skipping 24 matching lines...) Expand all
1116 static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8:: String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf o) 1116 static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8:: String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf o)
1117 { 1117 {
1118 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1118 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1119 TestObjV8Internal::withScriptStateAttributeRaisesAttributeSetter(jsValue, in fo); 1119 TestObjV8Internal::withScriptStateAttributeRaisesAttributeSetter(jsValue, in fo);
1120 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1120 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1121 } 1121 }
1122 1122
1123 static void withExecutionContextAttributeRaisesAttributeGetter(const v8::Propert yCallbackInfo<v8::Value>& info) 1123 static void withExecutionContextAttributeRaisesAttributeGetter(const v8::Propert yCallbackInfo<v8::Value>& info)
1124 { 1124 {
1125 TestObj* imp = V8TestObject::toNative(info.Holder()); 1125 TestObj* imp = V8TestObject::toNative(info.Holder());
1126 ExceptionState es(info.GetIsolate()); 1126 ExceptionState es(info.Holder(), info.GetIsolate());
1127 ExecutionContext* scriptContext = getExecutionContext(); 1127 ExecutionContext* scriptContext = getExecutionContext();
1128 RefPtr<TestObj> jsValue = imp->withExecutionContextAttributeRaises(scriptCon text, es); 1128 RefPtr<TestObj> jsValue = imp->withExecutionContextAttributeRaises(scriptCon text, es);
1129 if (UNLIKELY(es.throwIfNeeded())) 1129 if (UNLIKELY(es.throwIfNeeded()))
1130 return; 1130 return;
1131 v8SetReturnValueFast(info, jsValue.release(), imp); 1131 v8SetReturnValueFast(info, jsValue.release(), imp);
1132 } 1132 }
1133 1133
1134 static void withExecutionContextAttributeRaisesAttributeGetterCallback(v8::Local <v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1134 static void withExecutionContextAttributeRaisesAttributeGetterCallback(v8::Local <v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1135 { 1135 {
1136 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1136 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1188 static void withExecutionContextAndScriptStateAttributeAttributeSetterCallback(v 8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackIn fo<void>& info) 1188 static void withExecutionContextAndScriptStateAttributeAttributeSetterCallback(v 8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackIn fo<void>& info)
1189 { 1189 {
1190 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1190 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1191 TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeSette r(jsValue, info); 1191 TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeSette r(jsValue, info);
1192 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1192 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1193 } 1193 }
1194 1194
1195 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(con st v8::PropertyCallbackInfo<v8::Value>& info) 1195 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(con st v8::PropertyCallbackInfo<v8::Value>& info)
1196 { 1196 {
1197 TestObj* imp = V8TestObject::toNative(info.Holder()); 1197 TestObj* imp = V8TestObject::toNative(info.Holder());
1198 ExceptionState es(info.GetIsolate()); 1198 ExceptionState es(info.Holder(), info.GetIsolate());
1199 ScriptState* currentState = ScriptState::current(); 1199 ScriptState* currentState = ScriptState::current();
1200 if (!currentState) 1200 if (!currentState)
1201 return v8Undefined(); 1201 return v8Undefined();
1202 ScriptState& state = *currentState; 1202 ScriptState& state = *currentState;
1203 ExecutionContext* scriptContext = getExecutionContext(); 1203 ExecutionContext* scriptContext = getExecutionContext();
1204 RefPtr<TestObj> jsValue = imp->withExecutionContextAndScriptStateAttributeRa ises(&state, scriptContext, es); 1204 RefPtr<TestObj> jsValue = imp->withExecutionContextAndScriptStateAttributeRa ises(&state, scriptContext, es);
1205 if (UNLIKELY(es.throwIfNeeded())) 1205 if (UNLIKELY(es.throwIfNeeded()))
1206 return; 1206 return;
1207 if (state.hadException()) { 1207 if (state.hadException()) {
1208 throwError(state.exception(), info.GetIsolate()); 1208 throwError(state.exception(), info.GetIsolate());
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
1810 static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::L ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 1810 static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::L ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1811 { 1811 {
1812 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1812 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1813 TestObjV8Internal::messagePortArrayAttributeSetter(jsValue, info); 1813 TestObjV8Internal::messagePortArrayAttributeSetter(jsValue, info);
1814 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1814 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1815 } 1815 }
1816 1816
1817 static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Va lue>& info) 1817 static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Va lue>& info)
1818 { 1818 {
1819 TestObj* imp = V8TestObject::toNative(info.Holder()); 1819 TestObj* imp = V8TestObject::toNative(info.Holder());
1820 ExceptionState es(info.GetIsolate()); 1820 ExceptionState es(info.Holder(), info.GetIsolate());
1821 if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument(), es)) { 1821 if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument(), es)) {
1822 v8SetReturnValueNull(info); 1822 v8SetReturnValueNull(info);
1823 es.throwIfNeeded(); 1823 es.throwIfNeeded();
1824 return; 1824 return;
1825 } 1825 }
1826 v8SetReturnValueFast(info, imp->contentDocument(), imp); 1826 v8SetReturnValueFast(info, imp->contentDocument(), imp);
1827 } 1827 }
1828 1828
1829 static void contentDocumentAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1829 static void contentDocumentAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1830 { 1830 {
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
2067 static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::S tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info ) 2067 static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::S tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info )
2068 { 2068 {
2069 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2069 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2070 TestObjV8Internal::nullableLongSettableAttributeAttributeSetter(jsValue, inf o); 2070 TestObjV8Internal::nullableLongSettableAttributeAttributeSetter(jsValue, inf o);
2071 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 2071 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2072 } 2072 }
2073 2073
2074 static void nullableStringValueAttributeGetter(const v8::PropertyCallbackInfo<v8 ::Value>& info) 2074 static void nullableStringValueAttributeGetter(const v8::PropertyCallbackInfo<v8 ::Value>& info)
2075 { 2075 {
2076 TestObj* imp = V8TestObject::toNative(info.Holder()); 2076 TestObj* imp = V8TestObject::toNative(info.Holder());
2077 ExceptionState es(info.GetIsolate()); 2077 ExceptionState es(info.Holder(), info.GetIsolate());
2078 bool isNull = false; 2078 bool isNull = false;
2079 int jsValue = imp->nullableStringValue(isNull, es); 2079 int jsValue = imp->nullableStringValue(isNull, es);
2080 if (isNull) { 2080 if (isNull) {
2081 v8SetReturnValueNull(info); 2081 v8SetReturnValueNull(info);
2082 return; 2082 return;
2083 } 2083 }
2084 if (UNLIKELY(es.throwIfNeeded())) 2084 if (UNLIKELY(es.throwIfNeeded()))
2085 return; 2085 return;
2086 v8SetReturnValueInt(info, jsValue); 2086 v8SetReturnValueInt(info, jsValue);
2087 } 2087 }
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
2796 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 2796 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2797 } 2797 }
2798 2798
2799 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, c onst v8::PropertyCallbackInfo<void>& info) 2799 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, c onst v8::PropertyCallbackInfo<void>& info)
2800 { 2800 {
2801 TestObj* proxyImp = V8TestObject::toNative(info.Holder()); 2801 TestObj* proxyImp = V8TestObject::toNative(info.Holder());
2802 TestNode* imp = proxyImp->locationWithException(); 2802 TestNode* imp = proxyImp->locationWithException();
2803 if (!imp) 2803 if (!imp)
2804 return; 2804 return;
2805 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); 2805 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
2806 ExceptionState es(info.GetIsolate()); 2806 ExceptionState es(info.Holder(), info.GetIsolate());
2807 imp->setHrefThrows(cppValue, es); 2807 imp->setHrefThrows(cppValue, es);
2808 es.throwIfNeeded(); 2808 es.throwIfNeeded();
2809 } 2809 }
2810 2810
2811 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 2811 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2812 { 2812 {
2813 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2813 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2814 TestObjV8Internal::locationWithExceptionAttributeSetter(jsValue, info); 2814 TestObjV8Internal::locationWithExceptionAttributeSetter(jsValue, info);
2815 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 2815 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2816 } 2816 }
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
2994 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 2994 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2995 } 2995 }
2996 2996
2997 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI nfo<v8::Value>& info) 2997 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI nfo<v8::Value>& info)
2998 { 2998 {
2999 if (UNLIKELY(info.Length() < 2)) { 2999 if (UNLIKELY(info.Length() < 2)) {
3000 throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAll ArgsAndThrows", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Leng th())), info.GetIsolate()); 3000 throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAll ArgsAndThrows", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Leng th())), info.GetIsolate());
3001 return; 3001 return;
3002 } 3002 }
3003 TestObj* imp = V8TestObject::toNative(info.Holder()); 3003 TestObj* imp = V8TestObject::toNative(info.Holder());
3004 ExceptionState es(info.GetIsolate()); 3004 ExceptionState es(info.Holder(), info.GetIsolate());
3005 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); 3005 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
3006 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[1], info.Ge tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(info[1])) : 0); 3006 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::HasInstance(info[1], info.Ge tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(info[1])) : 0);
3007 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj Arg, es); 3007 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj Arg, es);
3008 if (es.throwIfNeeded()) 3008 if (es.throwIfNeeded())
3009 return; 3009 return;
3010 v8SetReturnValue(info, result.release()); 3010 v8SetReturnValue(info, result.release());
3011 } 3011 }
3012 3012
3013 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& info) 3013 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& info)
3014 { 3014 {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
3061 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value >& info) 3061 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value >& info)
3062 { 3062 {
3063 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3063 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3064 TestObjV8Internal::optionsObjectMethod(info); 3064 TestObjV8Internal::optionsObjectMethod(info);
3065 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3065 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3066 } 3066 }
3067 3067
3068 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 3068 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3069 { 3069 {
3070 TestObj* imp = V8TestObject::toNative(info.Holder()); 3070 TestObj* imp = V8TestObject::toNative(info.Holder());
3071 ExceptionState es(info.GetIsolate()); 3071 ExceptionState es(info.Holder(), info.GetIsolate());
3072 imp->methodWithException(es); 3072 imp->methodWithException(es);
3073 if (es.throwIfNeeded()) 3073 if (es.throwIfNeeded())
3074 return; 3074 return;
3075 } 3075 }
3076 3076
3077 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) 3077 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
3078 { 3078 {
3079 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3079 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3080 TestObjV8Internal::methodWithExceptionMethod(info); 3080 TestObjV8Internal::methodWithExceptionMethod(info);
3081 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3081 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
(...skipping 11 matching lines...) Expand all
3093 { 3093 {
3094 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3094 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3095 V8TestObject::customMethodWithArgsMethodCustom(info); 3095 V8TestObject::customMethodWithArgsMethodCustom(info);
3096 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3096 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3097 } 3097 }
3098 3098
3099 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& in fo) 3099 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& in fo)
3100 { 3100 {
3101 EventTarget* impl = V8TestObject::toNative(info.Holder()); 3101 EventTarget* impl = V8TestObject::toNative(info.Holder());
3102 if (DOMWindow* window = impl->toDOMWindow()) { 3102 if (DOMWindow* window = impl->toDOMWindow()) {
3103 ExceptionState es(info.GetIsolate()); 3103 ExceptionState es(info.Holder(), info.GetIsolate());
3104 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) { 3104 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) {
3105 es.throwIfNeeded(); 3105 es.throwIfNeeded();
3106 return; 3106 return;
3107 } 3107 }
3108 3108
3109 if (!window->document()) 3109 if (!window->document())
3110 return; 3110 return;
3111 } 3111 }
3112 3112
3113 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[ 1], false, ListenerFindOrCreate); 3113 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[ 1], false, ListenerFindOrCreate);
3114 if (listener) { 3114 if (listener) {
3115 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, st ringResource, info[0]); 3115 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, st ringResource, info[0]);
3116 impl->addEventListener(stringResource, listener, info[2]->BooleanValue() ); 3116 impl->addEventListener(stringResource, listener, info[2]->BooleanValue() );
3117 if (!impl->toNode()) 3117 if (!impl->toNode())
3118 createHiddenDependency(info.Holder(), info[1], V8TestObject::eventLi stenerCacheIndex, info.GetIsolate()); 3118 createHiddenDependency(info.Holder(), info[1], V8TestObject::eventLi stenerCacheIndex, info.GetIsolate());
3119 } 3119 }
3120 } 3120 }
3121 3121
3122 static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info) 3122 static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info)
3123 { 3123 {
3124 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3124 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3125 TestObjV8Internal::addEventListenerMethod(info); 3125 TestObjV8Internal::addEventListenerMethod(info);
3126 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3126 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3127 } 3127 }
3128 3128
3129 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 3129 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3130 { 3130 {
3131 EventTarget* impl = V8TestObject::toNative(info.Holder()); 3131 EventTarget* impl = V8TestObject::toNative(info.Holder());
3132 if (DOMWindow* window = impl->toDOMWindow()) { 3132 if (DOMWindow* window = impl->toDOMWindow()) {
3133 ExceptionState es(info.GetIsolate()); 3133 ExceptionState es(info.Holder(), info.GetIsolate());
3134 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) { 3134 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), es)) {
3135 es.throwIfNeeded(); 3135 es.throwIfNeeded();
3136 return; 3136 return;
3137 } 3137 }
3138 3138
3139 if (!window->document()) 3139 if (!window->document())
3140 return; 3140 return;
3141 } 3141 }
3142 3142
3143 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[ 1], false, ListenerFindOnly); 3143 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[ 1], false, ListenerFindOnly);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
3199 static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info) 3199 static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info)
3200 { 3200 {
3201 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3201 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3202 TestObjV8Internal::withScriptStateObjMethod(info); 3202 TestObjV8Internal::withScriptStateObjMethod(info);
3203 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3203 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3204 } 3204 }
3205 3205
3206 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8 ::Value>& info) 3206 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8 ::Value>& info)
3207 { 3207 {
3208 TestObj* imp = V8TestObject::toNative(info.Holder()); 3208 TestObj* imp = V8TestObject::toNative(info.Holder());
3209 ExceptionState es(info.GetIsolate()); 3209 ExceptionState es(info.Holder(), info.GetIsolate());
3210 ScriptState* currentState = ScriptState::current(); 3210 ScriptState* currentState = ScriptState::current();
3211 if (!currentState) 3211 if (!currentState)
3212 return; 3212 return;
3213 ScriptState& state = *currentState; 3213 ScriptState& state = *currentState;
3214 imp->withScriptStateVoidException(&state, es); 3214 imp->withScriptStateVoidException(&state, es);
3215 if (es.throwIfNeeded()) 3215 if (es.throwIfNeeded())
3216 return; 3216 return;
3217 if (state.hadException()) { 3217 if (state.hadException()) {
3218 v8::Local<v8::Value> exception = state.exception(); 3218 v8::Local<v8::Value> exception = state.exception();
3219 state.clearException(); 3219 state.clearException();
3220 throwError(exception, info.GetIsolate()); 3220 throwError(exception, info.GetIsolate());
3221 return; 3221 return;
3222 } 3222 }
3223 } 3223 }
3224 3224
3225 static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& info) 3225 static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& info)
3226 { 3226 {
3227 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3227 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3228 TestObjV8Internal::withScriptStateVoidExceptionMethod(info); 3228 TestObjV8Internal::withScriptStateVoidExceptionMethod(info);
3229 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3229 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3230 } 3230 }
3231 3231
3232 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8: :Value>& info) 3232 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8: :Value>& info)
3233 { 3233 {
3234 TestObj* imp = V8TestObject::toNative(info.Holder()); 3234 TestObj* imp = V8TestObject::toNative(info.Holder());
3235 ExceptionState es(info.GetIsolate()); 3235 ExceptionState es(info.Holder(), info.GetIsolate());
3236 ScriptState* currentState = ScriptState::current(); 3236 ScriptState* currentState = ScriptState::current();
3237 if (!currentState) 3237 if (!currentState)
3238 return; 3238 return;
3239 ScriptState& state = *currentState; 3239 ScriptState& state = *currentState;
3240 RefPtr<TestObj> result = imp->withScriptStateObjException(&state, es); 3240 RefPtr<TestObj> result = imp->withScriptStateObjException(&state, es);
3241 if (es.throwIfNeeded()) 3241 if (es.throwIfNeeded())
3242 return; 3242 return;
3243 if (state.hadException()) { 3243 if (state.hadException()) {
3244 v8::Local<v8::Value> exception = state.exception(); 3244 v8::Local<v8::Value> exception = state.exception();
3245 state.clearException(); 3245 state.clearException();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
3290 static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& info) 3290 static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& info)
3291 { 3291 {
3292 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3292 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3293 TestObjV8Internal::withExecutionContextAndScriptStateMethod(info); 3293 TestObjV8Internal::withExecutionContextAndScriptStateMethod(info);
3294 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3294 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3295 } 3295 }
3296 3296
3297 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::Funct ionCallbackInfo<v8::Value>& info) 3297 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::Funct ionCallbackInfo<v8::Value>& info)
3298 { 3298 {
3299 TestObj* imp = V8TestObject::toNative(info.Holder()); 3299 TestObj* imp = V8TestObject::toNative(info.Holder());
3300 ExceptionState es(info.GetIsolate()); 3300 ExceptionState es(info.Holder(), info.GetIsolate());
3301 ScriptState* currentState = ScriptState::current(); 3301 ScriptState* currentState = ScriptState::current();
3302 if (!currentState) 3302 if (!currentState)
3303 return; 3303 return;
3304 ScriptState& state = *currentState; 3304 ScriptState& state = *currentState;
3305 ExecutionContext* scriptContext = getExecutionContext(); 3305 ExecutionContext* scriptContext = getExecutionContext();
3306 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateObjException (&state, scriptContext, es); 3306 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateObjException (&state, scriptContext, es);
3307 if (es.throwIfNeeded()) 3307 if (es.throwIfNeeded())
3308 return; 3308 return;
3309 if (state.hadException()) { 3309 if (state.hadException()) {
3310 v8::Local<v8::Value> exception = state.exception(); 3310 v8::Local<v8::Value> exception = state.exception();
(...skipping 880 matching lines...) Expand 10 before | Expand all | Expand 10 after
4191 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4191 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4192 } 4192 }
4193 4193
4194 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4194 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4195 { 4195 {
4196 if (UNLIKELY(info.Length() < 1)) { 4196 if (UNLIKELY(info.Length() < 1)) {
4197 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Ge tIsolate()); 4197 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Ge tIsolate());
4198 return; 4198 return;
4199 } 4199 }
4200 TestObj* imp = V8TestObject::toNative(info.Holder()); 4200 TestObj* imp = V8TestObject::toNative(info.Holder());
4201 ExceptionState es(info.GetIsolate()); 4201 ExceptionState es(info.Holder(), info.GetIsolate());
4202 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in fo.GetIsolate())); 4202 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in fo.GetIsolate()));
4203 Vector<String> result = imp->stringArrayFunction(values, es); 4203 Vector<String> result = imp->stringArrayFunction(values, es);
4204 if (es.throwIfNeeded()) 4204 if (es.throwIfNeeded())
4205 return; 4205 return;
4206 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); 4206 v8SetReturnValue(info, v8Array(result, info.GetIsolate()));
4207 } 4207 }
4208 4208
4209 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) 4209 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
4210 { 4210 {
4211 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4211 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4212 TestObjV8Internal::stringArrayFunctionMethod(info); 4212 TestObjV8Internal::stringArrayFunctionMethod(info);
4213 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4213 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4214 } 4214 }
4215 4215
4216 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value >& info) 4216 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value >& info)
4217 { 4217 {
4218 if (UNLIKELY(info.Length() < 1)) { 4218 if (UNLIKELY(info.Length() < 1)) {
4219 throwTypeError(ExceptionMessages::failedToExecute("domStringListFunction ", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info. GetIsolate()); 4219 throwTypeError(ExceptionMessages::failedToExecute("domStringListFunction ", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info. GetIsolate());
4220 return; 4220 return;
4221 } 4221 }
4222 TestObj* imp = V8TestObject::toNative(info.Holder()); 4222 TestObj* imp = V8TestObject::toNative(info.Holder());
4223 ExceptionState es(info.GetIsolate()); 4223 ExceptionState es(info.Holder(), info.GetIsolate());
4224 V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::HasInstance(info[0] , info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v 8::Handle<v8::Object>::Cast(info[0])) : 0); 4224 V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::HasInstance(info[0] , info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v 8::Handle<v8::Object>::Cast(info[0])) : 0);
4225 RefPtr<DOMStringList> result = imp->domStringListFunction(values, es); 4225 RefPtr<DOMStringList> result = imp->domStringListFunction(values, es);
4226 if (es.throwIfNeeded()) 4226 if (es.throwIfNeeded())
4227 return; 4227 return;
4228 v8SetReturnValue(info, result.release()); 4228 v8SetReturnValue(info, result.release());
4229 } 4229 }
4230 4230
4231 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& info) 4231 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& info)
4232 { 4232 {
4233 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4233 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4234 TestObjV8Internal::domStringListFunctionMethod(info); 4234 TestObjV8Internal::domStringListFunctionMethod(info);
4235 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4235 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4236 } 4236 }
4237 4237
4238 static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info ) 4238 static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info )
4239 { 4239 {
4240 TestObj* imp = V8TestObject::toNative(info.Holder()); 4240 TestObj* imp = V8TestObject::toNative(info.Holder());
4241 ExceptionState es(info.GetIsolate()); 4241 ExceptionState es(info.Holder(), info.GetIsolate());
4242 if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(es), es)) { 4242 if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(es), es)) {
4243 v8SetReturnValueNull(info); 4243 v8SetReturnValueNull(info);
4244 es.throwIfNeeded(); 4244 es.throwIfNeeded();
4245 return; 4245 return;
4246 } 4246 }
4247 RefPtr<SVGDocument> result = imp->getSVGDocument(es); 4247 RefPtr<SVGDocument> result = imp->getSVGDocument(es);
4248 if (es.throwIfNeeded()) 4248 if (es.throwIfNeeded())
4249 return; 4249 return;
4250 v8SetReturnValue(info, result.release()); 4250 v8SetReturnValue(info, result.release());
4251 } 4251 }
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
4342 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4342 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4343 } 4343 }
4344 4344
4345 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info) 4345 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info)
4346 { 4346 {
4347 if (UNLIKELY(info.Length() < 2)) { 4347 if (UNLIKELY(info.Length() < 2)) {
4348 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G etIsolate()); 4348 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G etIsolate());
4349 return; 4349 return;
4350 } 4350 }
4351 TestObj* imp = V8TestObject::toNative(info.Holder()); 4351 TestObj* imp = V8TestObject::toNative(info.Holder());
4352 ExceptionState es(info.GetIsolate()); 4352 ExceptionState es(info.Holder(), info.GetIsolate());
4353 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::HasInst ance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) { 4353 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::HasInst ance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) {
4354 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); 4354 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate());
4355 return; 4355 return;
4356 } 4356 }
4357 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::Has Instance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint: :toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0); 4357 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, item, V8SVGPoint::Has Instance(info[0], info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPoint: :toNative(v8::Handle<v8::Object>::Cast(info[0])) : 0);
4358 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1])); 4358 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1]));
4359 if (!item) { 4359 if (!item) {
4360 throwUninformativeAndGenericTypeError(info.GetIsolate()); 4360 throwUninformativeAndGenericTypeError(info.GetIsolate());
4361 return; 4361 return;
4362 } 4362 }
(...skipping 23 matching lines...) Expand all
4386 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4386 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4387 } 4387 }
4388 4388
4389 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info ) 4389 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info )
4390 { 4390 {
4391 if (UNLIKELY(info.Length() < 3)) { 4391 if (UNLIKELY(info.Length() < 3)) {
4392 throwTypeError(ExceptionMessages::failedToExecute("strictFunction", "Tes tObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsol ate()); 4392 throwTypeError(ExceptionMessages::failedToExecute("strictFunction", "Tes tObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsol ate());
4393 return; 4393 return;
4394 } 4394 }
4395 TestObj* imp = V8TestObject::toNative(info.Holder()); 4395 TestObj* imp = V8TestObject::toNative(info.Holder());
4396 ExceptionState es(info.GetIsolate()); 4396 ExceptionState es(info.Holder(), info.GetIsolate());
4397 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); 4397 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
4398 V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue())); 4398 V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue()));
4399 V8TRYCATCH_VOID(int, b, toInt32(info[2])); 4399 V8TRYCATCH_VOID(int, b, toInt32(info[2]));
4400 bool result = imp->strictFunction(str, a, b, es); 4400 bool result = imp->strictFunction(str, a, b, es);
4401 if (es.throwIfNeeded()) 4401 if (es.throwIfNeeded())
4402 return; 4402 return;
4403 v8SetReturnValueBool(info, result); 4403 v8SetReturnValueBool(info, result);
4404 } 4404 }
4405 4405
4406 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info) 4406 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info)
(...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after
4920 4920
4921 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info) 4921 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info)
4922 { 4922 {
4923 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 4923 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
4924 TestObjV8Internal::namedPropertyGetter(name, info); 4924 TestObjV8Internal::namedPropertyGetter(name, info);
4925 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4925 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4926 } 4926 }
4927 4927
4928 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo) 4928 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo)
4929 { 4929 {
4930 ExceptionState es(info.GetIsolate()); 4930 ExceptionState es(info.Holder(), info.GetIsolate());
4931 TestObj* collection = V8TestObject::toNative(info.Holder()); 4931 TestObj* collection = V8TestObject::toNative(info.Holder());
4932 Vector<String> names; 4932 Vector<String> names;
4933 collection->namedPropertyEnumerator(names, es); 4933 collection->namedPropertyEnumerator(names, es);
4934 if (es.throwIfNeeded()) 4934 if (es.throwIfNeeded())
4935 return; 4935 return;
4936 v8::Handle<v8::Array> v8names = v8::Array::New(names.size()); 4936 v8::Handle<v8::Array> v8names = v8::Array::New(names.size());
4937 for (size_t i = 0; i < names.size(); ++i) 4937 for (size_t i = 0; i < names.size(); ++i)
4938 v8names->Set(v8::Integer::New(i, info.GetIsolate()), v8String(names[i], info.GetIsolate())); 4938 v8names->Set(v8::Integer::New(i, info.GetIsolate()), v8String(names[i], info.GetIsolate()));
4939 v8SetReturnValue(info, v8names); 4939 v8SetReturnValue(info, v8names);
4940 } 4940 }
4941 4941
4942 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal lbackInfo<v8::Integer>& info) 4942 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal lbackInfo<v8::Integer>& info)
4943 { 4943 {
4944 TestObj* collection = V8TestObject::toNative(info.Holder()); 4944 TestObj* collection = V8TestObject::toNative(info.Holder());
4945 AtomicString propertyName = toWebCoreAtomicString(name); 4945 AtomicString propertyName = toWebCoreAtomicString(name);
4946 ExceptionState es(info.GetIsolate()); 4946 ExceptionState es(info.Holder(), info.GetIsolate());
4947 bool result = collection->namedPropertyQuery(propertyName, es); 4947 bool result = collection->namedPropertyQuery(propertyName, es);
4948 if (es.throwIfNeeded()) 4948 if (es.throwIfNeeded())
4949 return; 4949 return;
4950 if (!result) 4950 if (!result)
4951 return; 4951 return;
4952 v8SetReturnValueInt(info, v8::None); 4952 v8SetReturnValueInt(info, v8::None);
4953 } 4953 }
4954 4954
4955 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info) 4955 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info)
4956 { 4956 {
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
5337 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf o, wrapper, isolate, WrapperConfiguration::Independent); 5337 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf o, wrapper, isolate, WrapperConfiguration::Independent);
5338 return wrapper; 5338 return wrapper;
5339 } 5339 }
5340 5340
5341 void V8TestObject::derefObject(void* object) 5341 void V8TestObject::derefObject(void* object)
5342 { 5342 {
5343 fromInternalPointer(object)->deref(); 5343 fromInternalPointer(object)->deref();
5344 } 5344 }
5345 5345
5346 } // namespace WebCore 5346 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698