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

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

Issue 99083002: WIP: Migrate generated bindings to new ExceptionState constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase. 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 860 matching lines...) Expand 10 before | Expand all | Expand 10 after
871 static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 871 static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
872 { 872 {
873 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 873 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
874 TestObjV8Internal::typedArrayAttrAttributeSetter(jsValue, info); 874 TestObjV8Internal::typedArrayAttrAttributeSetter(jsValue, info);
875 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 875 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
876 } 876 }
877 877
878 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInf o<v8::Value>& info) 878 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInf o<v8::Value>& info)
879 { 879 {
880 TestObj* imp = V8TestObject::toNative(info.Holder()); 880 TestObj* imp = V8TestObject::toNative(info.Holder());
881 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 881 ExceptionState exceptionState(ExceptionState::GetterContext, "attrWithGetter Exception", "TestObject" ,info.Holder(), info.GetIsolate());
882 int jsValue = imp->attrWithGetterException(exceptionState); 882 int jsValue = imp->attrWithGetterException(exceptionState);
883 if (UNLIKELY(exceptionState.throwIfNeeded())) 883 if (UNLIKELY(exceptionState.throwIfNeeded()))
884 return; 884 return;
885 v8SetReturnValueInt(info, jsValue); 885 v8SetReturnValueInt(info, jsValue);
886 } 886 }
887 887
888 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info) 888 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info)
889 { 889 {
890 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 890 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
891 TestObjV8Internal::attrWithGetterExceptionAttributeGetter(info); 891 TestObjV8Internal::attrWithGetterExceptionAttributeGetter(info);
(...skipping 22 matching lines...) Expand all
914 914
915 static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info) 915 static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String> , const v8::PropertyCallbackInfo<v8::Value>& info)
916 { 916 {
917 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 917 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
918 TestObjV8Internal::attrWithSetterExceptionAttributeGetter(info); 918 TestObjV8Internal::attrWithSetterExceptionAttributeGetter(info);
919 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 919 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
920 } 920 }
921 921
922 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 922 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
923 { 923 {
924 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithSetter Exception", "TestObject", info.Holder(), info.GetIsolate());
924 TestObj* imp = V8TestObject::toNative(info.Holder()); 925 TestObj* imp = V8TestObject::toNative(info.Holder());
925 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); 926 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue));
926 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
927 imp->setAttrWithSetterException(cppValue, exceptionState); 927 imp->setAttrWithSetterException(cppValue, exceptionState);
928 exceptionState.throwIfNeeded(); 928 exceptionState.throwIfNeeded();
929 } 929 }
930 930
931 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 931 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String> , v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
932 { 932 {
933 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 933 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
934 TestObjV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info); 934 TestObjV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info);
935 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 935 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
936 } 936 }
937 937
938 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallb ackInfo<v8::Value>& info) 938 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallb ackInfo<v8::Value>& info)
939 { 939 {
940 TestObj* imp = V8TestObject::toNative(info.Holder()); 940 TestObj* imp = V8TestObject::toNative(info.Holder());
941 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 941 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttrWith GetterException", "TestObject" ,info.Holder(), info.GetIsolate());
942 String jsValue = imp->stringAttrWithGetterException(exceptionState); 942 String jsValue = imp->stringAttrWithGetterException(exceptionState);
943 if (UNLIKELY(exceptionState.throwIfNeeded())) 943 if (UNLIKELY(exceptionState.throwIfNeeded()))
944 return; 944 return;
945 v8SetReturnValueString(info, jsValue, info.GetIsolate()); 945 v8SetReturnValueString(info, jsValue, info.GetIsolate());
946 } 946 }
947 947
948 static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::S tring>, const v8::PropertyCallbackInfo<v8::Value>& info) 948 static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::S tring>, const v8::PropertyCallbackInfo<v8::Value>& info)
949 { 949 {
950 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 950 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
951 TestObjV8Internal::stringAttrWithGetterExceptionAttributeGetter(info); 951 TestObjV8Internal::stringAttrWithGetterExceptionAttributeGetter(info);
(...skipping 22 matching lines...) Expand all
974 974
975 static void stringAttrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::S tring>, const v8::PropertyCallbackInfo<v8::Value>& info) 975 static void stringAttrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::S tring>, const v8::PropertyCallbackInfo<v8::Value>& info)
976 { 976 {
977 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 977 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
978 TestObjV8Internal::stringAttrWithSetterExceptionAttributeGetter(info); 978 TestObjV8Internal::stringAttrWithSetterExceptionAttributeGetter(info);
979 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 979 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
980 } 980 }
981 981
982 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> js Value, const v8::PropertyCallbackInfo<void>& info) 982 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> js Value, const v8::PropertyCallbackInfo<void>& info)
983 { 983 {
984 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttrWith SetterException", "TestObject", info.Holder(), info.GetIsolate());
984 TestObj* imp = V8TestObject::toNative(info.Holder()); 985 TestObj* imp = V8TestObject::toNative(info.Holder());
985 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); 986 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
986 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
987 imp->setStringAttrWithSetterException(cppValue, exceptionState); 987 imp->setStringAttrWithSetterException(cppValue, exceptionState);
988 exceptionState.throwIfNeeded(); 988 exceptionState.throwIfNeeded();
989 } 989 }
990 990
991 static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::S tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info ) 991 static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::S tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info )
992 { 992 {
993 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 993 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
994 TestObjV8Internal::stringAttrWithSetterExceptionAttributeSetter(jsValue, inf o); 994 TestObjV8Internal::stringAttrWithSetterExceptionAttributeSetter(jsValue, inf o);
995 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 995 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
996 } 996 }
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::L ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v oid>& info) 1098 static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::L ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v oid>& info)
1099 { 1099 {
1100 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1100 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1101 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(js Value, info); 1101 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(js Value, info);
1102 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1102 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1103 } 1103 }
1104 1104
1105 static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCall backInfo<v8::Value>& info) 1105 static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCall backInfo<v8::Value>& info)
1106 { 1106 {
1107 TestObj* imp = V8TestObject::toNative(info.Holder()); 1107 TestObj* imp = V8TestObject::toNative(info.Holder());
1108 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 1108 ExceptionState exceptionState(ExceptionState::GetterContext, "withScriptStat eAttributeRaises", "TestObject" ,info.Holder(), info.GetIsolate());
1109 ScriptState* currentState = ScriptState::current(); 1109 ScriptState* currentState = ScriptState::current();
1110 if (!currentState) 1110 if (!currentState)
1111 return v8Undefined(); 1111 return v8Undefined();
1112 ScriptState& state = *currentState; 1112 ScriptState& state = *currentState;
1113 RefPtr<TestObj> jsValue = imp->withScriptStateAttributeRaises(&state, except ionState); 1113 RefPtr<TestObj> jsValue = imp->withScriptStateAttributeRaises(&state, except ionState);
1114 if (UNLIKELY(exceptionState.throwIfNeeded())) 1114 if (UNLIKELY(exceptionState.throwIfNeeded()))
1115 return; 1115 return;
1116 if (state.hadException()) { 1116 if (state.hadException()) {
1117 throwError(state.exception(), info.GetIsolate()); 1117 throwError(state.exception(), info.GetIsolate());
1118 return; 1118 return;
(...skipping 24 matching lines...) Expand all
1143 static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8:: String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf o) 1143 static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8:: String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf o)
1144 { 1144 {
1145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1146 TestObjV8Internal::withScriptStateAttributeRaisesAttributeSetter(jsValue, in fo); 1146 TestObjV8Internal::withScriptStateAttributeRaisesAttributeSetter(jsValue, in fo);
1147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1148 } 1148 }
1149 1149
1150 static void withExecutionContextAttributeRaisesAttributeGetter(const v8::Propert yCallbackInfo<v8::Value>& info) 1150 static void withExecutionContextAttributeRaisesAttributeGetter(const v8::Propert yCallbackInfo<v8::Value>& info)
1151 { 1151 {
1152 TestObj* imp = V8TestObject::toNative(info.Holder()); 1152 TestObj* imp = V8TestObject::toNative(info.Holder());
1153 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 1153 ExceptionState exceptionState(ExceptionState::GetterContext, "withExecutionC ontextAttributeRaises", "TestObject" ,info.Holder(), info.GetIsolate());
1154 ExecutionContext* scriptContext = getExecutionContext(); 1154 ExecutionContext* scriptContext = getExecutionContext();
1155 RefPtr<TestObj> jsValue = imp->withExecutionContextAttributeRaises(scriptCon text, exceptionState); 1155 RefPtr<TestObj> jsValue = imp->withExecutionContextAttributeRaises(scriptCon text, exceptionState);
1156 if (UNLIKELY(exceptionState.throwIfNeeded())) 1156 if (UNLIKELY(exceptionState.throwIfNeeded()))
1157 return; 1157 return;
1158 v8SetReturnValueFast(info, jsValue.release(), imp); 1158 v8SetReturnValueFast(info, jsValue.release(), imp);
1159 } 1159 }
1160 1160
1161 static void withExecutionContextAttributeRaisesAttributeGetterCallback(v8::Local <v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1161 static void withExecutionContextAttributeRaisesAttributeGetterCallback(v8::Local <v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1162 { 1162 {
1163 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1163 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
1215 static void withExecutionContextAndScriptStateAttributeAttributeSetterCallback(v 8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackIn fo<void>& info) 1215 static void withExecutionContextAndScriptStateAttributeAttributeSetterCallback(v 8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackIn fo<void>& info)
1216 { 1216 {
1217 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1217 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1218 TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeSette r(jsValue, info); 1218 TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeSette r(jsValue, info);
1219 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1219 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1220 } 1220 }
1221 1221
1222 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(con st v8::PropertyCallbackInfo<v8::Value>& info) 1222 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(con st v8::PropertyCallbackInfo<v8::Value>& info)
1223 { 1223 {
1224 TestObj* imp = V8TestObject::toNative(info.Holder()); 1224 TestObj* imp = V8TestObject::toNative(info.Holder());
1225 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 1225 ExceptionState exceptionState(ExceptionState::GetterContext, "withExecutionC ontextAndScriptStateAttributeRaises", "TestObject" ,info.Holder(), info.GetIsola te());
1226 ScriptState* currentState = ScriptState::current(); 1226 ScriptState* currentState = ScriptState::current();
1227 if (!currentState) 1227 if (!currentState)
1228 return v8Undefined(); 1228 return v8Undefined();
1229 ScriptState& state = *currentState; 1229 ScriptState& state = *currentState;
1230 ExecutionContext* scriptContext = getExecutionContext(); 1230 ExecutionContext* scriptContext = getExecutionContext();
1231 RefPtr<TestObj> jsValue = imp->withExecutionContextAndScriptStateAttributeRa ises(&state, scriptContext, exceptionState); 1231 RefPtr<TestObj> jsValue = imp->withExecutionContextAndScriptStateAttributeRa ises(&state, scriptContext, exceptionState);
1232 if (UNLIKELY(exceptionState.throwIfNeeded())) 1232 if (UNLIKELY(exceptionState.throwIfNeeded()))
1233 return; 1233 return;
1234 if (state.hadException()) { 1234 if (state.hadException()) {
1235 throwError(state.exception(), info.GetIsolate()); 1235 throwError(state.exception(), info.GetIsolate());
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 { 1679 {
1680 v8::Handle<v8::String> propertyName = v8::String::NewFromUtf8(info.GetIsolat e(), "cachedDirtyableAttributeRaises", v8::String::kInternalizedString); 1680 v8::Handle<v8::String> propertyName = v8::String::NewFromUtf8(info.GetIsolat e(), "cachedDirtyableAttributeRaises", v8::String::kInternalizedString);
1681 TestObj* imp = V8TestObject::toNative(info.Holder()); 1681 TestObj* imp = V8TestObject::toNative(info.Holder());
1682 if (!imp->isValueDirty()) { 1682 if (!imp->isValueDirty()) {
1683 v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyNa me); 1683 v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyNa me);
1684 if (!jsValue.IsEmpty()) { 1684 if (!jsValue.IsEmpty()) {
1685 v8SetReturnValue(info, jsValue); 1685 v8SetReturnValue(info, jsValue);
1686 return; 1686 return;
1687 } 1687 }
1688 } 1688 }
1689 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 1689 ExceptionState exceptionState(ExceptionState::GetterContext, "cachedDirtyabl eAttributeRaises", "TestObject" ,info.Holder(), info.GetIsolate());
1690 ScriptValue jsValue = imp->cachedDirtyableAttributeRaises(exceptionState); 1690 ScriptValue jsValue = imp->cachedDirtyableAttributeRaises(exceptionState);
1691 if (UNLIKELY(exceptionState.throwIfNeeded())) 1691 if (UNLIKELY(exceptionState.throwIfNeeded()))
1692 return; 1692 return;
1693 info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value()); 1693 info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value());
1694 v8SetReturnValue(info, jsValue.v8Value()); 1694 v8SetReturnValue(info, jsValue.v8Value());
1695 } 1695 }
1696 1696
1697 static void cachedDirtyableAttributeRaisesAttributeGetterCallback(v8::Local<v8:: String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1697 static void cachedDirtyableAttributeRaisesAttributeGetterCallback(v8::Local<v8:: String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1698 { 1698 {
1699 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1699 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
1886 static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::L ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 1886 static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::L ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1887 { 1887 {
1888 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1888 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1889 TestObjV8Internal::messagePortArrayAttributeSetter(jsValue, info); 1889 TestObjV8Internal::messagePortArrayAttributeSetter(jsValue, info);
1890 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1890 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1891 } 1891 }
1892 1892
1893 static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Va lue>& info) 1893 static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Va lue>& info)
1894 { 1894 {
1895 TestObj* imp = V8TestObject::toNative(info.Holder()); 1895 TestObj* imp = V8TestObject::toNative(info.Holder());
1896 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 1896 ExceptionState exceptionState(ExceptionState::GetterContext, "contentDocumen t", "TestObject" ,info.Holder(), info.GetIsolate());
1897 if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument(), except ionState)) { 1897 if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument(), except ionState)) {
1898 v8SetReturnValueNull(info); 1898 v8SetReturnValueNull(info);
1899 exceptionState.throwIfNeeded(); 1899 exceptionState.throwIfNeeded();
1900 return; 1900 return;
1901 } 1901 }
1902 v8SetReturnValueFast(info, imp->contentDocument(), imp); 1902 v8SetReturnValueFast(info, imp->contentDocument(), imp);
1903 } 1903 }
1904 1904
1905 static void contentDocumentAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) 1905 static void contentDocumentAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
1906 { 1906 {
(...skipping 10 matching lines...) Expand all
1917 1917
1918 static void mutablePointAttributeGetterCallback(v8::Local<v8::String>, const v8: :PropertyCallbackInfo<v8::Value>& info) 1918 static void mutablePointAttributeGetterCallback(v8::Local<v8::String>, const v8: :PropertyCallbackInfo<v8::Value>& info)
1919 { 1919 {
1920 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1920 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1921 TestObjV8Internal::mutablePointAttributeGetter(info); 1921 TestObjV8Internal::mutablePointAttributeGetter(info);
1922 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1922 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1923 } 1923 }
1924 1924
1925 static void mutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8:: PropertyCallbackInfo<void>& info) 1925 static void mutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8:: PropertyCallbackInfo<void>& info)
1926 { 1926 {
1927 ExceptionState exceptionState(ExceptionState::SetterContext, "mutablePoint", "TestObject", info.Holder(), info.GetIsolate());
1927 TestObj* imp = V8TestObject::toNative(info.Holder()); 1928 TestObj* imp = V8TestObject::toNative(info.Holder());
1928 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint: :hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); 1929 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint: :hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1929 if (!WTF::getPtr(cppValue)) { 1930 if (!WTF::getPtr(cppValue)) {
1930 throwTypeError(ExceptionMessages::failedToSet("mutablePoint", "TestObjec t", "The provided value is not of type 'SVGPoint'."), info.GetIsolate()); 1931 exceptionState.throwTypeError("The provided value is not of type 'SVGPoi nt'.");
1932 exceptionState.throwIfNeeded();
1931 return; 1933 return;
1932 } 1934 }
1933 imp->setMutablePoint(WTF::getPtr(cppValue)->propertyReference()); 1935 imp->setMutablePoint(WTF::getPtr(cppValue)->propertyReference());
1934 } 1936 }
1935 1937
1936 static void mutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Local <v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 1938 static void mutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Local <v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1937 { 1939 {
1938 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1940 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1939 TestObjV8Internal::mutablePointAttributeSetter(jsValue, info); 1941 TestObjV8Internal::mutablePointAttributeSetter(jsValue, info);
1940 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1942 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1941 } 1943 }
1942 1944
1943 static void immutablePointAttributeGetter(const v8::PropertyCallbackInfo<v8::Val ue>& info) 1945 static void immutablePointAttributeGetter(const v8::PropertyCallbackInfo<v8::Val ue>& info)
1944 { 1946 {
1945 TestObj* imp = V8TestObject::toNative(info.Holder()); 1947 TestObj* imp = V8TestObject::toNative(info.Holder());
1946 v8SetReturnValueFast(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create( imp->immutablePoint())), imp); 1948 v8SetReturnValueFast(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create( imp->immutablePoint())), imp);
1947 } 1949 }
1948 1950
1949 static void immutablePointAttributeGetterCallback(v8::Local<v8::String>, const v 8::PropertyCallbackInfo<v8::Value>& info) 1951 static void immutablePointAttributeGetterCallback(v8::Local<v8::String>, const v 8::PropertyCallbackInfo<v8::Value>& info)
1950 { 1952 {
1951 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 1953 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
1952 TestObjV8Internal::immutablePointAttributeGetter(info); 1954 TestObjV8Internal::immutablePointAttributeGetter(info);
1953 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1955 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
1954 } 1956 }
1955 1957
1956 static void immutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8 ::PropertyCallbackInfo<void>& info) 1958 static void immutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8 ::PropertyCallbackInfo<void>& info)
1957 { 1959 {
1960 ExceptionState exceptionState(ExceptionState::SetterContext, "immutablePoint ", "TestObject", info.Holder(), info.GetIsolate());
1958 TestObj* imp = V8TestObject::toNative(info.Holder()); 1961 TestObj* imp = V8TestObject::toNative(info.Holder());
1959 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint: :hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); 1962 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint: :hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0);
1960 if (!WTF::getPtr(cppValue)) { 1963 if (!WTF::getPtr(cppValue)) {
1961 throwTypeError(ExceptionMessages::failedToSet("immutablePoint", "TestObj ect", "The provided value is not of type 'SVGPoint'."), info.GetIsolate()); 1964 exceptionState.throwTypeError("The provided value is not of type 'SVGPoi nt'.");
1965 exceptionState.throwIfNeeded();
1962 return; 1966 return;
1963 } 1967 }
1964 imp->setImmutablePoint(WTF::getPtr(cppValue)->propertyReference()); 1968 imp->setImmutablePoint(WTF::getPtr(cppValue)->propertyReference());
1965 } 1969 }
1966 1970
1967 static void immutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 1971 static void immutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Loc al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
1968 { 1972 {
1969 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 1973 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
1970 TestObjV8Internal::immutablePointAttributeSetter(jsValue, info); 1974 TestObjV8Internal::immutablePointAttributeSetter(jsValue, info);
1971 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 1975 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
2006 2010
2007 static void strictFloatAttributeGetterCallback(v8::Local<v8::String>, const v8:: PropertyCallbackInfo<v8::Value>& info) 2011 static void strictFloatAttributeGetterCallback(v8::Local<v8::String>, const v8:: PropertyCallbackInfo<v8::Value>& info)
2008 { 2012 {
2009 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); 2013 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
2010 TestObjV8Internal::strictFloatAttributeGetter(info); 2014 TestObjV8Internal::strictFloatAttributeGetter(info);
2011 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 2015 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2012 } 2016 }
2013 2017
2014 static void strictFloatAttributeSetter(v8::Local<v8::Value> jsValue, const v8::P ropertyCallbackInfo<void>& info) 2018 static void strictFloatAttributeSetter(v8::Local<v8::Value> jsValue, const v8::P ropertyCallbackInfo<void>& info)
2015 { 2019 {
2020 ExceptionState exceptionState(ExceptionState::SetterContext, "strictFloat", "TestObject", info.Holder(), info.GetIsolate());
2016 TestObj* imp = V8TestObject::toNative(info.Holder()); 2021 TestObj* imp = V8TestObject::toNative(info.Holder());
2017 V8TRYCATCH_VOID(float, cppValue, static_cast<float>(jsValue->NumberValue())) ; 2022 V8TRYCATCH_VOID(float, cppValue, static_cast<float>(jsValue->NumberValue())) ;
2018 imp->setStrictFloat(cppValue); 2023 imp->setStrictFloat(cppValue);
2019 } 2024 }
2020 2025
2021 static void strictFloatAttributeSetterCallback(v8::Local<v8::String>, v8::Local< v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 2026 static void strictFloatAttributeSetterCallback(v8::Local<v8::String>, v8::Local< v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2022 { 2027 {
2023 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2028 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2024 TestObjV8Internal::strictFloatAttributeSetter(jsValue, info); 2029 TestObjV8Internal::strictFloatAttributeSetter(jsValue, info);
2025 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 2030 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
2143 static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::S tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info ) 2148 static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::S tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info )
2144 { 2149 {
2145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2150 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2146 TestObjV8Internal::nullableLongSettableAttributeAttributeSetter(jsValue, inf o); 2151 TestObjV8Internal::nullableLongSettableAttributeAttributeSetter(jsValue, inf o);
2147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 2152 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2148 } 2153 }
2149 2154
2150 static void nullableStringValueAttributeGetter(const v8::PropertyCallbackInfo<v8 ::Value>& info) 2155 static void nullableStringValueAttributeGetter(const v8::PropertyCallbackInfo<v8 ::Value>& info)
2151 { 2156 {
2152 TestObj* imp = V8TestObject::toNative(info.Holder()); 2157 TestObj* imp = V8TestObject::toNative(info.Holder());
2153 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 2158 ExceptionState exceptionState(ExceptionState::GetterContext, "nullableString Value", "TestObject" ,info.Holder(), info.GetIsolate());
2154 bool isNull = false; 2159 bool isNull = false;
2155 int jsValue = imp->nullableStringValue(isNull, exceptionState); 2160 int jsValue = imp->nullableStringValue(isNull, exceptionState);
2156 if (isNull) { 2161 if (isNull) {
2157 v8SetReturnValueNull(info); 2162 v8SetReturnValueNull(info);
2158 return; 2163 return;
2159 } 2164 }
2160 if (UNLIKELY(exceptionState.throwIfNeeded())) 2165 if (UNLIKELY(exceptionState.throwIfNeeded()))
2161 return; 2166 return;
2162 v8SetReturnValueInt(info, jsValue); 2167 v8SetReturnValueInt(info, jsValue);
2163 } 2168 }
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after
2872 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 2877 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2873 } 2878 }
2874 2879
2875 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, c onst v8::PropertyCallbackInfo<void>& info) 2880 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, c onst v8::PropertyCallbackInfo<void>& info)
2876 { 2881 {
2877 TestObj* proxyImp = V8TestObject::toNative(info.Holder()); 2882 TestObj* proxyImp = V8TestObject::toNative(info.Holder());
2878 TestNode* imp = proxyImp->locationWithException(); 2883 TestNode* imp = proxyImp->locationWithException();
2879 if (!imp) 2884 if (!imp)
2880 return; 2885 return;
2881 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); 2886 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue);
2882 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 2887 imp->setHrefThrows(cppValue);
2883 imp->setHrefThrows(cppValue, exceptionState);
2884 exceptionState.throwIfNeeded();
2885 } 2888 }
2886 2889
2887 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) 2890 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info)
2888 { 2891 {
2889 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); 2892 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
2890 TestObjV8Internal::locationWithExceptionAttributeSetter(jsValue, info); 2893 TestObjV8Internal::locationWithExceptionAttributeSetter(jsValue, info);
2891 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 2894 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
2892 } 2895 }
2893 2896
2894 static void TestObjConstructorGetter(v8::Local<v8::String>, const v8::PropertyCa llbackInfo<v8::Value>& info) 2897 static void TestObjConstructorGetter(v8::Local<v8::String>, const v8::PropertyCa llbackInfo<v8::Value>& info)
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
3065 3068
3066 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) 3069 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
3067 { 3070 {
3068 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3071 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3069 TestObjV8Internal::methodWithEnumArgMethod(info); 3072 TestObjV8Internal::methodWithEnumArgMethod(info);
3070 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3073 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3071 } 3074 }
3072 3075
3073 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI nfo<v8::Value>& info) 3076 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI nfo<v8::Value>& info)
3074 { 3077 {
3078 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodThatR equiresAllArgsAndThrows", "TestObject", info.Holder(), info.GetIsolate());
3075 if (UNLIKELY(info.Length() < 2)) { 3079 if (UNLIKELY(info.Length() < 2)) {
3076 throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAll ArgsAndThrows", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Leng th())), info.GetIsolate()); 3080 throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAll ArgsAndThrows", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Leng th())), info.GetIsolate());
3077 return; 3081 return;
3078 } 3082 }
3079 TestObj* imp = V8TestObject::toNative(info.Holder()); 3083 TestObj* imp = V8TestObject::toNative(info.Holder());
3080 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
3081 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); 3084 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
3082 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(info[1])) : 0); 3085 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8 ::Object>::Cast(info[1])) : 0);
3083 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj Arg, exceptionState); 3086 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj Arg, exceptionState);
3084 if (exceptionState.throwIfNeeded()) 3087 if (exceptionState.throwIfNeeded())
3085 return; 3088 return;
3086 v8SetReturnValue(info, result.release()); 3089 v8SetReturnValue(info, result.release());
3087 } 3090 }
3088 3091
3089 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& info) 3092 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& info)
3090 { 3093 {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
3172 3175
3173 static void optionsObjectListMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) 3176 static void optionsObjectListMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info)
3174 { 3177 {
3175 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3178 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3176 TestObjV8Internal::optionsObjectListMethod(info); 3179 TestObjV8Internal::optionsObjectListMethod(info);
3177 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3180 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3178 } 3181 }
3179 3182
3180 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 3183 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3181 { 3184 {
3185 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE xception", "TestObject", info.Holder(), info.GetIsolate());
3182 TestObj* imp = V8TestObject::toNative(info.Holder()); 3186 TestObj* imp = V8TestObject::toNative(info.Holder());
3183 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
3184 imp->methodWithException(exceptionState); 3187 imp->methodWithException(exceptionState);
3185 if (exceptionState.throwIfNeeded()) 3188 if (exceptionState.throwIfNeeded())
3186 return; 3189 return;
3187 } 3190 }
3188 3191
3189 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) 3192 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
3190 { 3193 {
3191 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3194 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3192 TestObjV8Internal::methodWithExceptionMethod(info); 3195 TestObjV8Internal::methodWithExceptionMethod(info);
3193 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3196 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3194 } 3197 }
3195 3198
3196 static void customMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info) 3199 static void customMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value> & info)
3197 { 3200 {
3198 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3201 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3199 UseCounter::count(activeDOMWindow(), UseCounter::CustomTestFeature); 3202 UseCounter::count(activeDOMWindow(), UseCounter::CustomTestFeature);
3200 V8TestObject::customMethodMethodCustom(info); 3203 V8TestObject::customMethodMethodCustom(info);
3201 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3204 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3202 } 3205 }
3203 3206
3204 static void customMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& info) 3207 static void customMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8 ::Value>& info)
3205 { 3208 {
3206 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3209 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3207 V8TestObject::customMethodWithArgsMethodCustom(info); 3210 V8TestObject::customMethodWithArgsMethodCustom(info);
3208 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3211 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3209 } 3212 }
3210 3213
3211 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& in fo) 3214 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& in fo)
3212 { 3215 {
3216 ExceptionState exceptionState(ExceptionState::ExecutionContext, "addEventLis tener", "TestObject", info.Holder(), info.GetIsolate());
3213 EventTarget* impl = V8TestObject::toNative(info.Holder()); 3217 EventTarget* impl = V8TestObject::toNative(info.Holder());
3214 if (DOMWindow* window = impl->toDOMWindow()) { 3218 if (DOMWindow* window = impl->toDOMWindow()) {
3215 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
3216 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio nState)) { 3219 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio nState)) {
3217 exceptionState.throwIfNeeded(); 3220 exceptionState.throwIfNeeded();
3218 return; 3221 return;
3219 } 3222 }
3220 if (!window->document()) 3223 if (!window->document())
3221 return; 3224 return;
3222 } 3225 }
3223 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[ 1], false, ListenerFindOrCreate); 3226 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[ 1], false, ListenerFindOrCreate);
3224 if (listener) { 3227 if (listener) {
3225 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev entName, info[0]); 3228 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev entName, info[0]);
3226 impl->addEventListener(eventName, listener, info[2]->BooleanValue()); 3229 impl->addEventListener(eventName, listener, info[2]->BooleanValue());
3227 if (!impl->toNode()) 3230 if (!impl->toNode())
3228 createHiddenDependency(info.Holder(), info[1], V8TestObject::eventLi stenerCacheIndex, info.GetIsolate()); 3231 createHiddenDependency(info.Holder(), info[1], V8TestObject::eventLi stenerCacheIndex, info.GetIsolate());
3229 } 3232 }
3230 } 3233 }
3231 3234
3232 static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info) 3235 static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info)
3233 { 3236 {
3234 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3237 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3235 TestObjV8Internal::addEventListenerMethod(info); 3238 TestObjV8Internal::addEventListenerMethod(info);
3236 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3239 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3237 } 3240 }
3238 3241
3239 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 3242 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
3240 { 3243 {
3244 ExceptionState exceptionState(ExceptionState::ExecutionContext, "removeEvent Listener", "TestObject", info.Holder(), info.GetIsolate());
3241 EventTarget* impl = V8TestObject::toNative(info.Holder()); 3245 EventTarget* impl = V8TestObject::toNative(info.Holder());
3242 if (DOMWindow* window = impl->toDOMWindow()) { 3246 if (DOMWindow* window = impl->toDOMWindow()) {
3243 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
3244 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio nState)) { 3247 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio nState)) {
3245 exceptionState.throwIfNeeded(); 3248 exceptionState.throwIfNeeded();
3246 return; 3249 return;
3247 } 3250 }
3248 if (!window->document()) 3251 if (!window->document())
3249 return; 3252 return;
3250 } 3253 }
3251 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[ 1], false, ListenerFindOnly); 3254 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[ 1], false, ListenerFindOnly);
3252 if (listener) { 3255 if (listener) {
3253 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev entName, info[0]); 3256 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev entName, info[0]);
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
3306 3309
3307 static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info) 3310 static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info)
3308 { 3311 {
3309 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3312 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3310 TestObjV8Internal::withScriptStateObjMethod(info); 3313 TestObjV8Internal::withScriptStateObjMethod(info);
3311 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3314 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3312 } 3315 }
3313 3316
3314 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8 ::Value>& info) 3317 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8 ::Value>& info)
3315 { 3318 {
3319 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptS tateVoidException", "TestObject", info.Holder(), info.GetIsolate());
3316 TestObj* imp = V8TestObject::toNative(info.Holder()); 3320 TestObj* imp = V8TestObject::toNative(info.Holder());
3317 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
3318 ScriptState* currentState = ScriptState::current(); 3321 ScriptState* currentState = ScriptState::current();
3319 if (!currentState) 3322 if (!currentState)
3320 return; 3323 return;
3321 ScriptState& state = *currentState; 3324 ScriptState& state = *currentState;
3322 imp->withScriptStateVoidException(&state, exceptionState); 3325 imp->withScriptStateVoidException(&state, exceptionState);
3323 if (exceptionState.throwIfNeeded()) 3326 if (exceptionState.throwIfNeeded())
3324 return; 3327 return;
3325 if (state.hadException()) { 3328 if (state.hadException()) {
3326 v8::Local<v8::Value> exception = state.exception(); 3329 v8::Local<v8::Value> exception = state.exception();
3327 state.clearException(); 3330 state.clearException();
3328 throwError(exception, info.GetIsolate()); 3331 throwError(exception, info.GetIsolate());
3329 return; 3332 return;
3330 } 3333 }
3331 } 3334 }
3332 3335
3333 static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& info) 3336 static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& info)
3334 { 3337 {
3335 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3338 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3336 TestObjV8Internal::withScriptStateVoidExceptionMethod(info); 3339 TestObjV8Internal::withScriptStateVoidExceptionMethod(info);
3337 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3340 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3338 } 3341 }
3339 3342
3340 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8: :Value>& info) 3343 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8: :Value>& info)
3341 { 3344 {
3345 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptS tateObjException", "TestObject", info.Holder(), info.GetIsolate());
3342 TestObj* imp = V8TestObject::toNative(info.Holder()); 3346 TestObj* imp = V8TestObject::toNative(info.Holder());
3343 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
3344 ScriptState* currentState = ScriptState::current(); 3347 ScriptState* currentState = ScriptState::current();
3345 if (!currentState) 3348 if (!currentState)
3346 return; 3349 return;
3347 ScriptState& state = *currentState; 3350 ScriptState& state = *currentState;
3348 RefPtr<TestObj> result = imp->withScriptStateObjException(&state, exceptionS tate); 3351 RefPtr<TestObj> result = imp->withScriptStateObjException(&state, exceptionS tate);
3349 if (exceptionState.throwIfNeeded()) 3352 if (exceptionState.throwIfNeeded())
3350 return; 3353 return;
3351 if (state.hadException()) { 3354 if (state.hadException()) {
3352 v8::Local<v8::Value> exception = state.exception(); 3355 v8::Local<v8::Value> exception = state.exception();
3353 state.clearException(); 3356 state.clearException();
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
3397 3400
3398 static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& info) 3401 static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& info)
3399 { 3402 {
3400 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 3403 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
3401 TestObjV8Internal::withExecutionContextAndScriptStateMethod(info); 3404 TestObjV8Internal::withExecutionContextAndScriptStateMethod(info);
3402 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 3405 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
3403 } 3406 }
3404 3407
3405 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::Funct ionCallbackInfo<v8::Value>& info) 3408 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::Funct ionCallbackInfo<v8::Value>& info)
3406 { 3409 {
3410 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withExecuti onContextAndScriptStateObjException", "TestObject", info.Holder(), info.GetIsola te());
3407 TestObj* imp = V8TestObject::toNative(info.Holder()); 3411 TestObj* imp = V8TestObject::toNative(info.Holder());
3408 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
3409 ScriptState* currentState = ScriptState::current(); 3412 ScriptState* currentState = ScriptState::current();
3410 if (!currentState) 3413 if (!currentState)
3411 return; 3414 return;
3412 ScriptState& state = *currentState; 3415 ScriptState& state = *currentState;
3413 ExecutionContext* scriptContext = getExecutionContext(); 3416 ExecutionContext* scriptContext = getExecutionContext();
3414 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateObjException (&state, scriptContext, exceptionState); 3417 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateObjException (&state, scriptContext, exceptionState);
3415 if (exceptionState.throwIfNeeded()) 3418 if (exceptionState.throwIfNeeded())
3416 return; 3419 return;
3417 if (state.hadException()) { 3420 if (state.hadException()) {
3418 v8::Local<v8::Value> exception = state.exception(); 3421 v8::Local<v8::Value> exception = state.exception();
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after
4241 4244
4242 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& info) 4245 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& info)
4243 { 4246 {
4244 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4247 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4245 TestObjV8Internal::methodWithUnsignedLongSequenceMethod(info); 4248 TestObjV8Internal::methodWithUnsignedLongSequenceMethod(info);
4246 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4249 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4247 } 4250 }
4248 4251
4249 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 4252 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
4250 { 4253 {
4254 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray Function", "TestObject", info.Holder(), info.GetIsolate());
4251 if (UNLIKELY(info.Length() < 1)) { 4255 if (UNLIKELY(info.Length() < 1)) {
4252 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Ge tIsolate()); 4256 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Ge tIsolate());
4253 return; 4257 return;
4254 } 4258 }
4255 TestObj* imp = V8TestObject::toNative(info.Holder()); 4259 TestObj* imp = V8TestObject::toNative(info.Holder());
4256 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
4257 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in fo.GetIsolate())); 4260 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in fo.GetIsolate()));
4258 Vector<String> result = imp->stringArrayFunction(values, exceptionState); 4261 Vector<String> result = imp->stringArrayFunction(values, exceptionState);
4259 if (exceptionState.throwIfNeeded()) 4262 if (exceptionState.throwIfNeeded())
4260 return; 4263 return;
4261 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); 4264 v8SetReturnValue(info, v8Array(result, info.GetIsolate()));
4262 } 4265 }
4263 4266
4264 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) 4267 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info)
4265 { 4268 {
4266 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4269 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4267 TestObjV8Internal::stringArrayFunctionMethod(info); 4270 TestObjV8Internal::stringArrayFunctionMethod(info);
4268 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4271 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4269 } 4272 }
4270 4273
4271 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value >& info) 4274 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value >& info)
4272 { 4275 {
4276 ExceptionState exceptionState(ExceptionState::ExecutionContext, "domStringLi stFunction", "TestObject", info.Holder(), info.GetIsolate());
4273 if (UNLIKELY(info.Length() < 1)) { 4277 if (UNLIKELY(info.Length() < 1)) {
4274 throwTypeError(ExceptionMessages::failedToExecute("domStringListFunction ", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info. GetIsolate()); 4278 throwTypeError(ExceptionMessages::failedToExecute("domStringListFunction ", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info. GetIsolate());
4275 return; 4279 return;
4276 } 4280 }
4277 TestObj* imp = V8TestObject::toNative(info.Holder()); 4281 TestObj* imp = V8TestObject::toNative(info.Holder());
4278 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
4279 V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::hasInstance(info[0] , info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v 8::Handle<v8::Object>::Cast(info[0])) : 0); 4282 V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::hasInstance(info[0] , info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v 8::Handle<v8::Object>::Cast(info[0])) : 0);
4280 RefPtr<DOMStringList> result = imp->domStringListFunction(values, exceptionS tate); 4283 RefPtr<DOMStringList> result = imp->domStringListFunction(values, exceptionS tate);
4281 if (exceptionState.throwIfNeeded()) 4284 if (exceptionState.throwIfNeeded())
4282 return; 4285 return;
4283 v8SetReturnValue(info, result.release()); 4286 v8SetReturnValue(info, result.release());
4284 } 4287 }
4285 4288
4286 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& info) 4289 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& info)
4287 { 4290 {
4288 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4291 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4289 TestObjV8Internal::domStringListFunctionMethod(info); 4292 TestObjV8Internal::domStringListFunctionMethod(info);
4290 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4293 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4291 } 4294 }
4292 4295
4293 static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info ) 4296 static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info )
4294 { 4297 {
4298 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getSVGDocum ent", "TestObject", info.Holder(), info.GetIsolate());
4295 TestObj* imp = V8TestObject::toNative(info.Holder()); 4299 TestObj* imp = V8TestObject::toNative(info.Holder());
4296 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
4297 if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(exceptionS tate), exceptionState)) { 4300 if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(exceptionS tate), exceptionState)) {
4298 v8SetReturnValueNull(info); 4301 v8SetReturnValueNull(info);
4299 exceptionState.throwIfNeeded(); 4302 exceptionState.throwIfNeeded();
4300 return; 4303 return;
4301 } 4304 }
4302 RefPtr<SVGDocument> result = imp->getSVGDocument(exceptionState); 4305 RefPtr<SVGDocument> result = imp->getSVGDocument(exceptionState);
4303 if (exceptionState.throwIfNeeded()) 4306 if (exceptionState.throwIfNeeded())
4304 return; 4307 return;
4305 v8SetReturnValue(info, result.release()); 4308 v8SetReturnValue(info, result.release());
4306 } 4309 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
4392 4395
4393 static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info) 4396 static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info)
4394 { 4397 {
4395 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4398 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4396 TestObjV8Internal::svgPointMethodMethod(info); 4399 TestObjV8Internal::svgPointMethodMethod(info);
4397 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4400 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4398 } 4401 }
4399 4402
4400 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info) 4403 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value> & info)
4401 { 4404 {
4405 ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictSVGPo intMethod", "TestObject", info.Holder(), info.GetIsolate());
4402 if (UNLIKELY(info.Length() < 2)) { 4406 if (UNLIKELY(info.Length() < 2)) {
4403 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G etIsolate()); 4407 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G etIsolate());
4404 return; 4408 return;
4405 } 4409 }
4406 TestObj* imp = V8TestObject::toNative(info.Holder()); 4410 TestObj* imp = V8TestObject::toNative(info.Holder());
4407 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
4408 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::hasInst ance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) { 4411 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::hasInst ance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) {
4409 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); 4412 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate());
4410 return; 4413 return;
4411 } 4414 }
4412 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); 4415 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);
4413 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1])); 4416 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1]));
4414 if (!item) { 4417 if (!item) {
4415 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); 4418 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod" , "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate());
4416 return; 4419 return;
4417 } 4420 }
(...skipping 18 matching lines...) Expand all
4436 4439
4437 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info ) 4440 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info )
4438 { 4441 {
4439 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); 4442 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
4440 TestObjV8Internal::orangeMethod(info); 4443 TestObjV8Internal::orangeMethod(info);
4441 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); 4444 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution");
4442 } 4445 }
4443 4446
4444 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info ) 4447 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info )
4445 { 4448 {
4449 ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictFunct ion", "TestObject", info.Holder(), info.GetIsolate());
4446 if (UNLIKELY(info.Length() < 3)) { 4450 if (UNLIKELY(info.Length() < 3)) {
4447 throwTypeError(ExceptionMessages::failedToExecute("strictFunction", "Tes tObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsol ate()); 4451 throwTypeError(ExceptionMessages::failedToExecute("strictFunction", "Tes tObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsol ate());
4448 return; 4452 return;
4449 } 4453 }
4450 TestObj* imp = V8TestObject::toNative(info.Holder()); 4454 TestObj* imp = V8TestObject::toNative(info.Holder());
4451 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
4452 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); 4455 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]);
4453 V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue())); 4456 V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue()));
4454 V8TRYCATCH_VOID(int, b, toInt32(info[2])); 4457 V8TRYCATCH_VOID(int, b, toInt32(info[2]));
4455 bool result = imp->strictFunction(str, a, b, exceptionState); 4458 bool result = imp->strictFunction(str, a, b, exceptionState);
4456 if (exceptionState.throwIfNeeded()) 4459 if (exceptionState.throwIfNeeded())
4457 return; 4460 return;
4458 v8SetReturnValueBool(info, result); 4461 v8SetReturnValueBool(info, result);
4459 } 4462 }
4460 4463
4461 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info) 4464 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Valu e>& info)
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
5406 fromInternalPointer(object)->deref(); 5409 fromInternalPointer(object)->deref();
5407 } 5410 }
5408 5411
5409 template<> 5412 template<>
5410 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate) 5413 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate)
5411 { 5414 {
5412 return toV8(impl, creationContext, isolate); 5415 return toV8(impl, creationContext, isolate);
5413 } 5416 }
5414 5417
5415 } // namespace WebCore 5418 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestNode.cpp ('k') | Source/bindings/tests/results/V8TestObjectPython.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698