OLD | NEW |
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 861 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Loc
al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 872 static void typedArrayAttrAttributeSetterCallback(v8::Local<v8::String>, v8::Loc
al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
873 { | 873 { |
874 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 874 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
875 TestObjV8Internal::typedArrayAttrAttributeSetter(jsValue, info); | 875 TestObjV8Internal::typedArrayAttrAttributeSetter(jsValue, info); |
876 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 876 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
877 } | 877 } |
878 | 878 |
879 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) | 879 static void attrWithGetterExceptionAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) |
880 { | 880 { |
881 TestObj* imp = V8TestObject::toNative(info.Holder()); | 881 TestObj* imp = V8TestObject::toNative(info.Holder()); |
882 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 882 ExceptionState exceptionState(ExceptionState::GetterContext, "attrWithGetter
Exception", "TestObject" ,info.Holder(), info.GetIsolate()); |
883 int jsValue = imp->attrWithGetterException(exceptionState); | 883 int jsValue = imp->attrWithGetterException(exceptionState); |
884 if (UNLIKELY(exceptionState.throwIfNeeded())) | 884 if (UNLIKELY(exceptionState.throwIfNeeded())) |
885 return; | 885 return; |
886 v8SetReturnValueInt(info, jsValue); | 886 v8SetReturnValueInt(info, jsValue); |
887 } | 887 } |
888 | 888 |
889 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) | 889 static void attrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) |
890 { | 890 { |
891 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 891 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
892 TestObjV8Internal::attrWithGetterExceptionAttributeGetter(info); | 892 TestObjV8Internal::attrWithGetterExceptionAttributeGetter(info); |
(...skipping 22 matching lines...) Expand all Loading... |
915 | 915 |
916 static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) | 916 static void attrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) |
917 { | 917 { |
918 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 918 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
919 TestObjV8Internal::attrWithSetterExceptionAttributeGetter(info); | 919 TestObjV8Internal::attrWithSetterExceptionAttributeGetter(info); |
920 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 920 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
921 } | 921 } |
922 | 922 |
923 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) | 923 static void attrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> jsValue,
const v8::PropertyCallbackInfo<void>& info) |
924 { | 924 { |
| 925 ExceptionState exceptionState(ExceptionState::SetterContext, "attrWithSetter
Exception", "TestObject", info.Holder(), info.GetIsolate()); |
925 TestObj* imp = V8TestObject::toNative(info.Holder()); | 926 TestObj* imp = V8TestObject::toNative(info.Holder()); |
926 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); | 927 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
927 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
928 imp->setAttrWithSetterException(cppValue, exceptionState); | 928 imp->setAttrWithSetterException(cppValue, exceptionState); |
929 exceptionState.throwIfNeeded(); | 929 exceptionState.throwIfNeeded(); |
930 } | 930 } |
931 | 931 |
932 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>
, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 932 static void attrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::String>
, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
933 { | 933 { |
934 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 934 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
935 TestObjV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info); | 935 TestObjV8Internal::attrWithSetterExceptionAttributeSetter(jsValue, info); |
936 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 936 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
937 } | 937 } |
938 | 938 |
939 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallb
ackInfo<v8::Value>& info) | 939 static void stringAttrWithGetterExceptionAttributeGetter(const v8::PropertyCallb
ackInfo<v8::Value>& info) |
940 { | 940 { |
941 TestObj* imp = V8TestObject::toNative(info.Holder()); | 941 TestObj* imp = V8TestObject::toNative(info.Holder()); |
942 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 942 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttrWith
GetterException", "TestObject" ,info.Holder(), info.GetIsolate()); |
943 String jsValue = imp->stringAttrWithGetterException(exceptionState); | 943 String jsValue = imp->stringAttrWithGetterException(exceptionState); |
944 if (UNLIKELY(exceptionState.throwIfNeeded())) | 944 if (UNLIKELY(exceptionState.throwIfNeeded())) |
945 return; | 945 return; |
946 v8SetReturnValueString(info, jsValue, info.GetIsolate()); | 946 v8SetReturnValueString(info, jsValue, info.GetIsolate()); |
947 } | 947 } |
948 | 948 |
949 static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) | 949 static void stringAttrWithGetterExceptionAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) |
950 { | 950 { |
951 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 951 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
952 TestObjV8Internal::stringAttrWithGetterExceptionAttributeGetter(info); | 952 TestObjV8Internal::stringAttrWithGetterExceptionAttributeGetter(info); |
(...skipping 22 matching lines...) Expand all Loading... |
975 | 975 |
976 static void stringAttrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) | 976 static void stringAttrWithSetterExceptionAttributeGetterCallback(v8::Local<v8::S
tring>, const v8::PropertyCallbackInfo<v8::Value>& info) |
977 { | 977 { |
978 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 978 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
979 TestObjV8Internal::stringAttrWithSetterExceptionAttributeGetter(info); | 979 TestObjV8Internal::stringAttrWithSetterExceptionAttributeGetter(info); |
980 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 980 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
981 } | 981 } |
982 | 982 |
983 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) | 983 static void stringAttrWithSetterExceptionAttributeSetter(v8::Local<v8::Value> js
Value, const v8::PropertyCallbackInfo<void>& info) |
984 { | 984 { |
| 985 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttrWith
SetterException", "TestObject", info.Holder(), info.GetIsolate()); |
985 TestObj* imp = V8TestObject::toNative(info.Holder()); | 986 TestObj* imp = V8TestObject::toNative(info.Holder()); |
986 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 987 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
987 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
988 imp->setStringAttrWithSetterException(cppValue, exceptionState); | 988 imp->setStringAttrWithSetterException(cppValue, exceptionState); |
989 exceptionState.throwIfNeeded(); | 989 exceptionState.throwIfNeeded(); |
990 } | 990 } |
991 | 991 |
992 static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) | 992 static void stringAttrWithSetterExceptionAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) |
993 { | 993 { |
994 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 994 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
995 TestObjV8Internal::stringAttrWithSetterExceptionAttributeSetter(jsValue, inf
o); | 995 TestObjV8Internal::stringAttrWithSetterExceptionAttributeSetter(jsValue, inf
o); |
996 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 996 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
997 } | 997 } |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1099 static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::L
ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v
oid>& info) | 1099 static void withActiveWindowAndFirstWindowAttributeAttributeSetterCallback(v8::L
ocal<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v
oid>& info) |
1100 { | 1100 { |
1101 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1101 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1102 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(js
Value, info); | 1102 TestObjV8Internal::withActiveWindowAndFirstWindowAttributeAttributeSetter(js
Value, info); |
1103 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1103 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
1104 } | 1104 } |
1105 | 1105 |
1106 static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) | 1106 static void withScriptStateAttributeRaisesAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) |
1107 { | 1107 { |
1108 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1108 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1109 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 1109 ExceptionState exceptionState(ExceptionState::GetterContext, "withScriptStat
eAttributeRaises", "TestObject" ,info.Holder(), info.GetIsolate()); |
1110 ScriptState* currentState = ScriptState::current(); | 1110 ScriptState* currentState = ScriptState::current(); |
1111 if (!currentState) | 1111 if (!currentState) |
1112 return v8Undefined(); | 1112 return v8Undefined(); |
1113 ScriptState& state = *currentState; | 1113 ScriptState& state = *currentState; |
1114 RefPtr<TestObj> jsValue = imp->withScriptStateAttributeRaises(&state, except
ionState); | 1114 RefPtr<TestObj> jsValue = imp->withScriptStateAttributeRaises(&state, except
ionState); |
1115 if (UNLIKELY(exceptionState.throwIfNeeded())) | 1115 if (UNLIKELY(exceptionState.throwIfNeeded())) |
1116 return; | 1116 return; |
1117 if (state.hadException()) { | 1117 if (state.hadException()) { |
1118 throwError(state.exception(), info.GetIsolate()); | 1118 throwError(state.exception(), info.GetIsolate()); |
1119 return; | 1119 return; |
(...skipping 24 matching lines...) Expand all Loading... |
1144 static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::
String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf
o) | 1144 static void withScriptStateAttributeRaisesAttributeSetterCallback(v8::Local<v8::
String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& inf
o) |
1145 { | 1145 { |
1146 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1146 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1147 TestObjV8Internal::withScriptStateAttributeRaisesAttributeSetter(jsValue, in
fo); | 1147 TestObjV8Internal::withScriptStateAttributeRaisesAttributeSetter(jsValue, in
fo); |
1148 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1148 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
1149 } | 1149 } |
1150 | 1150 |
1151 static void withExecutionContextAttributeRaisesAttributeGetter(const v8::Propert
yCallbackInfo<v8::Value>& info) | 1151 static void withExecutionContextAttributeRaisesAttributeGetter(const v8::Propert
yCallbackInfo<v8::Value>& info) |
1152 { | 1152 { |
1153 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1153 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1154 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 1154 ExceptionState exceptionState(ExceptionState::GetterContext, "withExecutionC
ontextAttributeRaises", "TestObject" ,info.Holder(), info.GetIsolate()); |
1155 ExecutionContext* scriptContext = getExecutionContext(); | 1155 ExecutionContext* scriptContext = getExecutionContext(); |
1156 RefPtr<TestObj> jsValue = imp->withExecutionContextAttributeRaises(scriptCon
text, exceptionState); | 1156 RefPtr<TestObj> jsValue = imp->withExecutionContextAttributeRaises(scriptCon
text, exceptionState); |
1157 if (UNLIKELY(exceptionState.throwIfNeeded())) | 1157 if (UNLIKELY(exceptionState.throwIfNeeded())) |
1158 return; | 1158 return; |
1159 v8SetReturnValueFast(info, jsValue.release(), imp); | 1159 v8SetReturnValueFast(info, jsValue.release(), imp); |
1160 } | 1160 } |
1161 | 1161 |
1162 static void withExecutionContextAttributeRaisesAttributeGetterCallback(v8::Local
<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1162 static void withExecutionContextAttributeRaisesAttributeGetterCallback(v8::Local
<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1163 { | 1163 { |
1164 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1164 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 static void withExecutionContextAndScriptStateAttributeAttributeSetterCallback(v
8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackIn
fo<void>& info) | 1216 static void withExecutionContextAndScriptStateAttributeAttributeSetterCallback(v
8::Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackIn
fo<void>& info) |
1217 { | 1217 { |
1218 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1218 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1219 TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeSette
r(jsValue, info); | 1219 TestObjV8Internal::withExecutionContextAndScriptStateAttributeAttributeSette
r(jsValue, info); |
1220 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1220 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
1221 } | 1221 } |
1222 | 1222 |
1223 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(con
st v8::PropertyCallbackInfo<v8::Value>& info) | 1223 static void withExecutionContextAndScriptStateAttributeRaisesAttributeGetter(con
st v8::PropertyCallbackInfo<v8::Value>& info) |
1224 { | 1224 { |
1225 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1225 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1226 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 1226 ExceptionState exceptionState(ExceptionState::GetterContext, "withExecutionC
ontextAndScriptStateAttributeRaises", "TestObject" ,info.Holder(), info.GetIsola
te()); |
1227 ScriptState* currentState = ScriptState::current(); | 1227 ScriptState* currentState = ScriptState::current(); |
1228 if (!currentState) | 1228 if (!currentState) |
1229 return v8Undefined(); | 1229 return v8Undefined(); |
1230 ScriptState& state = *currentState; | 1230 ScriptState& state = *currentState; |
1231 ExecutionContext* scriptContext = getExecutionContext(); | 1231 ExecutionContext* scriptContext = getExecutionContext(); |
1232 RefPtr<TestObj> jsValue = imp->withExecutionContextAndScriptStateAttributeRa
ises(&state, scriptContext, exceptionState); | 1232 RefPtr<TestObj> jsValue = imp->withExecutionContextAndScriptStateAttributeRa
ises(&state, scriptContext, exceptionState); |
1233 if (UNLIKELY(exceptionState.throwIfNeeded())) | 1233 if (UNLIKELY(exceptionState.throwIfNeeded())) |
1234 return; | 1234 return; |
1235 if (state.hadException()) { | 1235 if (state.hadException()) { |
1236 throwError(state.exception(), info.GetIsolate()); | 1236 throwError(state.exception(), info.GetIsolate()); |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1680 { | 1680 { |
1681 v8::Handle<v8::String> propertyName = v8::String::NewFromUtf8(info.GetIsolat
e(), "cachedDirtyableAttributeRaises", v8::String::kInternalizedString); | 1681 v8::Handle<v8::String> propertyName = v8::String::NewFromUtf8(info.GetIsolat
e(), "cachedDirtyableAttributeRaises", v8::String::kInternalizedString); |
1682 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1682 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1683 if (!imp->isValueDirty()) { | 1683 if (!imp->isValueDirty()) { |
1684 v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyNa
me); | 1684 v8::Handle<v8::Value> jsValue = info.Holder()->GetHiddenValue(propertyNa
me); |
1685 if (!jsValue.IsEmpty()) { | 1685 if (!jsValue.IsEmpty()) { |
1686 v8SetReturnValue(info, jsValue); | 1686 v8SetReturnValue(info, jsValue); |
1687 return; | 1687 return; |
1688 } | 1688 } |
1689 } | 1689 } |
1690 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 1690 ExceptionState exceptionState(ExceptionState::GetterContext, "cachedDirtyabl
eAttributeRaises", "TestObject" ,info.Holder(), info.GetIsolate()); |
1691 ScriptValue jsValue = imp->cachedDirtyableAttributeRaises(exceptionState); | 1691 ScriptValue jsValue = imp->cachedDirtyableAttributeRaises(exceptionState); |
1692 if (UNLIKELY(exceptionState.throwIfNeeded())) | 1692 if (UNLIKELY(exceptionState.throwIfNeeded())) |
1693 return; | 1693 return; |
1694 info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value()); | 1694 info.Holder()->SetHiddenValue(propertyName, jsValue.v8Value()); |
1695 v8SetReturnValue(info, jsValue.v8Value()); | 1695 v8SetReturnValue(info, jsValue.v8Value()); |
1696 } | 1696 } |
1697 | 1697 |
1698 static void cachedDirtyableAttributeRaisesAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1698 static void cachedDirtyableAttributeRaisesAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1699 { | 1699 { |
1700 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1700 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1887 static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1887 static void messagePortArrayAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1888 { | 1888 { |
1889 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1889 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1890 TestObjV8Internal::messagePortArrayAttributeSetter(jsValue, info); | 1890 TestObjV8Internal::messagePortArrayAttributeSetter(jsValue, info); |
1891 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1891 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
1892 } | 1892 } |
1893 | 1893 |
1894 static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Va
lue>& info) | 1894 static void contentDocumentAttributeGetter(const v8::PropertyCallbackInfo<v8::Va
lue>& info) |
1895 { | 1895 { |
1896 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1896 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1897 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 1897 ExceptionState exceptionState(ExceptionState::GetterContext, "contentDocumen
t", "TestObject" ,info.Holder(), info.GetIsolate()); |
1898 if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument(), except
ionState)) { | 1898 if (!BindingSecurity::shouldAllowAccessToNode(imp->contentDocument(), except
ionState)) { |
1899 v8SetReturnValueNull(info); | 1899 v8SetReturnValueNull(info); |
1900 exceptionState.throwIfNeeded(); | 1900 exceptionState.throwIfNeeded(); |
1901 return; | 1901 return; |
1902 } | 1902 } |
1903 v8SetReturnValueFast(info, imp->contentDocument(), imp); | 1903 v8SetReturnValueFast(info, imp->contentDocument(), imp); |
1904 } | 1904 } |
1905 | 1905 |
1906 static void contentDocumentAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) | 1906 static void contentDocumentAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
1907 { | 1907 { |
(...skipping 10 matching lines...) Expand all Loading... |
1918 | 1918 |
1919 static void mutablePointAttributeGetterCallback(v8::Local<v8::String>, const v8:
:PropertyCallbackInfo<v8::Value>& info) | 1919 static void mutablePointAttributeGetterCallback(v8::Local<v8::String>, const v8:
:PropertyCallbackInfo<v8::Value>& info) |
1920 { | 1920 { |
1921 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1921 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1922 TestObjV8Internal::mutablePointAttributeGetter(info); | 1922 TestObjV8Internal::mutablePointAttributeGetter(info); |
1923 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1923 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
1924 } | 1924 } |
1925 | 1925 |
1926 static void mutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8::
PropertyCallbackInfo<void>& info) | 1926 static void mutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8::
PropertyCallbackInfo<void>& info) |
1927 { | 1927 { |
| 1928 ExceptionState exceptionState(ExceptionState::SetterContext, "mutablePoint",
"TestObject", info.Holder(), info.GetIsolate()); |
1928 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1929 TestObj* imp = V8TestObject::toNative(info.Holder()); |
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); | 1930 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint:
:hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo
int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
1930 if (!WTF::getPtr(cppValue)) { | 1931 if (!WTF::getPtr(cppValue)) { |
1931 throwTypeError(ExceptionMessages::failedToSet("mutablePoint", "TestObjec
t", "The provided value is not of type 'SVGPoint'."), info.GetIsolate()); | 1932 exceptionState.throwTypeError("The provided value is not of type 'SVGPoi
nt'."); |
| 1933 exceptionState.throwIfNeeded(); |
1932 return; | 1934 return; |
1933 } | 1935 } |
1934 imp->setMutablePoint(WTF::getPtr(cppValue)->propertyReference()); | 1936 imp->setMutablePoint(WTF::getPtr(cppValue)->propertyReference()); |
1935 } | 1937 } |
1936 | 1938 |
1937 static void mutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Local
<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1939 static void mutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Local
<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1938 { | 1940 { |
1939 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1941 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1940 TestObjV8Internal::mutablePointAttributeSetter(jsValue, info); | 1942 TestObjV8Internal::mutablePointAttributeSetter(jsValue, info); |
1941 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1943 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
1942 } | 1944 } |
1943 | 1945 |
1944 static void immutablePointAttributeGetter(const v8::PropertyCallbackInfo<v8::Val
ue>& info) | 1946 static void immutablePointAttributeGetter(const v8::PropertyCallbackInfo<v8::Val
ue>& info) |
1945 { | 1947 { |
1946 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1948 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1947 v8SetReturnValueFast(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(
imp->immutablePoint())), imp); | 1949 v8SetReturnValueFast(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(
imp->immutablePoint())), imp); |
1948 } | 1950 } |
1949 | 1951 |
1950 static void immutablePointAttributeGetterCallback(v8::Local<v8::String>, const v
8::PropertyCallbackInfo<v8::Value>& info) | 1952 static void immutablePointAttributeGetterCallback(v8::Local<v8::String>, const v
8::PropertyCallbackInfo<v8::Value>& info) |
1951 { | 1953 { |
1952 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1954 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1953 TestObjV8Internal::immutablePointAttributeGetter(info); | 1955 TestObjV8Internal::immutablePointAttributeGetter(info); |
1954 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1956 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
1955 } | 1957 } |
1956 | 1958 |
1957 static void immutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8
::PropertyCallbackInfo<void>& info) | 1959 static void immutablePointAttributeSetter(v8::Local<v8::Value> jsValue, const v8
::PropertyCallbackInfo<void>& info) |
1958 { | 1960 { |
| 1961 ExceptionState exceptionState(ExceptionState::SetterContext, "immutablePoint
", "TestObject", info.Holder(), info.GetIsolate()); |
1959 TestObj* imp = V8TestObject::toNative(info.Holder()); | 1962 TestObj* imp = V8TestObject::toNative(info.Holder()); |
1960 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint:
:hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo
int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); | 1963 V8TRYCATCH_VOID(RefPtr<SVGPropertyTearOff<SVGPoint> >, cppValue, V8SVGPoint:
:hasInstance(jsValue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8SVGPo
int::toNative(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
1961 if (!WTF::getPtr(cppValue)) { | 1964 if (!WTF::getPtr(cppValue)) { |
1962 throwTypeError(ExceptionMessages::failedToSet("immutablePoint", "TestObj
ect", "The provided value is not of type 'SVGPoint'."), info.GetIsolate()); | 1965 exceptionState.throwTypeError("The provided value is not of type 'SVGPoi
nt'."); |
| 1966 exceptionState.throwIfNeeded(); |
1963 return; | 1967 return; |
1964 } | 1968 } |
1965 imp->setImmutablePoint(WTF::getPtr(cppValue)->propertyReference()); | 1969 imp->setImmutablePoint(WTF::getPtr(cppValue)->propertyReference()); |
1966 } | 1970 } |
1967 | 1971 |
1968 static void immutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Loc
al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 1972 static void immutablePointAttributeSetterCallback(v8::Local<v8::String>, v8::Loc
al<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
1969 { | 1973 { |
1970 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1974 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1971 TestObjV8Internal::immutablePointAttributeSetter(jsValue, info); | 1975 TestObjV8Internal::immutablePointAttributeSetter(jsValue, info); |
1972 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1976 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2007 | 2011 |
2008 static void strictFloatAttributeGetterCallback(v8::Local<v8::String>, const v8::
PropertyCallbackInfo<v8::Value>& info) | 2012 static void strictFloatAttributeGetterCallback(v8::Local<v8::String>, const v8::
PropertyCallbackInfo<v8::Value>& info) |
2009 { | 2013 { |
2010 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2014 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2011 TestObjV8Internal::strictFloatAttributeGetter(info); | 2015 TestObjV8Internal::strictFloatAttributeGetter(info); |
2012 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2016 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2013 } | 2017 } |
2014 | 2018 |
2015 static void strictFloatAttributeSetter(v8::Local<v8::Value> jsValue, const v8::P
ropertyCallbackInfo<void>& info) | 2019 static void strictFloatAttributeSetter(v8::Local<v8::Value> jsValue, const v8::P
ropertyCallbackInfo<void>& info) |
2016 { | 2020 { |
| 2021 ExceptionState exceptionState(ExceptionState::SetterContext, "strictFloat",
"TestObject", info.Holder(), info.GetIsolate()); |
2017 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2022 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2018 V8TRYCATCH_VOID(float, cppValue, static_cast<float>(jsValue->NumberValue()))
; | 2023 V8TRYCATCH_VOID(float, cppValue, static_cast<float>(jsValue->NumberValue()))
; |
2019 imp->setStrictFloat(cppValue); | 2024 imp->setStrictFloat(cppValue); |
2020 } | 2025 } |
2021 | 2026 |
2022 static void strictFloatAttributeSetterCallback(v8::Local<v8::String>, v8::Local<
v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2027 static void strictFloatAttributeSetterCallback(v8::Local<v8::String>, v8::Local<
v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2023 { | 2028 { |
2024 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2029 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2025 TestObjV8Internal::strictFloatAttributeSetter(jsValue, info); | 2030 TestObjV8Internal::strictFloatAttributeSetter(jsValue, info); |
2026 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2031 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2144 static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) | 2149 static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) |
2145 { | 2150 { |
2146 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2151 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2147 TestObjV8Internal::nullableLongSettableAttributeAttributeSetter(jsValue, inf
o); | 2152 TestObjV8Internal::nullableLongSettableAttributeAttributeSetter(jsValue, inf
o); |
2148 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2153 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2149 } | 2154 } |
2150 | 2155 |
2151 static void nullableStringValueAttributeGetter(const v8::PropertyCallbackInfo<v8
::Value>& info) | 2156 static void nullableStringValueAttributeGetter(const v8::PropertyCallbackInfo<v8
::Value>& info) |
2152 { | 2157 { |
2153 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2158 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2154 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 2159 ExceptionState exceptionState(ExceptionState::GetterContext, "nullableString
Value", "TestObject" ,info.Holder(), info.GetIsolate()); |
2155 bool isNull = false; | 2160 bool isNull = false; |
2156 int jsValue = imp->nullableStringValue(isNull, exceptionState); | 2161 int jsValue = imp->nullableStringValue(isNull, exceptionState); |
2157 if (isNull) { | 2162 if (isNull) { |
2158 v8SetReturnValueNull(info); | 2163 v8SetReturnValueNull(info); |
2159 return; | 2164 return; |
2160 } | 2165 } |
2161 if (UNLIKELY(exceptionState.throwIfNeeded())) | 2166 if (UNLIKELY(exceptionState.throwIfNeeded())) |
2162 return; | 2167 return; |
2163 v8SetReturnValueInt(info, jsValue); | 2168 v8SetReturnValueInt(info, jsValue); |
2164 } | 2169 } |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2873 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2878 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2874 } | 2879 } |
2875 | 2880 |
2876 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) | 2881 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) |
2877 { | 2882 { |
2878 TestObj* proxyImp = V8TestObject::toNative(info.Holder()); | 2883 TestObj* proxyImp = V8TestObject::toNative(info.Holder()); |
2879 TestNode* imp = proxyImp->locationWithException(); | 2884 TestNode* imp = proxyImp->locationWithException(); |
2880 if (!imp) | 2885 if (!imp) |
2881 return; | 2886 return; |
2882 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 2887 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
2883 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 2888 imp->setHrefThrows(cppValue); |
2884 imp->setHrefThrows(cppValue, exceptionState); | |
2885 exceptionState.throwIfNeeded(); | |
2886 } | 2889 } |
2887 | 2890 |
2888 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2891 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2889 { | 2892 { |
2890 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2893 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2891 TestObjV8Internal::locationWithExceptionAttributeSetter(jsValue, info); | 2894 TestObjV8Internal::locationWithExceptionAttributeSetter(jsValue, info); |
2892 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2895 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2893 } | 2896 } |
2894 | 2897 |
2895 static void TestObjConstructorGetter(v8::Local<v8::String>, const v8::PropertyCa
llbackInfo<v8::Value>& info) | 2898 static void TestObjConstructorGetter(v8::Local<v8::String>, const v8::PropertyCa
llbackInfo<v8::Value>& info) |
(...skipping 11 matching lines...) Expand all Loading... |
2907 info.This()->ForceSet(name, jsValue); | 2910 info.This()->ForceSet(name, jsValue); |
2908 } | 2911 } |
2909 | 2912 |
2910 static void TestObjReplaceableAttributeSetterCallback(v8::Local<v8::String> name
, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2913 static void TestObjReplaceableAttributeSetterCallback(v8::Local<v8::String> name
, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2911 { | 2914 { |
2912 TestObjV8Internal::TestObjReplaceableAttributeSetter(name, jsValue, info); | 2915 TestObjV8Internal::TestObjReplaceableAttributeSetter(name, jsValue, info); |
2913 } | 2916 } |
2914 | 2917 |
2915 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 2918 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
2916 { | 2919 { |
| 2920 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethod"
, "TestObject", info.Holder(), info.GetIsolate()); |
2917 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2921 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2918 imp->voidMethod(); | 2922 imp->voidMethod(); |
2919 } | 2923 } |
2920 | 2924 |
2921 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 2925 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
2922 { | 2926 { |
2923 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2927 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
2924 TestObjV8Internal::voidMethodMethod(info); | 2928 TestObjV8Internal::voidMethodMethod(info); |
2925 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2929 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2926 } | 2930 } |
2927 | 2931 |
2928 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 2932 static void voidMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
2929 { | 2933 { |
| 2934 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodW
ithArgs", "TestObject", info.Holder(), info.GetIsolate()); |
2930 if (UNLIKELY(info.Length() < 3)) { | 2935 if (UNLIKELY(info.Length() < 3)) { |
2931 throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs",
"TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.Get
Isolate()); | 2936 throwTypeError(ExceptionMessages::failedToExecute("voidMethodWithArgs",
"TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.Get
Isolate()); |
2932 return; | 2937 return; |
2933 } | 2938 } |
2934 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2939 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2935 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 2940 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
2936 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 2941 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
2937 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[2])) : 0); | 2942 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[2])) : 0); |
2938 imp->voidMethodWithArgs(longArg, strArg, objArg); | 2943 imp->voidMethodWithArgs(longArg, strArg, objArg); |
2939 } | 2944 } |
2940 | 2945 |
2941 static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 2946 static void voidMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
2942 { | 2947 { |
2943 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2948 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
2944 TestObjV8Internal::voidMethodWithArgsMethod(info); | 2949 TestObjV8Internal::voidMethodWithArgsMethod(info); |
2945 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2950 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2946 } | 2951 } |
2947 | 2952 |
2948 static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 2953 static void longMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
2949 { | 2954 { |
| 2955 ExceptionState exceptionState(ExceptionState::ExecutionContext, "longMethod"
, "TestObject", info.Holder(), info.GetIsolate()); |
2950 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2956 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2951 v8SetReturnValueInt(info, imp->longMethod()); | 2957 v8SetReturnValueInt(info, imp->longMethod()); |
2952 } | 2958 } |
2953 | 2959 |
2954 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 2960 static void longMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
2955 { | 2961 { |
2956 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2962 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
2957 TestObjV8Internal::longMethodMethod(info); | 2963 TestObjV8Internal::longMethodMethod(info); |
2958 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2964 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2959 } | 2965 } |
2960 | 2966 |
2961 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 2967 static void longMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
2962 { | 2968 { |
| 2969 ExceptionState exceptionState(ExceptionState::ExecutionContext, "longMethodW
ithArgs", "TestObject", info.Holder(), info.GetIsolate()); |
2963 if (UNLIKELY(info.Length() < 3)) { | 2970 if (UNLIKELY(info.Length() < 3)) { |
2964 throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs",
"TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.Get
Isolate()); | 2971 throwTypeError(ExceptionMessages::failedToExecute("longMethodWithArgs",
"TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.Get
Isolate()); |
2965 return; | 2972 return; |
2966 } | 2973 } |
2967 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2974 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2968 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 2975 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
2969 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 2976 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
2970 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[2])) : 0); | 2977 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[2])) : 0); |
2971 v8SetReturnValueInt(info, imp->longMethodWithArgs(longArg, strArg, objArg)); | 2978 v8SetReturnValueInt(info, imp->longMethodWithArgs(longArg, strArg, objArg)); |
2972 } | 2979 } |
2973 | 2980 |
2974 static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 2981 static void longMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
2975 { | 2982 { |
2976 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2983 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
2977 TestObjV8Internal::longMethodWithArgsMethod(info); | 2984 TestObjV8Internal::longMethodWithArgsMethod(info); |
2978 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2985 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2979 } | 2986 } |
2980 | 2987 |
2981 static void objMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 2988 static void objMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
2982 { | 2989 { |
| 2990 ExceptionState exceptionState(ExceptionState::ExecutionContext, "objMethod",
"TestObject", info.Holder(), info.GetIsolate()); |
2983 TestObj* imp = V8TestObject::toNative(info.Holder()); | 2991 TestObj* imp = V8TestObject::toNative(info.Holder()); |
2984 v8SetReturnValue(info, imp->objMethod()); | 2992 v8SetReturnValue(info, imp->objMethod()); |
2985 } | 2993 } |
2986 | 2994 |
2987 static void objMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 2995 static void objMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
2988 { | 2996 { |
2989 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 2997 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
2990 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); | 2998 UseCounter::count(activeDOMWindow(), UseCounter::TestFeature); |
2991 TestObjV8Internal::objMethodMethod(info); | 2999 TestObjV8Internal::objMethodMethod(info); |
2992 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3000 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2993 } | 3001 } |
2994 | 3002 |
2995 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 3003 static void objMethodWithArgsMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
2996 { | 3004 { |
| 3005 ExceptionState exceptionState(ExceptionState::ExecutionContext, "objMethodWi
thArgs", "TestObject", info.Holder(), info.GetIsolate()); |
2997 if (UNLIKELY(info.Length() < 3)) { | 3006 if (UNLIKELY(info.Length() < 3)) { |
2998 throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", "
TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetI
solate()); | 3007 throwTypeError(ExceptionMessages::failedToExecute("objMethodWithArgs", "
TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetI
solate()); |
2999 return; | 3008 return; |
3000 } | 3009 } |
3001 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3010 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3002 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 3011 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
3003 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 3012 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
3004 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[2])) : 0); | 3013 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[2], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[2])) : 0); |
3005 v8SetReturnValue(info, imp->objMethodWithArgs(longArg, strArg, objArg)); | 3014 v8SetReturnValue(info, imp->objMethodWithArgs(longArg, strArg, objArg)); |
3006 } | 3015 } |
3007 | 3016 |
3008 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 3017 static void objMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
3009 { | 3018 { |
3010 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3019 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3011 TestObjV8Internal::objMethodWithArgsMethod(info); | 3020 TestObjV8Internal::objMethodWithArgsMethod(info); |
3012 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3021 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3013 } | 3022 } |
3014 | 3023 |
3015 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 3024 static void methodWithSequenceArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
3016 { | 3025 { |
| 3026 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithS
equenceArg", "TestObject", info.Holder(), info.GetIsolate()); |
3017 if (UNLIKELY(info.Length() < 1)) { | 3027 if (UNLIKELY(info.Length() < 1)) { |
3018 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); | 3028 throwTypeError(ExceptionMessages::failedToExecute("methodWithSequenceArg
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
3019 return; | 3029 return; |
3020 } | 3030 } |
3021 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3031 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3022 V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNative
Array<TestInterface, V8TestInterface>(info[0], 1, info.GetIsolate()))); | 3032 V8TRYCATCH_VOID(Vector<RefPtr<TestInterface> >, sequenceArg, (toRefPtrNative
Array<TestInterface, V8TestInterface>(info[0], 1, info.GetIsolate()))); |
3023 imp->methodWithSequenceArg(sequenceArg); | 3033 imp->methodWithSequenceArg(sequenceArg); |
3024 } | 3034 } |
3025 | 3035 |
3026 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 3036 static void methodWithSequenceArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
3027 { | 3037 { |
3028 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3038 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3029 TestObjV8Internal::methodWithSequenceArgMethod(info); | 3039 TestObjV8Internal::methodWithSequenceArgMethod(info); |
3030 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3040 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3031 } | 3041 } |
3032 | 3042 |
3033 static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 3043 static void methodReturningSequenceMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
3034 { | 3044 { |
| 3045 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodRetur
ningSequence", "TestObject", info.Holder(), info.GetIsolate()); |
3035 if (UNLIKELY(info.Length() < 1)) { | 3046 if (UNLIKELY(info.Length() < 1)) { |
3036 throwTypeError(ExceptionMessages::failedToExecute("methodReturningSequen
ce", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); | 3047 throwTypeError(ExceptionMessages::failedToExecute("methodReturningSequen
ce", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); |
3037 return; | 3048 return; |
3038 } | 3049 } |
3039 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3050 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3040 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 3051 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
3041 v8SetReturnValue(info, v8Array(imp->methodReturningSequence(longArg), info.G
etIsolate())); | 3052 v8SetReturnValue(info, v8Array(imp->methodReturningSequence(longArg), info.G
etIsolate())); |
3042 } | 3053 } |
3043 | 3054 |
3044 static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 3055 static void methodReturningSequenceMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
3045 { | 3056 { |
3046 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3057 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3047 TestObjV8Internal::methodReturningSequenceMethod(info); | 3058 TestObjV8Internal::methodReturningSequenceMethod(info); |
3048 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3059 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3049 } | 3060 } |
3050 | 3061 |
3051 static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 3062 static void methodWithEnumArgMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3052 { | 3063 { |
| 3064 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
numArg", "TestObject", info.Holder(), info.GetIsolate()); |
3053 if (UNLIKELY(info.Length() < 1)) { | 3065 if (UNLIKELY(info.Length() < 1)) { |
3054 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); | 3066 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
3055 return; | 3067 return; |
3056 } | 3068 } |
3057 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3069 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3058 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, enumArg, info[0]); | 3070 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, enumArg, info[0]); |
3059 String string = enumArg; | 3071 String string = enumArg; |
3060 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) { | 3072 if (!(string == "" || string == "EnumValue1" || string == "EnumValue2" || st
ring == "EnumValue3")) { |
3061 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", "parameter 1 ('" + string + "') is not a valid enum value."), info.
GetIsolate()); | 3073 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnumArg", "
TestObject", "parameter 1 ('" + string + "') is not a valid enum value."), info.
GetIsolate()); |
3062 return; | 3074 return; |
3063 } | 3075 } |
3064 imp->methodWithEnumArg(enumArg); | 3076 imp->methodWithEnumArg(enumArg); |
3065 } | 3077 } |
3066 | 3078 |
3067 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 3079 static void methodWithEnumArgMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
3068 { | 3080 { |
3069 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3081 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3070 TestObjV8Internal::methodWithEnumArgMethod(info); | 3082 TestObjV8Internal::methodWithEnumArgMethod(info); |
3071 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3083 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3072 } | 3084 } |
3073 | 3085 |
3074 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 3086 static void methodThatRequiresAllArgsAndThrowsMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
3075 { | 3087 { |
| 3088 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodThatR
equiresAllArgsAndThrows", "TestObject", info.Holder(), info.GetIsolate()); |
3076 if (UNLIKELY(info.Length() < 2)) { | 3089 if (UNLIKELY(info.Length() < 2)) { |
3077 throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAll
ArgsAndThrows", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Leng
th())), info.GetIsolate()); | 3090 throwTypeError(ExceptionMessages::failedToExecute("methodThatRequiresAll
ArgsAndThrows", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Leng
th())), info.GetIsolate()); |
3078 return; | 3091 return; |
3079 } | 3092 } |
3080 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3093 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3081 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
3082 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 3094 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
3083 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[1])) : 0); | 3095 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[1], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[1])) : 0); |
3084 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj
Arg, exceptionState); | 3096 RefPtr<TestObj> result = imp->methodThatRequiresAllArgsAndThrows(strArg, obj
Arg, exceptionState); |
3085 if (exceptionState.throwIfNeeded()) | 3097 if (exceptionState.throwIfNeeded()) |
3086 return; | 3098 return; |
3087 v8SetReturnValue(info, result.release()); | 3099 v8SetReturnValue(info, result.release()); |
3088 } | 3100 } |
3089 | 3101 |
3090 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) | 3102 static void methodThatRequiresAllArgsAndThrowsMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
3091 { | 3103 { |
3092 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3104 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3093 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info); | 3105 TestObjV8Internal::methodThatRequiresAllArgsAndThrowsMethod(info); |
3094 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3106 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3095 } | 3107 } |
3096 | 3108 |
3097 static void methodQueryListListenerMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 3109 static void methodQueryListListenerMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
3098 { | 3110 { |
| 3111 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodQuery
ListListener", "TestObject", info.Holder(), info.GetIsolate()); |
3099 if (UNLIKELY(info.Length() < 1)) { | 3112 if (UNLIKELY(info.Length() < 1)) { |
3100 throwTypeError(ExceptionMessages::failedToExecute("methodQueryListListen
er", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); | 3113 throwTypeError(ExceptionMessages::failedToExecute("methodQueryListListen
er", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); |
3101 return; | 3114 return; |
3102 } | 3115 } |
3103 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3116 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3104 V8TRYCATCH_VOID(RefPtr<MediaQueryListListener>, listener, MediaQueryListList
ener::create(ScriptValue(info[0], info.GetIsolate()))); | 3117 V8TRYCATCH_VOID(RefPtr<MediaQueryListListener>, listener, MediaQueryListList
ener::create(ScriptValue(info[0], info.GetIsolate()))); |
3105 imp->methodQueryListListener(listener); | 3118 imp->methodQueryListListener(listener); |
3106 } | 3119 } |
3107 | 3120 |
3108 static void methodQueryListListenerMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 3121 static void methodQueryListListenerMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
3109 { | 3122 { |
3110 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3123 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3111 TestObjV8Internal::methodQueryListListenerMethod(info); | 3124 TestObjV8Internal::methodQueryListListenerMethod(info); |
3112 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3125 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3113 } | 3126 } |
3114 | 3127 |
3115 static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 3128 static void serializedValueMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
3116 { | 3129 { |
| 3130 ExceptionState exceptionState(ExceptionState::ExecutionContext, "serializedV
alue", "TestObject", info.Holder(), info.GetIsolate()); |
3117 if (UNLIKELY(info.Length() < 1)) { | 3131 if (UNLIKELY(info.Length() < 1)) { |
3118 throwTypeError(ExceptionMessages::failedToExecute("serializedValue", "Te
stObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIso
late()); | 3132 throwTypeError(ExceptionMessages::failedToExecute("serializedValue", "Te
stObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIso
late()); |
3119 return; | 3133 return; |
3120 } | 3134 } |
3121 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3135 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3122 bool serializedArgDidThrow = false; | 3136 bool serializedArgDidThrow = false; |
3123 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(
info[0], 0, 0, serializedArgDidThrow, info.GetIsolate()); | 3137 RefPtr<SerializedScriptValue> serializedArg = SerializedScriptValue::create(
info[0], 0, 0, serializedArgDidThrow, info.GetIsolate()); |
3124 if (serializedArgDidThrow) | 3138 if (serializedArgDidThrow) |
3125 return; | 3139 return; |
3126 imp->serializedValue(serializedArg); | 3140 imp->serializedValue(serializedArg); |
3127 } | 3141 } |
3128 | 3142 |
3129 static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 3143 static void serializedValueMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
3130 { | 3144 { |
3131 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3132 TestObjV8Internal::serializedValueMethod(info); | 3146 TestObjV8Internal::serializedValueMethod(info); |
3133 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3134 } | 3148 } |
3135 | 3149 |
3136 static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 3150 static void optionsObjectMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
3137 { | 3151 { |
| 3152 ExceptionState exceptionState(ExceptionState::ExecutionContext, "optionsObje
ct", "TestObject", info.Holder(), info.GetIsolate()); |
3138 if (UNLIKELY(info.Length() < 1)) { | 3153 if (UNLIKELY(info.Length() < 1)) { |
3139 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsola
te()); | 3154 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsola
te()); |
3140 return; | 3155 return; |
3141 } | 3156 } |
3142 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3157 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3143 V8TRYCATCH_VOID(Dictionary, oo, Dictionary(info[0], info.GetIsolate())); | 3158 V8TRYCATCH_VOID(Dictionary, oo, Dictionary(info[0], info.GetIsolate())); |
3144 if (!oo.isUndefinedOrNull() && !oo.isObject()) { | 3159 if (!oo.isUndefinedOrNull() && !oo.isObject()) { |
3145 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 1 ('oo') is not an object."), info.GetIsolate()); | 3160 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 1 ('oo') is not an object."), info.GetIsolate()); |
3146 return; | 3161 return; |
3147 } | 3162 } |
3148 V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(info[1], info.GetIsolate())); | 3163 V8TRYCATCH_VOID(Dictionary, ooo, Dictionary(info[1], info.GetIsolate())); |
3149 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) { | 3164 if (!ooo.isUndefinedOrNull() && !ooo.isObject()) { |
3150 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 2 ('ooo') is not an object."), info.GetIsolate()); | 3165 throwTypeError(ExceptionMessages::failedToExecute("optionsObject", "Test
Object", "parameter 2 ('ooo') is not an object."), info.GetIsolate()); |
3151 return; | 3166 return; |
3152 } | 3167 } |
3153 imp->optionsObject(oo, ooo); | 3168 imp->optionsObject(oo, ooo); |
3154 } | 3169 } |
3155 | 3170 |
3156 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value
>& info) | 3171 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value
>& info) |
3157 { | 3172 { |
3158 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3173 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3159 TestObjV8Internal::optionsObjectMethod(info); | 3174 TestObjV8Internal::optionsObjectMethod(info); |
3160 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3175 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3161 } | 3176 } |
3162 | 3177 |
3163 static void optionsObjectListMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 3178 static void optionsObjectListMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3164 { | 3179 { |
| 3180 ExceptionState exceptionState(ExceptionState::ExecutionContext, "optionsObje
ctList", "TestObject", info.Holder(), info.GetIsolate()); |
3165 if (UNLIKELY(info.Length() < 1)) { | 3181 if (UNLIKELY(info.Length() < 1)) { |
3166 throwTypeError(ExceptionMessages::failedToExecute("optionsObjectList", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); | 3182 throwTypeError(ExceptionMessages::failedToExecute("optionsObjectList", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
3167 return; | 3183 return; |
3168 } | 3184 } |
3169 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3185 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3170 V8TRYCATCH_VOID(Vector<Dictionary>, list, toNativeArray<Dictionary>(info[0],
1, info.GetIsolate())); | 3186 V8TRYCATCH_VOID(Vector<Dictionary>, list, toNativeArray<Dictionary>(info[0],
1, info.GetIsolate())); |
3171 imp->optionsObjectList(list); | 3187 imp->optionsObjectList(list); |
3172 } | 3188 } |
3173 | 3189 |
3174 static void optionsObjectListMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 3190 static void optionsObjectListMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
3175 { | 3191 { |
3176 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3192 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3177 TestObjV8Internal::optionsObjectListMethod(info); | 3193 TestObjV8Internal::optionsObjectListMethod(info); |
3178 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3194 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3179 } | 3195 } |
3180 | 3196 |
3181 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3197 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3182 { | 3198 { |
| 3199 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
xception", "TestObject", info.Holder(), info.GetIsolate()); |
3183 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3200 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3184 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
3185 imp->methodWithException(exceptionState); | 3201 imp->methodWithException(exceptionState); |
3186 if (exceptionState.throwIfNeeded()) | 3202 if (exceptionState.throwIfNeeded()) |
3187 return; | 3203 return; |
3188 } | 3204 } |
3189 | 3205 |
3190 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3206 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3191 { | 3207 { |
3192 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3208 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3193 TestObjV8Internal::methodWithExceptionMethod(info); | 3209 TestObjV8Internal::methodWithExceptionMethod(info); |
3194 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3210 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3195 } | 3211 } |
3196 | 3212 |
3197 static void customMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) | 3213 static void customMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) |
3198 { | 3214 { |
3199 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3215 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3200 UseCounter::count(activeDOMWindow(), UseCounter::CustomTestFeature); | 3216 UseCounter::count(activeDOMWindow(), UseCounter::CustomTestFeature); |
3201 V8TestObject::customMethodMethodCustom(info); | 3217 V8TestObject::customMethodMethodCustom(info); |
3202 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3218 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3203 } | 3219 } |
3204 | 3220 |
3205 static void customMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 3221 static void customMethodWithArgsMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
3206 { | 3222 { |
3207 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3223 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3208 V8TestObject::customMethodWithArgsMethodCustom(info); | 3224 V8TestObject::customMethodWithArgsMethodCustom(info); |
3209 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3225 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3210 } | 3226 } |
3211 | 3227 |
3212 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 3228 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
3213 { | 3229 { |
| 3230 ExceptionState exceptionState(ExceptionState::ExecutionContext, "addEventLis
tener", "TestObject", info.Holder(), info.GetIsolate()); |
3214 EventTarget* impl = V8TestObject::toNative(info.Holder()); | 3231 EventTarget* impl = V8TestObject::toNative(info.Holder()); |
3215 if (DOMWindow* window = impl->toDOMWindow()) { | 3232 if (DOMWindow* window = impl->toDOMWindow()) { |
3216 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
3217 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio
nState)) { | 3233 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio
nState)) { |
3218 exceptionState.throwIfNeeded(); | 3234 exceptionState.throwIfNeeded(); |
3219 return; | 3235 return; |
3220 } | 3236 } |
3221 if (!window->document()) | 3237 if (!window->document()) |
3222 return; | 3238 return; |
3223 } | 3239 } |
3224 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[
1], false, ListenerFindOrCreate); | 3240 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[
1], false, ListenerFindOrCreate); |
3225 if (listener) { | 3241 if (listener) { |
3226 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev
entName, info[0]); | 3242 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev
entName, info[0]); |
3227 impl->addEventListener(eventName, listener, info[2]->BooleanValue()); | 3243 impl->addEventListener(eventName, listener, info[2]->BooleanValue()); |
3228 if (!impl->toNode()) | 3244 if (!impl->toNode()) |
3229 createHiddenDependency(info.Holder(), info[1], V8TestObject::eventLi
stenerCacheIndex, info.GetIsolate()); | 3245 createHiddenDependency(info.Holder(), info[1], V8TestObject::eventLi
stenerCacheIndex, info.GetIsolate()); |
3230 } | 3246 } |
3231 } | 3247 } |
3232 | 3248 |
3233 static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 3249 static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
3234 { | 3250 { |
3235 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3251 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3236 TestObjV8Internal::addEventListenerMethod(info); | 3252 TestObjV8Internal::addEventListenerMethod(info); |
3237 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3253 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3238 } | 3254 } |
3239 | 3255 |
3240 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3256 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3241 { | 3257 { |
| 3258 ExceptionState exceptionState(ExceptionState::ExecutionContext, "removeEvent
Listener", "TestObject", info.Holder(), info.GetIsolate()); |
3242 EventTarget* impl = V8TestObject::toNative(info.Holder()); | 3259 EventTarget* impl = V8TestObject::toNative(info.Holder()); |
3243 if (DOMWindow* window = impl->toDOMWindow()) { | 3260 if (DOMWindow* window = impl->toDOMWindow()) { |
3244 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
3245 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio
nState)) { | 3261 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio
nState)) { |
3246 exceptionState.throwIfNeeded(); | 3262 exceptionState.throwIfNeeded(); |
3247 return; | 3263 return; |
3248 } | 3264 } |
3249 if (!window->document()) | 3265 if (!window->document()) |
3250 return; | 3266 return; |
3251 } | 3267 } |
3252 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[
1], false, ListenerFindOnly); | 3268 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[
1], false, ListenerFindOnly); |
3253 if (listener) { | 3269 if (listener) { |
3254 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev
entName, info[0]); | 3270 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev
entName, info[0]); |
3255 impl->removeEventListener(eventName, listener.get(), info[2]->BooleanVal
ue()); | 3271 impl->removeEventListener(eventName, listener.get(), info[2]->BooleanVal
ue()); |
3256 if (!impl->toNode()) | 3272 if (!impl->toNode()) |
3257 removeHiddenDependency(info.Holder(), info[1], V8TestObject::eventLi
stenerCacheIndex, info.GetIsolate()); | 3273 removeHiddenDependency(info.Holder(), info[1], V8TestObject::eventLi
stenerCacheIndex, info.GetIsolate()); |
3258 } | 3274 } |
3259 } | 3275 } |
3260 | 3276 |
3261 static void removeEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3277 static void removeEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3262 { | 3278 { |
3263 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3279 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3264 TestObjV8Internal::removeEventListenerMethod(info); | 3280 TestObjV8Internal::removeEventListenerMethod(info); |
3265 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3281 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3266 } | 3282 } |
3267 | 3283 |
3268 static void withScriptStateVoidMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3284 static void withScriptStateVoidMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3269 { | 3285 { |
| 3286 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptS
tateVoid", "TestObject", info.Holder(), info.GetIsolate()); |
3270 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3287 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3271 ScriptState* currentState = ScriptState::current(); | 3288 ScriptState* currentState = ScriptState::current(); |
3272 if (!currentState) | 3289 if (!currentState) |
3273 return; | 3290 return; |
3274 ScriptState& state = *currentState; | 3291 ScriptState& state = *currentState; |
3275 imp->withScriptStateVoid(&state); | 3292 imp->withScriptStateVoid(&state); |
3276 if (state.hadException()) { | 3293 if (state.hadException()) { |
3277 v8::Local<v8::Value> exception = state.exception(); | 3294 v8::Local<v8::Value> exception = state.exception(); |
3278 state.clearException(); | 3295 state.clearException(); |
3279 throwError(exception, info.GetIsolate()); | 3296 throwError(exception, info.GetIsolate()); |
3280 return; | 3297 return; |
3281 } | 3298 } |
3282 } | 3299 } |
3283 | 3300 |
3284 static void withScriptStateVoidMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3301 static void withScriptStateVoidMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3285 { | 3302 { |
3286 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3303 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3287 TestObjV8Internal::withScriptStateVoidMethod(info); | 3304 TestObjV8Internal::withScriptStateVoidMethod(info); |
3288 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3305 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3289 } | 3306 } |
3290 | 3307 |
3291 static void withScriptStateObjMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3308 static void withScriptStateObjMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3292 { | 3309 { |
| 3310 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptS
tateObj", "TestObject", info.Holder(), info.GetIsolate()); |
3293 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3311 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3294 ScriptState* currentState = ScriptState::current(); | 3312 ScriptState* currentState = ScriptState::current(); |
3295 if (!currentState) | 3313 if (!currentState) |
3296 return; | 3314 return; |
3297 ScriptState& state = *currentState; | 3315 ScriptState& state = *currentState; |
3298 RefPtr<TestObj> result = imp->withScriptStateObj(&state); | 3316 RefPtr<TestObj> result = imp->withScriptStateObj(&state); |
3299 if (state.hadException()) { | 3317 if (state.hadException()) { |
3300 v8::Local<v8::Value> exception = state.exception(); | 3318 v8::Local<v8::Value> exception = state.exception(); |
3301 state.clearException(); | 3319 state.clearException(); |
3302 throwError(exception, info.GetIsolate()); | 3320 throwError(exception, info.GetIsolate()); |
3303 return; | 3321 return; |
3304 } | 3322 } |
3305 v8SetReturnValue(info, result.release()); | 3323 v8SetReturnValue(info, result.release()); |
3306 } | 3324 } |
3307 | 3325 |
3308 static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 3326 static void withScriptStateObjMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
3309 { | 3327 { |
3310 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3328 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3311 TestObjV8Internal::withScriptStateObjMethod(info); | 3329 TestObjV8Internal::withScriptStateObjMethod(info); |
3312 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3330 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3313 } | 3331 } |
3314 | 3332 |
3315 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8
::Value>& info) | 3333 static void withScriptStateVoidExceptionMethod(const v8::FunctionCallbackInfo<v8
::Value>& info) |
3316 { | 3334 { |
| 3335 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptS
tateVoidException", "TestObject", info.Holder(), info.GetIsolate()); |
3317 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3336 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3318 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
3319 ScriptState* currentState = ScriptState::current(); | 3337 ScriptState* currentState = ScriptState::current(); |
3320 if (!currentState) | 3338 if (!currentState) |
3321 return; | 3339 return; |
3322 ScriptState& state = *currentState; | 3340 ScriptState& state = *currentState; |
3323 imp->withScriptStateVoidException(&state, exceptionState); | 3341 imp->withScriptStateVoidException(&state, exceptionState); |
3324 if (exceptionState.throwIfNeeded()) | 3342 if (exceptionState.throwIfNeeded()) |
3325 return; | 3343 return; |
3326 if (state.hadException()) { | 3344 if (state.hadException()) { |
3327 v8::Local<v8::Value> exception = state.exception(); | 3345 v8::Local<v8::Value> exception = state.exception(); |
3328 state.clearException(); | 3346 state.clearException(); |
3329 throwError(exception, info.GetIsolate()); | 3347 throwError(exception, info.GetIsolate()); |
3330 return; | 3348 return; |
3331 } | 3349 } |
3332 } | 3350 } |
3333 | 3351 |
3334 static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 3352 static void withScriptStateVoidExceptionMethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
3335 { | 3353 { |
3336 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3354 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3337 TestObjV8Internal::withScriptStateVoidExceptionMethod(info); | 3355 TestObjV8Internal::withScriptStateVoidExceptionMethod(info); |
3338 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3356 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3339 } | 3357 } |
3340 | 3358 |
3341 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3359 static void withScriptStateObjExceptionMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3342 { | 3360 { |
| 3361 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withScriptS
tateObjException", "TestObject", info.Holder(), info.GetIsolate()); |
3343 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3362 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3344 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
3345 ScriptState* currentState = ScriptState::current(); | 3363 ScriptState* currentState = ScriptState::current(); |
3346 if (!currentState) | 3364 if (!currentState) |
3347 return; | 3365 return; |
3348 ScriptState& state = *currentState; | 3366 ScriptState& state = *currentState; |
3349 RefPtr<TestObj> result = imp->withScriptStateObjException(&state, exceptionS
tate); | 3367 RefPtr<TestObj> result = imp->withScriptStateObjException(&state, exceptionS
tate); |
3350 if (exceptionState.throwIfNeeded()) | 3368 if (exceptionState.throwIfNeeded()) |
3351 return; | 3369 return; |
3352 if (state.hadException()) { | 3370 if (state.hadException()) { |
3353 v8::Local<v8::Value> exception = state.exception(); | 3371 v8::Local<v8::Value> exception = state.exception(); |
3354 state.clearException(); | 3372 state.clearException(); |
3355 throwError(exception, info.GetIsolate()); | 3373 throwError(exception, info.GetIsolate()); |
3356 return; | 3374 return; |
3357 } | 3375 } |
3358 v8SetReturnValue(info, result.release()); | 3376 v8SetReturnValue(info, result.release()); |
3359 } | 3377 } |
3360 | 3378 |
3361 static void withScriptStateObjExceptionMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 3379 static void withScriptStateObjExceptionMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
3362 { | 3380 { |
3363 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3381 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3364 TestObjV8Internal::withScriptStateObjExceptionMethod(info); | 3382 TestObjV8Internal::withScriptStateObjExceptionMethod(info); |
3365 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3383 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3366 } | 3384 } |
3367 | 3385 |
3368 static void withExecutionContextMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 3386 static void withExecutionContextMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
3369 { | 3387 { |
| 3388 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withExecuti
onContext", "TestObject", info.Holder(), info.GetIsolate()); |
3370 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3389 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3371 ExecutionContext* scriptContext = getExecutionContext(); | 3390 ExecutionContext* scriptContext = getExecutionContext(); |
3372 imp->withExecutionContext(scriptContext); | 3391 imp->withExecutionContext(scriptContext); |
3373 } | 3392 } |
3374 | 3393 |
3375 static void withExecutionContextMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 3394 static void withExecutionContextMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
3376 { | 3395 { |
3377 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3396 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3378 TestObjV8Internal::withExecutionContextMethod(info); | 3397 TestObjV8Internal::withExecutionContextMethod(info); |
3379 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3398 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3380 } | 3399 } |
3381 | 3400 |
3382 static void withExecutionContextAndScriptStateMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 3401 static void withExecutionContextAndScriptStateMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
3383 { | 3402 { |
| 3403 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withExecuti
onContextAndScriptState", "TestObject", info.Holder(), info.GetIsolate()); |
3384 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3404 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3385 ScriptState* currentState = ScriptState::current(); | 3405 ScriptState* currentState = ScriptState::current(); |
3386 if (!currentState) | 3406 if (!currentState) |
3387 return; | 3407 return; |
3388 ScriptState& state = *currentState; | 3408 ScriptState& state = *currentState; |
3389 ExecutionContext* scriptContext = getExecutionContext(); | 3409 ExecutionContext* scriptContext = getExecutionContext(); |
3390 imp->withExecutionContextAndScriptState(&state, scriptContext); | 3410 imp->withExecutionContextAndScriptState(&state, scriptContext); |
3391 if (state.hadException()) { | 3411 if (state.hadException()) { |
3392 v8::Local<v8::Value> exception = state.exception(); | 3412 v8::Local<v8::Value> exception = state.exception(); |
3393 state.clearException(); | 3413 state.clearException(); |
3394 throwError(exception, info.GetIsolate()); | 3414 throwError(exception, info.GetIsolate()); |
3395 return; | 3415 return; |
3396 } | 3416 } |
3397 } | 3417 } |
3398 | 3418 |
3399 static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) | 3419 static void withExecutionContextAndScriptStateMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
3400 { | 3420 { |
3401 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3421 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3402 TestObjV8Internal::withExecutionContextAndScriptStateMethod(info); | 3422 TestObjV8Internal::withExecutionContextAndScriptStateMethod(info); |
3403 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3423 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3404 } | 3424 } |
3405 | 3425 |
3406 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 3426 static void withExecutionContextAndScriptStateObjExceptionMethod(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
3407 { | 3427 { |
| 3428 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withExecuti
onContextAndScriptStateObjException", "TestObject", info.Holder(), info.GetIsola
te()); |
3408 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3429 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3409 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
3410 ScriptState* currentState = ScriptState::current(); | 3430 ScriptState* currentState = ScriptState::current(); |
3411 if (!currentState) | 3431 if (!currentState) |
3412 return; | 3432 return; |
3413 ScriptState& state = *currentState; | 3433 ScriptState& state = *currentState; |
3414 ExecutionContext* scriptContext = getExecutionContext(); | 3434 ExecutionContext* scriptContext = getExecutionContext(); |
3415 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateObjException
(&state, scriptContext, exceptionState); | 3435 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateObjException
(&state, scriptContext, exceptionState); |
3416 if (exceptionState.throwIfNeeded()) | 3436 if (exceptionState.throwIfNeeded()) |
3417 return; | 3437 return; |
3418 if (state.hadException()) { | 3438 if (state.hadException()) { |
3419 v8::Local<v8::Value> exception = state.exception(); | 3439 v8::Local<v8::Value> exception = state.exception(); |
3420 state.clearException(); | 3440 state.clearException(); |
3421 throwError(exception, info.GetIsolate()); | 3441 throwError(exception, info.GetIsolate()); |
3422 return; | 3442 return; |
3423 } | 3443 } |
3424 v8SetReturnValue(info, result.release()); | 3444 v8SetReturnValue(info, result.release()); |
3425 } | 3445 } |
3426 | 3446 |
3427 static void withExecutionContextAndScriptStateObjExceptionMethodCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) | 3447 static void withExecutionContextAndScriptStateObjExceptionMethodCallback(const v
8::FunctionCallbackInfo<v8::Value>& info) |
3428 { | 3448 { |
3429 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3449 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3430 TestObjV8Internal::withExecutionContextAndScriptStateObjExceptionMethod(info
); | 3450 TestObjV8Internal::withExecutionContextAndScriptStateObjExceptionMethod(info
); |
3431 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3451 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3432 } | 3452 } |
3433 | 3453 |
3434 static void withExecutionContextAndScriptStateWithSpacesMethod(const v8::Functio
nCallbackInfo<v8::Value>& info) | 3454 static void withExecutionContextAndScriptStateWithSpacesMethod(const v8::Functio
nCallbackInfo<v8::Value>& info) |
3435 { | 3455 { |
| 3456 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withExecuti
onContextAndScriptStateWithSpaces", "TestObject", info.Holder(), info.GetIsolate
()); |
3436 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3457 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3437 ScriptState* currentState = ScriptState::current(); | 3458 ScriptState* currentState = ScriptState::current(); |
3438 if (!currentState) | 3459 if (!currentState) |
3439 return; | 3460 return; |
3440 ScriptState& state = *currentState; | 3461 ScriptState& state = *currentState; |
3441 ExecutionContext* scriptContext = getExecutionContext(); | 3462 ExecutionContext* scriptContext = getExecutionContext(); |
3442 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateWithSpaces(&
state, scriptContext); | 3463 RefPtr<TestObj> result = imp->withExecutionContextAndScriptStateWithSpaces(&
state, scriptContext); |
3443 if (state.hadException()) { | 3464 if (state.hadException()) { |
3444 v8::Local<v8::Value> exception = state.exception(); | 3465 v8::Local<v8::Value> exception = state.exception(); |
3445 state.clearException(); | 3466 state.clearException(); |
3446 throwError(exception, info.GetIsolate()); | 3467 throwError(exception, info.GetIsolate()); |
3447 return; | 3468 return; |
3448 } | 3469 } |
3449 v8SetReturnValue(info, result.release()); | 3470 v8SetReturnValue(info, result.release()); |
3450 } | 3471 } |
3451 | 3472 |
3452 static void withExecutionContextAndScriptStateWithSpacesMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) | 3473 static void withExecutionContextAndScriptStateWithSpacesMethodCallback(const v8:
:FunctionCallbackInfo<v8::Value>& info) |
3453 { | 3474 { |
3454 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3475 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3455 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesMethod(info); | 3476 TestObjV8Internal::withExecutionContextAndScriptStateWithSpacesMethod(info); |
3456 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3477 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3457 } | 3478 } |
3458 | 3479 |
3459 static void withActiveWindowAndFirstWindowMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) | 3480 static void withActiveWindowAndFirstWindowMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) |
3460 { | 3481 { |
| 3482 ExceptionState exceptionState(ExceptionState::ExecutionContext, "withActiveW
indowAndFirstWindow", "TestObject", info.Holder(), info.GetIsolate()); |
3461 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3483 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3462 imp->withActiveWindowAndFirstWindow(activeDOMWindow(), firstDOMWindow()); | 3484 imp->withActiveWindowAndFirstWindow(activeDOMWindow(), firstDOMWindow()); |
3463 } | 3485 } |
3464 | 3486 |
3465 static void withActiveWindowAndFirstWindowMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 3487 static void withActiveWindowAndFirstWindowMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
3466 { | 3488 { |
3467 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3489 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3468 TestObjV8Internal::withActiveWindowAndFirstWindowMethod(info); | 3490 TestObjV8Internal::withActiveWindowAndFirstWindowMethod(info); |
3469 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3491 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3470 } | 3492 } |
3471 | 3493 |
3472 static void methodWithOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 3494 static void methodWithOptionalArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
3473 { | 3495 { |
| 3496 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithO
ptionalArg", "TestObject", info.Holder(), info.GetIsolate()); |
3474 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3497 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3475 if (UNLIKELY(info.Length() <= 0)) { | 3498 if (UNLIKELY(info.Length() <= 0)) { |
3476 imp->methodWithOptionalArg(); | 3499 imp->methodWithOptionalArg(); |
3477 return; | 3500 return; |
3478 } | 3501 } |
3479 V8TRYCATCH_VOID(int, opt, toInt32(info[0])); | 3502 V8TRYCATCH_VOID(int, opt, toInt32(info[0])); |
3480 imp->methodWithOptionalArg(opt); | 3503 imp->methodWithOptionalArg(opt); |
3481 } | 3504 } |
3482 | 3505 |
3483 static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 3506 static void methodWithOptionalArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
3484 { | 3507 { |
3485 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3508 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3486 TestObjV8Internal::methodWithOptionalArgMethod(info); | 3509 TestObjV8Internal::methodWithOptionalArgMethod(info); |
3487 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3510 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3488 } | 3511 } |
3489 | 3512 |
3490 static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 3513 static void methodWithNonOptionalArgAndOptionalArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
3491 { | 3514 { |
| 3515 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
onOptionalArgAndOptionalArg", "TestObject", info.Holder(), info.GetIsolate()); |
3492 if (UNLIKELY(info.Length() < 1)) { | 3516 if (UNLIKELY(info.Length() < 1)) { |
3493 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptional
ArgAndOptionalArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.
Length())), info.GetIsolate()); | 3517 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptional
ArgAndOptionalArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.
Length())), info.GetIsolate()); |
3494 return; | 3518 return; |
3495 } | 3519 } |
3496 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3520 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3497 V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0])); | 3521 V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0])); |
3498 if (UNLIKELY(info.Length() <= 1)) { | 3522 if (UNLIKELY(info.Length() <= 1)) { |
3499 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt); | 3523 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt); |
3500 return; | 3524 return; |
3501 } | 3525 } |
3502 V8TRYCATCH_VOID(int, opt, toInt32(info[1])); | 3526 V8TRYCATCH_VOID(int, opt, toInt32(info[1])); |
3503 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); | 3527 imp->methodWithNonOptionalArgAndOptionalArg(nonOpt, opt); |
3504 } | 3528 } |
3505 | 3529 |
3506 static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 3530 static void methodWithNonOptionalArgAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
3507 { | 3531 { |
3508 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3532 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3509 TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(info); | 3533 TestObjV8Internal::methodWithNonOptionalArgAndOptionalArgMethod(info); |
3510 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3534 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3511 } | 3535 } |
3512 | 3536 |
3513 static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionC
allbackInfo<v8::Value>& info) | 3537 static void methodWithNonOptionalArgAndTwoOptionalArgsMethod(const v8::FunctionC
allbackInfo<v8::Value>& info) |
3514 { | 3538 { |
| 3539 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
onOptionalArgAndTwoOptionalArgs", "TestObject", info.Holder(), info.GetIsolate()
); |
3515 if (UNLIKELY(info.Length() < 1)) { | 3540 if (UNLIKELY(info.Length() < 1)) { |
3516 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptional
ArgAndTwoOptionalArgs", "TestObject", ExceptionMessages::notEnoughArguments(1, i
nfo.Length())), info.GetIsolate()); | 3541 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonOptional
ArgAndTwoOptionalArgs", "TestObject", ExceptionMessages::notEnoughArguments(1, i
nfo.Length())), info.GetIsolate()); |
3517 return; | 3542 return; |
3518 } | 3543 } |
3519 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3544 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3520 V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0])); | 3545 V8TRYCATCH_VOID(int, nonOpt, toInt32(info[0])); |
3521 if (UNLIKELY(info.Length() <= 1)) { | 3546 if (UNLIKELY(info.Length() <= 1)) { |
3522 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); | 3547 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt); |
3523 return; | 3548 return; |
3524 } | 3549 } |
3525 V8TRYCATCH_VOID(int, opt1, toInt32(info[1])); | 3550 V8TRYCATCH_VOID(int, opt1, toInt32(info[1])); |
3526 if (UNLIKELY(info.Length() <= 2)) { | 3551 if (UNLIKELY(info.Length() <= 2)) { |
3527 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1); | 3552 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1); |
3528 return; | 3553 return; |
3529 } | 3554 } |
3530 V8TRYCATCH_VOID(int, opt2, toInt32(info[2])); | 3555 V8TRYCATCH_VOID(int, opt2, toInt32(info[2])); |
3531 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2); | 3556 imp->methodWithNonOptionalArgAndTwoOptionalArgs(nonOpt, opt1, opt2); |
3532 } | 3557 } |
3533 | 3558 |
3534 static void methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback(const v8::F
unctionCallbackInfo<v8::Value>& info) | 3559 static void methodWithNonOptionalArgAndTwoOptionalArgsMethodCallback(const v8::F
unctionCallbackInfo<v8::Value>& info) |
3535 { | 3560 { |
3536 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3561 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3537 TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(info); | 3562 TestObjV8Internal::methodWithNonOptionalArgAndTwoOptionalArgsMethod(info); |
3538 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3563 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3539 } | 3564 } |
3540 | 3565 |
3541 static void methodWithOptionalStringMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 3566 static void methodWithOptionalStringMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
3542 { | 3567 { |
| 3568 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithO
ptionalString", "TestObject", info.Holder(), info.GetIsolate()); |
3543 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3569 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3544 if (UNLIKELY(info.Length() <= 0)) { | 3570 if (UNLIKELY(info.Length() <= 0)) { |
3545 imp->methodWithOptionalString(); | 3571 imp->methodWithOptionalString(); |
3546 return; | 3572 return; |
3547 } | 3573 } |
3548 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); | 3574 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
3549 imp->methodWithOptionalString(str); | 3575 imp->methodWithOptionalString(str); |
3550 } | 3576 } |
3551 | 3577 |
3552 static void methodWithOptionalStringMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 3578 static void methodWithOptionalStringMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
3553 { | 3579 { |
3554 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3580 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3555 TestObjV8Internal::methodWithOptionalStringMethod(info); | 3581 TestObjV8Internal::methodWithOptionalStringMethod(info); |
3556 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3582 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3557 } | 3583 } |
3558 | 3584 |
3559 static void methodWithOptionalStringIsUndefinedMethod(const v8::FunctionCallback
Info<v8::Value>& info) | 3585 static void methodWithOptionalStringIsUndefinedMethod(const v8::FunctionCallback
Info<v8::Value>& info) |
3560 { | 3586 { |
| 3587 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithO
ptionalStringIsUndefined", "TestObject", info.Holder(), info.GetIsolate()); |
3561 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3588 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3562 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); | 3589 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
3563 imp->methodWithOptionalStringIsUndefined(str); | 3590 imp->methodWithOptionalStringIsUndefined(str); |
3564 } | 3591 } |
3565 | 3592 |
3566 static void methodWithOptionalStringIsUndefinedMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) | 3593 static void methodWithOptionalStringIsUndefinedMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) |
3567 { | 3594 { |
3568 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3595 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3569 TestObjV8Internal::methodWithOptionalStringIsUndefinedMethod(info); | 3596 TestObjV8Internal::methodWithOptionalStringIsUndefinedMethod(info); |
3570 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3597 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3571 } | 3598 } |
3572 | 3599 |
3573 static void methodWithOptionalStringIsNullStringMethod(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 3600 static void methodWithOptionalStringIsNullStringMethod(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
3574 { | 3601 { |
| 3602 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithO
ptionalStringIsNullString", "TestObject", info.Holder(), info.GetIsolate()); |
3575 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3603 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3576 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, argumentOrNull
(info, 0)); | 3604 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, argumentOrNull
(info, 0)); |
3577 imp->methodWithOptionalStringIsNullString(str); | 3605 imp->methodWithOptionalStringIsNullString(str); |
3578 } | 3606 } |
3579 | 3607 |
3580 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) | 3608 static void methodWithOptionalStringIsNullStringMethodCallback(const v8::Functio
nCallbackInfo<v8::Value>& info) |
3581 { | 3609 { |
3582 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3610 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3583 TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(info); | 3611 TestObjV8Internal::methodWithOptionalStringIsNullStringMethod(info); |
3584 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3612 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3585 } | 3613 } |
3586 | 3614 |
3587 static void methodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 3615 static void methodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
3588 { | 3616 { |
| 3617 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithC
allbackArg", "TestObject", info.Holder(), info.GetIsolate()); |
3589 if (UNLIKELY(info.Length() < 1)) { | 3618 if (UNLIKELY(info.Length() < 1)) { |
3590 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); | 3619 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
3591 return; | 3620 return; |
3592 } | 3621 } |
3593 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3622 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3594 if (info.Length() <= 0 || !info[0]->IsFunction()) { | 3623 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
3595 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg
", "TestObject", "The callback provided as parameter 1 is not a function."), inf
o.GetIsolate()); | 3624 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbackArg
", "TestObject", "The callback provided as parameter 1 is not a function."), inf
o.GetIsolate()); |
3596 return; | 3625 return; |
3597 } | 3626 } |
3598 OwnPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecution
Context()); | 3627 OwnPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecution
Context()); |
3599 imp->methodWithCallbackArg(callback.release()); | 3628 imp->methodWithCallbackArg(callback.release()); |
3600 } | 3629 } |
3601 | 3630 |
3602 static void methodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 3631 static void methodWithCallbackArgMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
3603 { | 3632 { |
3604 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3633 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3605 TestObjV8Internal::methodWithCallbackArgMethod(info); | 3634 TestObjV8Internal::methodWithCallbackArgMethod(info); |
3606 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3635 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3607 } | 3636 } |
3608 | 3637 |
3609 static void methodWithNonCallbackArgAndCallbackArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 3638 static void methodWithNonCallbackArgAndCallbackArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
3610 { | 3639 { |
| 3640 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
onCallbackArgAndCallbackArg", "TestObject", info.Holder(), info.GetIsolate()); |
3611 if (UNLIKELY(info.Length() < 2)) { | 3641 if (UNLIKELY(info.Length() < 2)) { |
3612 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback
ArgAndCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(2, info.
Length())), info.GetIsolate()); | 3642 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback
ArgAndCallbackArg", "TestObject", ExceptionMessages::notEnoughArguments(2, info.
Length())), info.GetIsolate()); |
3613 return; | 3643 return; |
3614 } | 3644 } |
3615 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3645 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3616 V8TRYCATCH_VOID(int, nonCallback, toInt32(info[0])); | 3646 V8TRYCATCH_VOID(int, nonCallback, toInt32(info[0])); |
3617 if (info.Length() <= 1 || !info[1]->IsFunction()) { | 3647 if (info.Length() <= 1 || !info[1]->IsFunction()) { |
3618 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback
ArgAndCallbackArg", "TestObject", "The callback provided as parameter 2 is not a
function."), info.GetIsolate()); | 3648 throwTypeError(ExceptionMessages::failedToExecute("methodWithNonCallback
ArgAndCallbackArg", "TestObject", "The callback provided as parameter 2 is not a
function."), info.GetIsolate()); |
3619 return; | 3649 return; |
3620 } | 3650 } |
3621 OwnPtr<TestCallback> callback = V8TestCallback::create(info[1], getExecution
Context()); | 3651 OwnPtr<TestCallback> callback = V8TestCallback::create(info[1], getExecution
Context()); |
3622 imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback.release())
; | 3652 imp->methodWithNonCallbackArgAndCallbackArg(nonCallback, callback.release())
; |
3623 } | 3653 } |
3624 | 3654 |
3625 static void methodWithNonCallbackArgAndCallbackArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 3655 static void methodWithNonCallbackArgAndCallbackArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
3626 { | 3656 { |
3627 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3657 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3628 TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgMethod(info); | 3658 TestObjV8Internal::methodWithNonCallbackArgAndCallbackArgMethod(info); |
3629 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3659 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3630 } | 3660 } |
3631 | 3661 |
3632 static void methodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInf
o<v8::Value>& info) | 3662 static void methodWithCallbackAndOptionalArgMethod(const v8::FunctionCallbackInf
o<v8::Value>& info) |
3633 { | 3663 { |
| 3664 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithC
allbackAndOptionalArg", "TestObject", info.Holder(), info.GetIsolate()); |
3634 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3665 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3635 OwnPtr<TestCallback> callback; | 3666 OwnPtr<TestCallback> callback; |
3636 if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) { | 3667 if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) { |
3637 if (!info[0]->IsFunction()) { | 3668 if (!info[0]->IsFunction()) { |
3638 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbac
kAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a f
unction."), info.GetIsolate()); | 3669 throwTypeError(ExceptionMessages::failedToExecute("methodWithCallbac
kAndOptionalArg", "TestObject", "The callback provided as parameter 1 is not a f
unction."), info.GetIsolate()); |
3639 return; | 3670 return; |
3640 } | 3671 } |
3641 callback = V8TestCallback::create(info[0], getExecutionContext()); | 3672 callback = V8TestCallback::create(info[0], getExecutionContext()); |
3642 } | 3673 } |
3643 imp->methodWithCallbackAndOptionalArg(callback.release()); | 3674 imp->methodWithCallbackAndOptionalArg(callback.release()); |
3644 } | 3675 } |
3645 | 3676 |
3646 static void methodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCal
lbackInfo<v8::Value>& info) | 3677 static void methodWithCallbackAndOptionalArgMethodCallback(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
3647 { | 3678 { |
3648 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3679 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3649 TestObjV8Internal::methodWithCallbackAndOptionalArgMethod(info); | 3680 TestObjV8Internal::methodWithCallbackAndOptionalArgMethod(info); |
3650 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3681 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3651 } | 3682 } |
3652 | 3683 |
3653 static void methodWithNullableCallbackArgMethod(const v8::FunctionCallbackInfo<v
8::Value>& info) | 3684 static void methodWithNullableCallbackArgMethod(const v8::FunctionCallbackInfo<v
8::Value>& info) |
3654 { | 3685 { |
| 3686 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
ullableCallbackArg", "TestObject", info.Holder(), info.GetIsolate()); |
3655 if (UNLIKELY(info.Length() < 1)) { | 3687 if (UNLIKELY(info.Length() < 1)) { |
3656 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())
), info.GetIsolate()); | 3688 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())
), info.GetIsolate()); |
3657 return; | 3689 return; |
3658 } | 3690 } |
3659 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3691 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3660 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { | 3692 if (info.Length() <= 0 || !(info[0]->IsFunction() || info[0]->IsNull())) { |
3661 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackArg", "TestObject", "The callback provided as parameter 1 is not a function
."), info.GetIsolate()); | 3693 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableCal
lbackArg", "TestObject", "The callback provided as parameter 1 is not a function
."), info.GetIsolate()); |
3662 return; | 3694 return; |
3663 } | 3695 } |
3664 OwnPtr<TestCallback> callback = info[0]->IsNull() ? nullptr : V8TestCallback
::create(info[0], getExecutionContext()); | 3696 OwnPtr<TestCallback> callback = info[0]->IsNull() ? nullptr : V8TestCallback
::create(info[0], getExecutionContext()); |
3665 imp->methodWithNullableCallbackArg(callback.release()); | 3697 imp->methodWithNullableCallbackArg(callback.release()); |
3666 } | 3698 } |
3667 | 3699 |
3668 static void methodWithNullableCallbackArgMethodCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) | 3700 static void methodWithNullableCallbackArgMethodCallback(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
3669 { | 3701 { |
3670 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3702 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3671 TestObjV8Internal::methodWithNullableCallbackArgMethod(info); | 3703 TestObjV8Internal::methodWithNullableCallbackArgMethod(info); |
3672 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3704 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3673 } | 3705 } |
3674 | 3706 |
3675 static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 3707 static void staticMethodWithCallbackAndOptionalArgMethod(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
3676 { | 3708 { |
| 3709 ExceptionState exceptionState(ExceptionState::ExecutionContext, "staticMetho
dWithCallbackAndOptionalArg", "TestObject", info.Holder(), info.GetIsolate()); |
3677 OwnPtr<TestCallback> callback; | 3710 OwnPtr<TestCallback> callback; |
3678 if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) { | 3711 if (info.Length() > 0 && !info[0]->IsNull() && !info[0]->IsUndefined()) { |
3679 if (!info[0]->IsFunction()) { | 3712 if (!info[0]->IsFunction()) { |
3680 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithC
allbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is n
ot a function."), info.GetIsolate()); | 3713 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithC
allbackAndOptionalArg", "TestObject", "The callback provided as parameter 1 is n
ot a function."), info.GetIsolate()); |
3681 return; | 3714 return; |
3682 } | 3715 } |
3683 callback = V8TestCallback::create(info[0], getExecutionContext()); | 3716 callback = V8TestCallback::create(info[0], getExecutionContext()); |
3684 } | 3717 } |
3685 TestObj::staticMethodWithCallbackAndOptionalArg(callback.release()); | 3718 TestObj::staticMethodWithCallbackAndOptionalArg(callback.release()); |
3686 } | 3719 } |
3687 | 3720 |
3688 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) | 3721 static void staticMethodWithCallbackAndOptionalArgMethodCallback(const v8::Funct
ionCallbackInfo<v8::Value>& info) |
3689 { | 3722 { |
3690 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3723 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3691 TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info); | 3724 TestObjV8Internal::staticMethodWithCallbackAndOptionalArgMethod(info); |
3692 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3725 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3693 } | 3726 } |
3694 | 3727 |
3695 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3728 static void staticMethodWithCallbackArgMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3696 { | 3729 { |
| 3730 ExceptionState exceptionState(ExceptionState::ExecutionContext, "staticMetho
dWithCallbackArg", "TestObject", info.Holder(), info.GetIsolate()); |
3697 if (UNLIKELY(info.Length() < 1)) { | 3731 if (UNLIKELY(info.Length() < 1)) { |
3698 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 3732 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
3699 return; | 3733 return; |
3700 } | 3734 } |
3701 if (info.Length() <= 0 || !info[0]->IsFunction()) { | 3735 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
3702 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", "The callback provided as parameter 1 is not a function."
), info.GetIsolate()); | 3736 throwTypeError(ExceptionMessages::failedToExecute("staticMethodWithCallb
ackArg", "TestObject", "The callback provided as parameter 1 is not a function."
), info.GetIsolate()); |
3703 return; | 3737 return; |
3704 } | 3738 } |
3705 OwnPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecution
Context()); | 3739 OwnPtr<TestCallback> callback = V8TestCallback::create(info[0], getExecution
Context()); |
3706 TestObj::staticMethodWithCallbackArg(callback.release()); | 3740 TestObj::staticMethodWithCallbackArg(callback.release()); |
3707 } | 3741 } |
3708 | 3742 |
3709 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 3743 static void staticMethodWithCallbackArgMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
3710 { | 3744 { |
3711 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3745 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3712 TestObjV8Internal::staticMethodWithCallbackArgMethod(info); | 3746 TestObjV8Internal::staticMethodWithCallbackArgMethod(info); |
3713 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3747 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3714 } | 3748 } |
3715 | 3749 |
3716 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8::
Value>& info) | 3750 static void methodWithEnforceRangeInt8Method(const v8::FunctionCallbackInfo<v8::
Value>& info) |
3717 { | 3751 { |
| 3752 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeInt8", "TestObject", info.Holder(), info.GetIsolate()); |
3718 if (UNLIKELY(info.Length() < 1)) { | 3753 if (UNLIKELY(info.Length() < 1)) { |
3719 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 3754 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
3720 return; | 3755 return; |
3721 } | 3756 } |
3722 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3757 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3723 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt8(info[0], EnforceRange, ok)
, info.GetIsolate()); | 3758 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt8(info[0], EnforceRange, ok)
, info.GetIsolate()); |
3724 imp->methodWithEnforceRangeInt8(value); | 3759 imp->methodWithEnforceRangeInt8(value); |
3725 } | 3760 } |
3726 | 3761 |
3727 static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 3762 static void methodWithEnforceRangeInt8MethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
3728 { | 3763 { |
3729 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3764 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3730 TestObjV8Internal::methodWithEnforceRangeInt8Method(info); | 3765 TestObjV8Internal::methodWithEnforceRangeInt8Method(info); |
3731 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3766 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3732 } | 3767 } |
3733 | 3768 |
3734 static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3769 static void methodWithEnforceRangeUInt8Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3735 { | 3770 { |
| 3771 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeUInt8", "TestObject", info.Holder(), info.GetIsolate()); |
3736 if (UNLIKELY(info.Length() < 1)) { | 3772 if (UNLIKELY(info.Length() < 1)) { |
3737 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 3773 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt8", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
3738 return; | 3774 return; |
3739 } | 3775 } |
3740 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3776 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3741 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt8(info[0], EnforceRang
e, ok), info.GetIsolate()); | 3777 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt8(info[0], EnforceRang
e, ok), info.GetIsolate()); |
3742 imp->methodWithEnforceRangeUInt8(value); | 3778 imp->methodWithEnforceRangeUInt8(value); |
3743 } | 3779 } |
3744 | 3780 |
3745 static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 3781 static void methodWithEnforceRangeUInt8MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
3746 { | 3782 { |
3747 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3783 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3748 TestObjV8Internal::methodWithEnforceRangeUInt8Method(info); | 3784 TestObjV8Internal::methodWithEnforceRangeUInt8Method(info); |
3749 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3785 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3750 } | 3786 } |
3751 | 3787 |
3752 static void methodWithEnforceRangeInt16Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3788 static void methodWithEnforceRangeInt16Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3753 { | 3789 { |
| 3790 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeInt16", "TestObject", info.Holder(), info.GetIsolate()); |
3754 if (UNLIKELY(info.Length() < 1)) { | 3791 if (UNLIKELY(info.Length() < 1)) { |
3755 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt16", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 3792 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt16", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
3756 return; | 3793 return; |
3757 } | 3794 } |
3758 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3795 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3759 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt16(info[0], EnforceRange, ok
), info.GetIsolate()); | 3796 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt16(info[0], EnforceRange, ok
), info.GetIsolate()); |
3760 imp->methodWithEnforceRangeInt16(value); | 3797 imp->methodWithEnforceRangeInt16(value); |
3761 } | 3798 } |
3762 | 3799 |
3763 static void methodWithEnforceRangeInt16MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 3800 static void methodWithEnforceRangeInt16MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
3764 { | 3801 { |
3765 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3802 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3766 TestObjV8Internal::methodWithEnforceRangeInt16Method(info); | 3803 TestObjV8Internal::methodWithEnforceRangeInt16Method(info); |
3767 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3804 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3768 } | 3805 } |
3769 | 3806 |
3770 static void methodWithEnforceRangeUInt16Method(const v8::FunctionCallbackInfo<v8
::Value>& info) | 3807 static void methodWithEnforceRangeUInt16Method(const v8::FunctionCallbackInfo<v8
::Value>& info) |
3771 { | 3808 { |
| 3809 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeUInt16", "TestObject", info.Holder(), info.GetIsolate()); |
3772 if (UNLIKELY(info.Length() < 1)) { | 3810 if (UNLIKELY(info.Length() < 1)) { |
3773 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt16", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))
, info.GetIsolate()); | 3811 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt16", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))
, info.GetIsolate()); |
3774 return; | 3812 return; |
3775 } | 3813 } |
3776 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3814 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3777 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt16(info[0], EnforceRan
ge, ok), info.GetIsolate()); | 3815 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt16(info[0], EnforceRan
ge, ok), info.GetIsolate()); |
3778 imp->methodWithEnforceRangeUInt16(value); | 3816 imp->methodWithEnforceRangeUInt16(value); |
3779 } | 3817 } |
3780 | 3818 |
3781 static void methodWithEnforceRangeUInt16MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 3819 static void methodWithEnforceRangeUInt16MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
3782 { | 3820 { |
3783 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3821 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3784 TestObjV8Internal::methodWithEnforceRangeUInt16Method(info); | 3822 TestObjV8Internal::methodWithEnforceRangeUInt16Method(info); |
3785 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3823 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3786 } | 3824 } |
3787 | 3825 |
3788 static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3826 static void methodWithEnforceRangeInt32Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3789 { | 3827 { |
| 3828 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeInt32", "TestObject", info.Holder(), info.GetIsolate()); |
3790 if (UNLIKELY(info.Length() < 1)) { | 3829 if (UNLIKELY(info.Length() < 1)) { |
3791 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 3830 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
3792 return; | 3831 return; |
3793 } | 3832 } |
3794 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3833 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3795 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt32(info[0], EnforceRange, ok
), info.GetIsolate()); | 3834 V8TRYCATCH_WITH_TYPECHECK_VOID(int, value, toInt32(info[0], EnforceRange, ok
), info.GetIsolate()); |
3796 imp->methodWithEnforceRangeInt32(value); | 3835 imp->methodWithEnforceRangeInt32(value); |
3797 } | 3836 } |
3798 | 3837 |
3799 static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 3838 static void methodWithEnforceRangeInt32MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
3800 { | 3839 { |
3801 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3840 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3802 TestObjV8Internal::methodWithEnforceRangeInt32Method(info); | 3841 TestObjV8Internal::methodWithEnforceRangeInt32Method(info); |
3803 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3842 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3804 } | 3843 } |
3805 | 3844 |
3806 static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8
::Value>& info) | 3845 static void methodWithEnforceRangeUInt32Method(const v8::FunctionCallbackInfo<v8
::Value>& info) |
3807 { | 3846 { |
| 3847 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeUInt32", "TestObject", info.Holder(), info.GetIsolate()); |
3808 if (UNLIKELY(info.Length() < 1)) { | 3848 if (UNLIKELY(info.Length() < 1)) { |
3809 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))
, info.GetIsolate()); | 3849 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt32", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))
, info.GetIsolate()); |
3810 return; | 3850 return; |
3811 } | 3851 } |
3812 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3852 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3813 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt32(info[0], EnforceRan
ge, ok), info.GetIsolate()); | 3853 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned, value, toUInt32(info[0], EnforceRan
ge, ok), info.GetIsolate()); |
3814 imp->methodWithEnforceRangeUInt32(value); | 3854 imp->methodWithEnforceRangeUInt32(value); |
3815 } | 3855 } |
3816 | 3856 |
3817 static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 3857 static void methodWithEnforceRangeUInt32MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
3818 { | 3858 { |
3819 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3859 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3820 TestObjV8Internal::methodWithEnforceRangeUInt32Method(info); | 3860 TestObjV8Internal::methodWithEnforceRangeUInt32Method(info); |
3821 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3861 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3822 } | 3862 } |
3823 | 3863 |
3824 static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3864 static void methodWithEnforceRangeInt64Method(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3825 { | 3865 { |
| 3866 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeInt64", "TestObject", info.Holder(), info.GetIsolate()); |
3826 if (UNLIKELY(info.Length() < 1)) { | 3867 if (UNLIKELY(info.Length() < 1)) { |
3827 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); | 3868 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())),
info.GetIsolate()); |
3828 return; | 3869 return; |
3829 } | 3870 } |
3830 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3871 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3831 V8TRYCATCH_WITH_TYPECHECK_VOID(long long, value, toInt64(info[0], EnforceRan
ge, ok), info.GetIsolate()); | 3872 V8TRYCATCH_WITH_TYPECHECK_VOID(long long, value, toInt64(info[0], EnforceRan
ge, ok), info.GetIsolate()); |
3832 imp->methodWithEnforceRangeInt64(value); | 3873 imp->methodWithEnforceRangeInt64(value); |
3833 } | 3874 } |
3834 | 3875 |
3835 static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 3876 static void methodWithEnforceRangeInt64MethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
3836 { | 3877 { |
3837 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3878 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3838 TestObjV8Internal::methodWithEnforceRangeInt64Method(info); | 3879 TestObjV8Internal::methodWithEnforceRangeInt64Method(info); |
3839 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3880 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3840 } | 3881 } |
3841 | 3882 |
3842 static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8
::Value>& info) | 3883 static void methodWithEnforceRangeUInt64Method(const v8::FunctionCallbackInfo<v8
::Value>& info) |
3843 { | 3884 { |
| 3885 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithE
nforceRangeUInt64", "TestObject", info.Holder(), info.GetIsolate()); |
3844 if (UNLIKELY(info.Length() < 1)) { | 3886 if (UNLIKELY(info.Length() < 1)) { |
3845 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))
, info.GetIsolate()); | 3887 throwTypeError(ExceptionMessages::failedToExecute("methodWithEnforceRang
eUInt64", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()))
, info.GetIsolate()); |
3846 return; | 3888 return; |
3847 } | 3889 } |
3848 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3890 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3849 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, value, toUInt64(info[0],
EnforceRange, ok), info.GetIsolate()); | 3891 V8TRYCATCH_WITH_TYPECHECK_VOID(unsigned long long, value, toUInt64(info[0],
EnforceRange, ok), info.GetIsolate()); |
3850 imp->methodWithEnforceRangeUInt64(value); | 3892 imp->methodWithEnforceRangeUInt64(value); |
3851 } | 3893 } |
3852 | 3894 |
3853 static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) | 3895 static void methodWithEnforceRangeUInt64MethodCallback(const v8::FunctionCallbac
kInfo<v8::Value>& info) |
3854 { | 3896 { |
3855 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3897 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3856 TestObjV8Internal::methodWithEnforceRangeUInt64Method(info); | 3898 TestObjV8Internal::methodWithEnforceRangeUInt64Method(info); |
3857 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3899 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3858 } | 3900 } |
3859 | 3901 |
3860 #if ENABLE(Condition1) | 3902 #if ENABLE(Condition1) |
3861 static void conditionalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3903 static void conditionalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3862 { | 3904 { |
| 3905 ExceptionState exceptionState(ExceptionState::ExecutionContext, "conditional
Method1", "TestObject", info.Holder(), info.GetIsolate()); |
3863 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3906 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3864 v8SetReturnValueString(info, imp->conditionalMethod1(), info.GetIsolate()); | 3907 v8SetReturnValueString(info, imp->conditionalMethod1(), info.GetIsolate()); |
3865 } | 3908 } |
3866 #endif // ENABLE(Condition1) | 3909 #endif // ENABLE(Condition1) |
3867 | 3910 |
3868 #if ENABLE(Condition1) | 3911 #if ENABLE(Condition1) |
3869 static void conditionalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 3912 static void conditionalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
3870 { | 3913 { |
3871 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3914 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3872 TestObjV8Internal::conditionalMethod1Method(info); | 3915 TestObjV8Internal::conditionalMethod1Method(info); |
3873 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3916 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3874 } | 3917 } |
3875 #endif // ENABLE(Condition1) | 3918 #endif // ENABLE(Condition1) |
3876 | 3919 |
3877 #if ENABLE(Condition1) && ENABLE(Condition2) | 3920 #if ENABLE(Condition1) && ENABLE(Condition2) |
3878 static void conditionalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3921 static void conditionalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3879 { | 3922 { |
| 3923 ExceptionState exceptionState(ExceptionState::ExecutionContext, "conditional
Method2", "TestObject", info.Holder(), info.GetIsolate()); |
3880 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3924 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3881 imp->conditionalMethod2(); | 3925 imp->conditionalMethod2(); |
3882 } | 3926 } |
3883 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 3927 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
3884 | 3928 |
3885 #if ENABLE(Condition1) && ENABLE(Condition2) | 3929 #if ENABLE(Condition1) && ENABLE(Condition2) |
3886 static void conditionalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 3930 static void conditionalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
3887 { | 3931 { |
3888 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3932 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3889 TestObjV8Internal::conditionalMethod2Method(info); | 3933 TestObjV8Internal::conditionalMethod2Method(info); |
3890 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3934 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3891 } | 3935 } |
3892 #endif // ENABLE(Condition1) && ENABLE(Condition2) | 3936 #endif // ENABLE(Condition1) && ENABLE(Condition2) |
3893 | 3937 |
3894 #if ENABLE(Condition1) || ENABLE(Condition2) | 3938 #if ENABLE(Condition1) || ENABLE(Condition2) |
3895 static void conditionalMethod3Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3939 static void conditionalMethod3Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
3896 { | 3940 { |
| 3941 ExceptionState exceptionState(ExceptionState::ExecutionContext, "conditional
Method3", "TestObject", info.Holder(), info.GetIsolate()); |
3897 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3942 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3898 imp->conditionalMethod3(); | 3943 imp->conditionalMethod3(); |
3899 } | 3944 } |
3900 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 3945 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
3901 | 3946 |
3902 #if ENABLE(Condition1) || ENABLE(Condition2) | 3947 #if ENABLE(Condition1) || ENABLE(Condition2) |
3903 static void conditionalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 3948 static void conditionalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
3904 { | 3949 { |
3905 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3950 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3906 TestObjV8Internal::conditionalMethod3Method(info); | 3951 TestObjV8Internal::conditionalMethod3Method(info); |
3907 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3952 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3908 } | 3953 } |
3909 #endif // ENABLE(Condition1) || ENABLE(Condition2) | 3954 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
3910 | 3955 |
3911 static void callbackFunctionReturnValueMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3956 static void callbackFunctionReturnValueMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
3912 { | 3957 { |
| 3958 ExceptionState exceptionState(ExceptionState::ExecutionContext, "callbackFun
ctionReturnValue", "TestObject", info.Holder(), info.GetIsolate()); |
3913 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3959 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3914 v8SetReturnValue(info, imp->callbackFunctionReturnValue().v8Value()); | 3960 v8SetReturnValue(info, imp->callbackFunctionReturnValue().v8Value()); |
3915 } | 3961 } |
3916 | 3962 |
3917 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 3963 static void callbackFunctionReturnValueMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
3918 { | 3964 { |
3919 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3965 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3920 TestObjV8Internal::callbackFunctionReturnValueMethod(info); | 3966 TestObjV8Internal::callbackFunctionReturnValueMethod(info); |
3921 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3967 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3922 } | 3968 } |
3923 | 3969 |
3924 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 3970 static void callbackFunctionArgumentMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
3925 { | 3971 { |
| 3972 ExceptionState exceptionState(ExceptionState::ExecutionContext, "callbackFun
ctionArgument", "TestObject", info.Holder(), info.GetIsolate()); |
3926 if (UNLIKELY(info.Length() < 1)) { | 3973 if (UNLIKELY(info.Length() < 1)) { |
3927 throwTypeError(ExceptionMessages::failedToExecute("callbackFunctionArgum
ent", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); | 3974 throwTypeError(ExceptionMessages::failedToExecute("callbackFunctionArgum
ent", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); |
3928 return; | 3975 return; |
3929 } | 3976 } |
3930 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3977 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3931 V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(info[0], info.GetIsolate(
))); | 3978 V8TRYCATCH_VOID(ScriptValue, function, ScriptValue(info[0], info.GetIsolate(
))); |
3932 imp->callbackFunctionArgument(function); | 3979 imp->callbackFunctionArgument(function); |
3933 } | 3980 } |
3934 | 3981 |
3935 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 3982 static void callbackFunctionArgumentMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
3936 { | 3983 { |
3937 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3984 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
3938 TestObjV8Internal::callbackFunctionArgumentMethod(info); | 3985 TestObjV8Internal::callbackFunctionArgumentMethod(info); |
3939 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3986 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
3940 } | 3987 } |
3941 | 3988 |
3942 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 3989 static void overloadedMethod1Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3943 { | 3990 { |
| 3991 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethod", "TestObject", info.Holder(), info.GetIsolate()); |
3944 if (UNLIKELY(info.Length() < 1)) { | 3992 if (UNLIKELY(info.Length() < 1)) { |
3945 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); | 3993 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
3946 return; | 3994 return; |
3947 } | 3995 } |
3948 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3996 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3949 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 3997 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
3950 imp->overloadedMethod(longArg); | 3998 imp->overloadedMethod(longArg); |
3951 } | 3999 } |
3952 | 4000 |
3953 static void overloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 4001 static void overloadedMethod2Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3954 { | 4002 { |
| 4003 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethod", "TestObject", info.Holder(), info.GetIsolate()); |
3955 if (UNLIKELY(info.Length() < 1)) { | 4004 if (UNLIKELY(info.Length() < 1)) { |
3956 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); | 4005 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
3957 return; | 4006 return; |
3958 } | 4007 } |
3959 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4008 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3960 if (info.Length() <= 0 || !info[0]->IsFunction()) { | 4009 if (info.Length() <= 0 || !info[0]->IsFunction()) { |
3961 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", "The callback provided as parameter 1 is not a function."), info.Get
Isolate()); | 4010 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", "The callback provided as parameter 1 is not a function."), info.Get
Isolate()); |
3962 return; | 4011 return; |
3963 } | 4012 } |
3964 OwnPtr<TestCallback> callbackArg = V8TestCallback::create(info[0], getExecut
ionContext()); | 4013 OwnPtr<TestCallback> callbackArg = V8TestCallback::create(info[0], getExecut
ionContext()); |
3965 imp->overloadedMethod(callbackArg.release()); | 4014 imp->overloadedMethod(callbackArg.release()); |
3966 } | 4015 } |
3967 | 4016 |
3968 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 4017 static void overloadedMethod3Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3969 { | 4018 { |
| 4019 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethod", "TestObject", info.Holder(), info.GetIsolate()); |
3970 if (UNLIKELY(info.Length() < 1)) { | 4020 if (UNLIKELY(info.Length() < 1)) { |
3971 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); | 4021 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
3972 return; | 4022 return; |
3973 } | 4023 } |
3974 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4024 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3975 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[0])) : 0); | 4025 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[0])) : 0); |
3976 imp->overloadedMethod(objArg); | 4026 imp->overloadedMethod(objArg); |
3977 } | 4027 } |
3978 | 4028 |
3979 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 4029 static void overloadedMethod4Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3980 { | 4030 { |
| 4031 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethod", "TestObject", info.Holder(), info.GetIsolate()); |
3981 if (UNLIKELY(info.Length() < 1)) { | 4032 if (UNLIKELY(info.Length() < 1)) { |
3982 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); | 4033 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
3983 return; | 4034 return; |
3984 } | 4035 } |
3985 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4036 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3986 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1,
info.GetIsolate())); | 4037 V8TRYCATCH_VOID(Vector<String>, arrayArg, toNativeArray<String>(info[0], 1,
info.GetIsolate())); |
3987 imp->overloadedMethod(arrayArg); | 4038 imp->overloadedMethod(arrayArg); |
3988 } | 4039 } |
3989 | 4040 |
3990 static void overloadedMethod5Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 4041 static void overloadedMethod5Method(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
3991 { | 4042 { |
| 4043 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethod", "TestObject", info.Holder(), info.GetIsolate()); |
3992 if (UNLIKELY(info.Length() < 1)) { | 4044 if (UNLIKELY(info.Length() < 1)) { |
3993 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); | 4045 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethod", "T
estObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIs
olate()); |
3994 return; | 4046 return; |
3995 } | 4047 } |
3996 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4048 TestObj* imp = V8TestObject::toNative(info.Holder()); |
3997 V8TRYCATCH_VOID(Vector<unsigned>, sequenceArg, toNativeArray<unsigned>(info[
0], 1, info.GetIsolate())); | 4049 V8TRYCATCH_VOID(Vector<unsigned>, sequenceArg, toNativeArray<unsigned>(info[
0], 1, info.GetIsolate())); |
3998 imp->overloadedMethod(sequenceArg); | 4050 imp->overloadedMethod(sequenceArg); |
3999 } | 4051 } |
4000 | 4052 |
4001 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 4053 static void overloadedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
(...skipping 27 matching lines...) Expand all Loading... |
4029 | 4081 |
4030 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 4082 static void overloadedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
4031 { | 4083 { |
4032 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4084 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4033 TestObjV8Internal::overloadedMethodMethod(info); | 4085 TestObjV8Internal::overloadedMethodMethod(info); |
4034 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4086 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4035 } | 4087 } |
4036 | 4088 |
4037 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4089 static void overloadedMethodA1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4038 { | 4090 { |
| 4091 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethodA", "TestObject", info.Holder(), info.GetIsolate()); |
4039 if (UNLIKELY(info.Length() < 1)) { | 4092 if (UNLIKELY(info.Length() < 1)) { |
4040 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); | 4093 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
4041 return; | 4094 return; |
4042 } | 4095 } |
4043 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4096 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4044 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[0])) : 0); | 4097 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[0])) : 0); |
4045 if (UNLIKELY(info.Length() <= 1)) { | 4098 if (UNLIKELY(info.Length() <= 1)) { |
4046 imp->overloadedMethodA(objArg); | 4099 imp->overloadedMethodA(objArg); |
4047 return; | 4100 return; |
4048 } | 4101 } |
4049 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); | 4102 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
4050 imp->overloadedMethodA(objArg, longArg); | 4103 imp->overloadedMethodA(objArg, longArg); |
4051 } | 4104 } |
4052 | 4105 |
4053 static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4106 static void overloadedMethodA2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4054 { | 4107 { |
| 4108 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethodA", "TestObject", info.Holder(), info.GetIsolate()); |
4055 if (UNLIKELY(info.Length() < 2)) { | 4109 if (UNLIKELY(info.Length() < 2)) { |
4056 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "
TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetI
solate()); | 4110 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodA", "
TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetI
solate()); |
4057 return; | 4111 return; |
4058 } | 4112 } |
4059 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4113 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4060 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[0])) : 0); | 4114 V8TRYCATCH_VOID(TestObj*, objArg, V8TestObject::hasInstance(info[0], info.Ge
tIsolate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8
::Object>::Cast(info[0])) : 0); |
4061 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); | 4115 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[1]); |
4062 imp->overloadedMethodA(objArg, strArg); | 4116 imp->overloadedMethodA(objArg, strArg); |
4063 } | 4117 } |
4064 | 4118 |
(...skipping 16 matching lines...) Expand all Loading... |
4081 | 4135 |
4082 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 4136 static void overloadedMethodAMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
4083 { | 4137 { |
4084 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4138 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4085 TestObjV8Internal::overloadedMethodAMethod(info); | 4139 TestObjV8Internal::overloadedMethodAMethod(info); |
4086 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4140 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4087 } | 4141 } |
4088 | 4142 |
4089 static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4143 static void overloadedMethodB1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4090 { | 4144 { |
| 4145 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethodB", "TestObject", info.Holder(), info.GetIsolate()); |
4091 if (UNLIKELY(info.Length() < 1)) { | 4146 if (UNLIKELY(info.Length() < 1)) { |
4092 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); | 4147 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
4093 return; | 4148 return; |
4094 } | 4149 } |
4095 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4150 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4096 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 4151 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
4097 imp->overloadedMethodB(strArg); | 4152 imp->overloadedMethodB(strArg); |
4098 } | 4153 } |
4099 | 4154 |
4100 static void overloadedMethodB2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4155 static void overloadedMethodB2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4101 { | 4156 { |
| 4157 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedM
ethodB", "TestObject", info.Holder(), info.GetIsolate()); |
4102 if (UNLIKELY(info.Length() < 1)) { | 4158 if (UNLIKELY(info.Length() < 1)) { |
4103 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); | 4159 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodB", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
4104 return; | 4160 return; |
4105 } | 4161 } |
4106 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4162 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4107 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 4163 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
4108 imp->overloadedMethodB(strArg); | 4164 imp->overloadedMethodB(strArg); |
4109 } | 4165 } |
4110 | 4166 |
4111 static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 4167 static void overloadedMethodBMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
(...skipping 15 matching lines...) Expand all Loading... |
4127 | 4183 |
4128 static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 4184 static void overloadedMethodBMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
4129 { | 4185 { |
4130 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4186 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4131 TestObjV8Internal::overloadedMethodBMethod(info); | 4187 TestObjV8Internal::overloadedMethodBMethod(info); |
4132 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4188 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4133 } | 4189 } |
4134 | 4190 |
4135 static void classMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 4191 static void classMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
4136 { | 4192 { |
| 4193 ExceptionState exceptionState(ExceptionState::ExecutionContext, "classMethod
", "TestObject", info.Holder(), info.GetIsolate()); |
4137 TestObj::classMethod(); | 4194 TestObj::classMethod(); |
4138 } | 4195 } |
4139 | 4196 |
4140 static void classMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4197 static void classMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4141 { | 4198 { |
4142 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4199 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4143 TestObjV8Internal::classMethodMethod(info); | 4200 TestObjV8Internal::classMethodMethod(info); |
4144 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4201 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4145 } | 4202 } |
4146 | 4203 |
4147 static void classMethodWithOptionalMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 4204 static void classMethodWithOptionalMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
4148 { | 4205 { |
| 4206 ExceptionState exceptionState(ExceptionState::ExecutionContext, "classMethod
WithOptional", "TestObject", info.Holder(), info.GetIsolate()); |
4149 if (UNLIKELY(info.Length() <= 0)) { | 4207 if (UNLIKELY(info.Length() <= 0)) { |
4150 v8SetReturnValueInt(info, TestObj::classMethodWithOptional()); | 4208 v8SetReturnValueInt(info, TestObj::classMethodWithOptional()); |
4151 return; | 4209 return; |
4152 } | 4210 } |
4153 V8TRYCATCH_VOID(int, arg, toInt32(info[0])); | 4211 V8TRYCATCH_VOID(int, arg, toInt32(info[0])); |
4154 v8SetReturnValueInt(info, TestObj::classMethodWithOptional(arg)); | 4212 v8SetReturnValueInt(info, TestObj::classMethodWithOptional(arg)); |
4155 } | 4213 } |
4156 | 4214 |
4157 static void classMethodWithOptionalMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 4215 static void classMethodWithOptionalMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
4158 { | 4216 { |
4159 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4217 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4160 TestObjV8Internal::classMethodWithOptionalMethod(info); | 4218 TestObjV8Internal::classMethodWithOptionalMethod(info); |
4161 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4219 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4162 } | 4220 } |
4163 | 4221 |
4164 static void classMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4222 static void classMethod2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4165 { | 4223 { |
4166 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4224 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4167 V8TestObject::classMethod2MethodCustom(info); | 4225 V8TestObject::classMethod2MethodCustom(info); |
4168 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4226 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4169 } | 4227 } |
4170 | 4228 |
4171 static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4229 static void classMethodWithClampMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4172 { | 4230 { |
| 4231 ExceptionState exceptionState(ExceptionState::ExecutionContext, "classMethod
WithClamp", "TestObject", info.Holder(), info.GetIsolate()); |
4173 if (UNLIKELY(info.Length() < 2)) { | 4232 if (UNLIKELY(info.Length() < 2)) { |
4174 throwTypeError(ExceptionMessages::failedToExecute("classMethodWithClamp"
, "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G
etIsolate()); | 4233 throwTypeError(ExceptionMessages::failedToExecute("classMethodWithClamp"
, "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G
etIsolate()); |
4175 return; | 4234 return; |
4176 } | 4235 } |
4177 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4236 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4178 unsigned objArgsShort = 0; | 4237 unsigned objArgsShort = 0; |
4179 V8TRYCATCH_VOID(double, objArgsShortNativeValue, info[0]->NumberValue()); | 4238 V8TRYCATCH_VOID(double, objArgsShortNativeValue, info[0]->NumberValue()); |
4180 if (!std::isnan(objArgsShortNativeValue)) | 4239 if (!std::isnan(objArgsShortNativeValue)) |
4181 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue); | 4240 objArgsShort = clampTo<unsigned short>(objArgsShortNativeValue); |
4182 unsigned objArgsLong = 0; | 4241 unsigned objArgsLong = 0; |
4183 V8TRYCATCH_VOID(double, objArgsLongNativeValue, info[1]->NumberValue()); | 4242 V8TRYCATCH_VOID(double, objArgsLongNativeValue, info[1]->NumberValue()); |
4184 if (!std::isnan(objArgsLongNativeValue)) | 4243 if (!std::isnan(objArgsLongNativeValue)) |
4185 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue); | 4244 objArgsLong = clampTo<unsigned long>(objArgsLongNativeValue); |
4186 imp->classMethodWithClamp(objArgsShort, objArgsLong); | 4245 imp->classMethodWithClamp(objArgsShort, objArgsLong); |
4187 } | 4246 } |
4188 | 4247 |
4189 static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4248 static void classMethodWithClampMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4190 { | 4249 { |
4191 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4250 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4192 TestObjV8Internal::classMethodWithClampMethod(info); | 4251 TestObjV8Internal::classMethodWithClampMethod(info); |
4193 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4252 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4194 } | 4253 } |
4195 | 4254 |
4196 static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 4255 static void enabledAtRuntimeMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
4197 { | 4256 { |
| 4257 ExceptionState exceptionState(ExceptionState::ExecutionContext, "enabledAtRu
ntimeMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4198 if (UNLIKELY(info.Length() < 1)) { | 4258 if (UNLIKELY(info.Length() < 1)) { |
4199 throwTypeError(ExceptionMessages::failedToExecute("enabledAtRuntimeMetho
d", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info
.GetIsolate()); | 4259 throwTypeError(ExceptionMessages::failedToExecute("enabledAtRuntimeMetho
d", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info
.GetIsolate()); |
4200 return; | 4260 return; |
4201 } | 4261 } |
4202 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4262 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4203 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4263 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4204 imp->enabledAtRuntimeMethod(longArg); | 4264 imp->enabledAtRuntimeMethod(longArg); |
4205 } | 4265 } |
4206 | 4266 |
4207 static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 4267 static void enabledAtRuntimeMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
4208 { | 4268 { |
4209 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4269 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4210 TestObjV8Internal::enabledAtRuntimeMethodMethod(info); | 4270 TestObjV8Internal::enabledAtRuntimeMethodMethod(info); |
4211 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4271 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4212 } | 4272 } |
4213 | 4273 |
4214 static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 4274 static void enabledPerContextMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
4215 { | 4275 { |
| 4276 ExceptionState exceptionState(ExceptionState::ExecutionContext, "enabledPerC
ontextMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4216 if (UNLIKELY(info.Length() < 1)) { | 4277 if (UNLIKELY(info.Length() < 1)) { |
4217 throwTypeError(ExceptionMessages::failedToExecute("enabledPerContextMeth
od", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); | 4278 throwTypeError(ExceptionMessages::failedToExecute("enabledPerContextMeth
od", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), inf
o.GetIsolate()); |
4218 return; | 4279 return; |
4219 } | 4280 } |
4220 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4281 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4221 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4282 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4222 imp->enabledPerContextMethod(longArg); | 4283 imp->enabledPerContextMethod(longArg); |
4223 } | 4284 } |
4224 | 4285 |
4225 static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 4286 static void enabledPerContextMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
4226 { | 4287 { |
4227 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4288 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4228 TestObjV8Internal::enabledPerContextMethodMethod(info); | 4289 TestObjV8Internal::enabledPerContextMethodMethod(info); |
4229 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4290 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4230 } | 4291 } |
4231 | 4292 |
4232 static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) | 4293 static void methodWithUnsignedLongSequenceMethod(const v8::FunctionCallbackInfo<
v8::Value>& info) |
4233 { | 4294 { |
| 4295 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithU
nsignedLongSequence", "TestObject", info.Holder(), info.GetIsolate()); |
4234 if (UNLIKELY(info.Length() < 1)) { | 4296 if (UNLIKELY(info.Length() < 1)) { |
4235 throwTypeError(ExceptionMessages::failedToExecute("methodWithUnsignedLon
gSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); | 4297 throwTypeError(ExceptionMessages::failedToExecute("methodWithUnsignedLon
gSequence", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); |
4236 return; | 4298 return; |
4237 } | 4299 } |
4238 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4300 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4239 V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsign
ed>(info[0], 1, info.GetIsolate())); | 4301 V8TRYCATCH_VOID(Vector<unsigned>, unsignedLongSequence, toNativeArray<unsign
ed>(info[0], 1, info.GetIsolate())); |
4240 imp->methodWithUnsignedLongSequence(unsignedLongSequence); | 4302 imp->methodWithUnsignedLongSequence(unsignedLongSequence); |
4241 } | 4303 } |
4242 | 4304 |
4243 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) | 4305 static void methodWithUnsignedLongSequenceMethodCallback(const v8::FunctionCallb
ackInfo<v8::Value>& info) |
4244 { | 4306 { |
4245 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4307 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4246 TestObjV8Internal::methodWithUnsignedLongSequenceMethod(info); | 4308 TestObjV8Internal::methodWithUnsignedLongSequenceMethod(info); |
4247 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4309 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4248 } | 4310 } |
4249 | 4311 |
4250 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4312 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4251 { | 4313 { |
| 4314 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray
Function", "TestObject", info.Holder(), info.GetIsolate()); |
4252 if (UNLIKELY(info.Length() < 1)) { | 4315 if (UNLIKELY(info.Length() < 1)) { |
4253 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction",
"TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Ge
tIsolate()); | 4316 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction",
"TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Ge
tIsolate()); |
4254 return; | 4317 return; |
4255 } | 4318 } |
4256 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4319 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4257 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
4258 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in
fo.GetIsolate())); | 4320 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in
fo.GetIsolate())); |
4259 Vector<String> result = imp->stringArrayFunction(values, exceptionState); | 4321 Vector<String> result = imp->stringArrayFunction(values, exceptionState); |
4260 if (exceptionState.throwIfNeeded()) | 4322 if (exceptionState.throwIfNeeded()) |
4261 return; | 4323 return; |
4262 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); | 4324 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); |
4263 } | 4325 } |
4264 | 4326 |
4265 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 4327 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
4266 { | 4328 { |
4267 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4329 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4268 TestObjV8Internal::stringArrayFunctionMethod(info); | 4330 TestObjV8Internal::stringArrayFunctionMethod(info); |
4269 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4331 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4270 } | 4332 } |
4271 | 4333 |
4272 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 4334 static void domStringListFunctionMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) |
4273 { | 4335 { |
| 4336 ExceptionState exceptionState(ExceptionState::ExecutionContext, "domStringLi
stFunction", "TestObject", info.Holder(), info.GetIsolate()); |
4274 if (UNLIKELY(info.Length() < 1)) { | 4337 if (UNLIKELY(info.Length() < 1)) { |
4275 throwTypeError(ExceptionMessages::failedToExecute("domStringListFunction
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); | 4338 throwTypeError(ExceptionMessages::failedToExecute("domStringListFunction
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
4276 return; | 4339 return; |
4277 } | 4340 } |
4278 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4341 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4279 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
4280 V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::hasInstance(info[0]
, info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v
8::Handle<v8::Object>::Cast(info[0])) : 0); | 4342 V8TRYCATCH_VOID(DOMStringList*, values, V8DOMStringList::hasInstance(info[0]
, info.GetIsolate(), worldType(info.GetIsolate())) ? V8DOMStringList::toNative(v
8::Handle<v8::Object>::Cast(info[0])) : 0); |
4281 RefPtr<DOMStringList> result = imp->domStringListFunction(values, exceptionS
tate); | 4343 RefPtr<DOMStringList> result = imp->domStringListFunction(values, exceptionS
tate); |
4282 if (exceptionState.throwIfNeeded()) | 4344 if (exceptionState.throwIfNeeded()) |
4283 return; | 4345 return; |
4284 v8SetReturnValue(info, result.release()); | 4346 v8SetReturnValue(info, result.release()); |
4285 } | 4347 } |
4286 | 4348 |
4287 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 4349 static void domStringListFunctionMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
4288 { | 4350 { |
4289 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4351 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4290 TestObjV8Internal::domStringListFunctionMethod(info); | 4352 TestObjV8Internal::domStringListFunctionMethod(info); |
4291 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4353 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4292 } | 4354 } |
4293 | 4355 |
4294 static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) | 4356 static void getSVGDocumentMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) |
4295 { | 4357 { |
| 4358 ExceptionState exceptionState(ExceptionState::ExecutionContext, "getSVGDocum
ent", "TestObject", info.Holder(), info.GetIsolate()); |
4296 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4359 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4297 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
4298 if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(exceptionS
tate), exceptionState)) { | 4360 if (!BindingSecurity::shouldAllowAccessToNode(imp->getSVGDocument(exceptionS
tate), exceptionState)) { |
4299 v8SetReturnValueNull(info); | 4361 v8SetReturnValueNull(info); |
4300 exceptionState.throwIfNeeded(); | 4362 exceptionState.throwIfNeeded(); |
4301 return; | 4363 return; |
4302 } | 4364 } |
4303 RefPtr<SVGDocument> result = imp->getSVGDocument(exceptionState); | 4365 RefPtr<SVGDocument> result = imp->getSVGDocument(exceptionState); |
4304 if (exceptionState.throwIfNeeded()) | 4366 if (exceptionState.throwIfNeeded()) |
4305 return; | 4367 return; |
4306 v8SetReturnValue(info, result.release()); | 4368 v8SetReturnValue(info, result.release()); |
4307 } | 4369 } |
4308 | 4370 |
4309 static void getSVGDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 4371 static void getSVGDocumentMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
4310 { | 4372 { |
4311 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4373 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4312 TestObjV8Internal::getSVGDocumentMethod(info); | 4374 TestObjV8Internal::getSVGDocumentMethod(info); |
4313 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4375 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4314 } | 4376 } |
4315 | 4377 |
4316 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& info) | 4378 static void convert1Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
4317 { | 4379 { |
| 4380 ExceptionState exceptionState(ExceptionState::ExecutionContext, "convert1",
"TestObject", info.Holder(), info.GetIsolate()); |
4318 if (UNLIKELY(info.Length() < 1)) { | 4381 if (UNLIKELY(info.Length() < 1)) { |
4319 throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; | 4382 throwTypeError(ExceptionMessages::failedToExecute("convert1", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; |
4320 return; | 4383 return; |
4321 } | 4384 } |
4322 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4385 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4323 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); | 4386 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); |
4324 imp->convert1(value); | 4387 imp->convert1(value); |
4325 } | 4388 } |
4326 | 4389 |
4327 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 4390 static void convert1MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
4328 { | 4391 { |
4329 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4392 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4330 TestObjV8Internal::convert1Method(info); | 4393 TestObjV8Internal::convert1Method(info); |
4331 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4394 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4332 } | 4395 } |
4333 | 4396 |
4334 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info) | 4397 static void convert2Method(const v8::FunctionCallbackInfo<v8::Value>& info) |
4335 { | 4398 { |
| 4399 ExceptionState exceptionState(ExceptionState::ExecutionContext, "convert2",
"TestObject", info.Holder(), info.GetIsolate()); |
4336 if (UNLIKELY(info.Length() < 1)) { | 4400 if (UNLIKELY(info.Length() < 1)) { |
4337 throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; | 4401 throwTypeError(ExceptionMessages::failedToExecute("convert2", "TestObjec
t", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate())
; |
4338 return; | 4402 return; |
4339 } | 4403 } |
4340 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4404 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4341 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); | 4405 V8TRYCATCH_VOID(TestNode*, value, V8TestNode::hasInstance(info[0], info.GetI
solate(), worldType(info.GetIsolate())) ? V8TestNode::toNative(v8::Handle<v8::Ob
ject>::Cast(info[0])) : 0); |
4342 imp->convert2(value); | 4406 imp->convert2(value); |
4343 } | 4407 } |
4344 | 4408 |
4345 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 4409 static void convert2MethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
4346 { | 4410 { |
4347 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4411 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4348 TestObjV8Internal::convert2Method(info); | 4412 TestObjV8Internal::convert2Method(info); |
4349 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4413 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4350 } | 4414 } |
4351 | 4415 |
4352 static void mutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4416 static void mutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4353 { | 4417 { |
| 4418 ExceptionState exceptionState(ExceptionState::ExecutionContext, "mutablePoin
tFunction", "TestObject", info.Holder(), info.GetIsolate()); |
4354 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4419 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4355 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>mutablePointFunction()))); | 4420 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>mutablePointFunction()))); |
4356 } | 4421 } |
4357 | 4422 |
4358 static void mutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4423 static void mutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4359 { | 4424 { |
4360 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4425 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4361 TestObjV8Internal::mutablePointFunctionMethod(info); | 4426 TestObjV8Internal::mutablePointFunctionMethod(info); |
4362 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4427 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4363 } | 4428 } |
4364 | 4429 |
4365 static void immutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 4430 static void immutablePointFunctionMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
4366 { | 4431 { |
| 4432 ExceptionState exceptionState(ExceptionState::ExecutionContext, "immutablePo
intFunction", "TestObject", info.Holder(), info.GetIsolate()); |
4367 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4433 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4368 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>immutablePointFunction()))); | 4434 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>immutablePointFunction()))); |
4369 } | 4435 } |
4370 | 4436 |
4371 static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 4437 static void immutablePointFunctionMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
4372 { | 4438 { |
4373 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4439 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4374 TestObjV8Internal::immutablePointFunctionMethod(info); | 4440 TestObjV8Internal::immutablePointFunctionMethod(info); |
4375 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4441 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4376 } | 4442 } |
4377 | 4443 |
4378 static void svgPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) | 4444 static void svgPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) |
4379 { | 4445 { |
| 4446 ExceptionState exceptionState(ExceptionState::ExecutionContext, "svgPointMet
hod", "TestObject", info.Holder(), info.GetIsolate()); |
4380 if (UNLIKELY(info.Length() < 2)) { | 4447 if (UNLIKELY(info.Length() < 2)) { |
4381 throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "Tes
tObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsol
ate()); | 4448 throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "Tes
tObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.GetIsol
ate()); |
4382 return; | 4449 return; |
4383 } | 4450 } |
4384 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4451 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4385 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); | 4452 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); |
4386 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1])); | 4453 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1])); |
4387 if (!item) { | 4454 if (!item) { |
4388 throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "Tes
tObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); | 4455 throwTypeError(ExceptionMessages::failedToExecute("svgPointMethod", "Tes
tObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); |
4389 return; | 4456 return; |
4390 } | 4457 } |
4391 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>svgPointMethod(item->propertyReference(), index)))); | 4458 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(imp-
>svgPointMethod(item->propertyReference(), index)))); |
4392 } | 4459 } |
4393 | 4460 |
4394 static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 4461 static void svgPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
4395 { | 4462 { |
4396 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4463 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4397 TestObjV8Internal::svgPointMethodMethod(info); | 4464 TestObjV8Internal::svgPointMethodMethod(info); |
4398 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4465 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4399 } | 4466 } |
4400 | 4467 |
4401 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4468 static void strictSVGPointMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4402 { | 4469 { |
| 4470 ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictSVGPo
intMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4403 if (UNLIKELY(info.Length() < 2)) { | 4471 if (UNLIKELY(info.Length() < 2)) { |
4404 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G
etIsolate()); | 4472 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), info.G
etIsolate()); |
4405 return; | 4473 return; |
4406 } | 4474 } |
4407 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4475 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4408 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
4409 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::hasInst
ance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) { | 4476 if (info.Length() > 0 && !isUndefinedOrNull(info[0]) && !V8SVGPoint::hasInst
ance(info[0], info.GetIsolate(), worldType(info.GetIsolate()))) { |
4410 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod"
, "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); | 4477 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod"
, "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); |
4411 return; | 4478 return; |
4412 } | 4479 } |
4413 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); | 4480 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); |
4414 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1])); | 4481 V8TRYCATCH_VOID(unsigned, index, toUInt32(info[1])); |
4415 if (!item) { | 4482 if (!item) { |
4416 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod"
, "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); | 4483 throwTypeError(ExceptionMessages::failedToExecute("strictSVGPointMethod"
, "TestObject", "parameter 1 is not of type 'SVGPoint'."), info.GetIsolate()); |
4417 return; | 4484 return; |
4418 } | 4485 } |
4419 SVGPoint result = imp->strictSVGPointMethod(item->propertyReference(), index
, exceptionState); | 4486 SVGPoint result = imp->strictSVGPointMethod(item->propertyReference(), index
, exceptionState); |
4420 if (exceptionState.throwIfNeeded()) | 4487 if (exceptionState.throwIfNeeded()) |
4421 return; | 4488 return; |
4422 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(resu
lt))); | 4489 v8SetReturnValue(info, WTF::getPtr(SVGPropertyTearOff<SVGPoint>::create(resu
lt))); |
4423 } | 4490 } |
4424 | 4491 |
4425 static void strictSVGPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4492 static void strictSVGPointMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4426 { | 4493 { |
4427 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4494 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4428 TestObjV8Internal::strictSVGPointMethodMethod(info); | 4495 TestObjV8Internal::strictSVGPointMethodMethod(info); |
4429 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4496 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4430 } | 4497 } |
4431 | 4498 |
4432 static void orangeMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 4499 static void orangeMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
4433 { | 4500 { |
| 4501 ExceptionState exceptionState(ExceptionState::ExecutionContext, "orange", "T
estObject", info.Holder(), info.GetIsolate()); |
4434 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4502 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4435 imp->banana(); | 4503 imp->banana(); |
4436 } | 4504 } |
4437 | 4505 |
4438 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) | 4506 static void orangeMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info
) |
4439 { | 4507 { |
4440 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4508 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4441 TestObjV8Internal::orangeMethod(info); | 4509 TestObjV8Internal::orangeMethod(info); |
4442 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4510 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4443 } | 4511 } |
4444 | 4512 |
4445 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) | 4513 static void strictFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) |
4446 { | 4514 { |
| 4515 ExceptionState exceptionState(ExceptionState::ExecutionContext, "strictFunct
ion", "TestObject", info.Holder(), info.GetIsolate()); |
4447 if (UNLIKELY(info.Length() < 3)) { | 4516 if (UNLIKELY(info.Length() < 3)) { |
4448 throwTypeError(ExceptionMessages::failedToExecute("strictFunction", "Tes
tObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsol
ate()); | 4517 throwTypeError(ExceptionMessages::failedToExecute("strictFunction", "Tes
tObject", ExceptionMessages::notEnoughArguments(3, info.Length())), info.GetIsol
ate()); |
4449 return; | 4518 return; |
4450 } | 4519 } |
4451 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4520 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4452 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
4453 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); | 4521 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
4454 V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue())); | 4522 V8TRYCATCH_VOID(float, a, static_cast<float>(info[1]->NumberValue())); |
4455 V8TRYCATCH_VOID(int, b, toInt32(info[2])); | 4523 V8TRYCATCH_VOID(int, b, toInt32(info[2])); |
4456 bool result = imp->strictFunction(str, a, b, exceptionState); | 4524 bool result = imp->strictFunction(str, a, b, exceptionState); |
4457 if (exceptionState.throwIfNeeded()) | 4525 if (exceptionState.throwIfNeeded()) |
4458 return; | 4526 return; |
4459 v8SetReturnValueBool(info, result); | 4527 v8SetReturnValueBool(info, result); |
4460 } | 4528 } |
4461 | 4529 |
4462 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 4530 static void strictFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
4463 { | 4531 { |
4464 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4532 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4465 TestObjV8Internal::strictFunctionMethod(info); | 4533 TestObjV8Internal::strictFunctionMethod(info); |
4466 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4534 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4467 } | 4535 } |
4468 | 4536 |
4469 static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4537 static void variadicStringMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4470 { | 4538 { |
| 4539 ExceptionState exceptionState(ExceptionState::ExecutionContext, "variadicStr
ingMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4471 if (UNLIKELY(info.Length() < 1)) { | 4540 if (UNLIKELY(info.Length() < 1)) { |
4472 throwTypeError(ExceptionMessages::failedToExecute("variadicStringMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.G
etIsolate()); | 4541 throwTypeError(ExceptionMessages::failedToExecute("variadicStringMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.G
etIsolate()); |
4473 return; | 4542 return; |
4474 } | 4543 } |
4475 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4544 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4476 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, info[0]); | 4545 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, head, info[0]); |
4477 V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(info, 1)); | 4546 V8TRYCATCH_VOID(Vector<String>, tail, toNativeArguments<String>(info, 1)); |
4478 imp->variadicStringMethod(head, tail); | 4547 imp->variadicStringMethod(head, tail); |
4479 } | 4548 } |
4480 | 4549 |
4481 static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4550 static void variadicStringMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4482 { | 4551 { |
4483 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4552 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4484 TestObjV8Internal::variadicStringMethodMethod(info); | 4553 TestObjV8Internal::variadicStringMethodMethod(info); |
4485 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4554 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4486 } | 4555 } |
4487 | 4556 |
4488 static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 4557 static void variadicDoubleMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
4489 { | 4558 { |
| 4559 ExceptionState exceptionState(ExceptionState::ExecutionContext, "variadicDou
bleMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4490 if (UNLIKELY(info.Length() < 1)) { | 4560 if (UNLIKELY(info.Length() < 1)) { |
4491 throwTypeError(ExceptionMessages::failedToExecute("variadicDoubleMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.G
etIsolate()); | 4561 throwTypeError(ExceptionMessages::failedToExecute("variadicDoubleMethod"
, "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.G
etIsolate()); |
4492 return; | 4562 return; |
4493 } | 4563 } |
4494 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4564 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4495 V8TRYCATCH_VOID(double, head, static_cast<double>(info[0]->NumberValue())); | 4565 V8TRYCATCH_VOID(double, head, static_cast<double>(info[0]->NumberValue())); |
4496 V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(info, 1)); | 4566 V8TRYCATCH_VOID(Vector<double>, tail, toNativeArguments<double>(info, 1)); |
4497 imp->variadicDoubleMethod(head, tail); | 4567 imp->variadicDoubleMethod(head, tail); |
4498 } | 4568 } |
4499 | 4569 |
4500 static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4570 static void variadicDoubleMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4501 { | 4571 { |
4502 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4572 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4503 TestObjV8Internal::variadicDoubleMethodMethod(info); | 4573 TestObjV8Internal::variadicDoubleMethodMethod(info); |
4504 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4574 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4505 } | 4575 } |
4506 | 4576 |
4507 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 4577 static void variadicNodeMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
4508 { | 4578 { |
| 4579 ExceptionState exceptionState(ExceptionState::ExecutionContext, "variadicNod
eMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4509 if (UNLIKELY(info.Length() < 1)) { | 4580 if (UNLIKELY(info.Length() < 1)) { |
4510 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod",
"TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Get
Isolate()); | 4581 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMethod",
"TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.Get
Isolate()); |
4511 return; | 4582 return; |
4512 } | 4583 } |
4513 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4584 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4514 V8TRYCATCH_VOID(Node*, head, V8Node::hasInstance(info[0], info.GetIsolate(),
worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(i
nfo[0])) : 0); | 4585 V8TRYCATCH_VOID(Node*, head, V8Node::hasInstance(info[0], info.GetIsolate(),
worldType(info.GetIsolate())) ? V8Node::toNative(v8::Handle<v8::Object>::Cast(i
nfo[0])) : 0); |
4515 Vector<RefPtr<Node> > tail; | 4586 Vector<RefPtr<Node> > tail; |
4516 for (int i = 1; i < info.Length(); ++i) { | 4587 for (int i = 1; i < info.Length(); ++i) { |
4517 if (!V8Node::hasInstance(info[i], info.GetIsolate(), worldType(info.GetI
solate()))) { | 4588 if (!V8Node::hasInstance(info[i], info.GetIsolate(), worldType(info.GetI
solate()))) { |
4518 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMetho
d", "TestObject", "parameter 2 is not of type 'Node'."), info.GetIsolate()); | 4589 throwTypeError(ExceptionMessages::failedToExecute("variadicNodeMetho
d", "TestObject", "parameter 2 is not of type 'Node'."), info.GetIsolate()); |
4519 return; | 4590 return; |
4520 } | 4591 } |
4521 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(info[i]))); | 4592 tail.append(V8Node::toNative(v8::Handle<v8::Object>::Cast(info[i]))); |
4522 } | 4593 } |
4523 imp->variadicNodeMethod(head, tail); | 4594 imp->variadicNodeMethod(head, tail); |
4524 } | 4595 } |
4525 | 4596 |
4526 static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | 4597 static void variadicNodeMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) |
4527 { | 4598 { |
4528 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4599 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4529 TestObjV8Internal::variadicNodeMethodMethod(info); | 4600 TestObjV8Internal::variadicNodeMethodMethod(info); |
4530 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4601 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4531 } | 4602 } |
4532 | 4603 |
4533 static void methodWithNullableArgumentsMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 4604 static void methodWithNullableArgumentsMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
4534 { | 4605 { |
| 4606 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodWithN
ullableArguments", "TestObject", info.Holder(), info.GetIsolate()); |
4535 if (UNLIKELY(info.Length() < 3)) { | 4607 if (UNLIKELY(info.Length() < 3)) { |
4536 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableArg
uments", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())),
info.GetIsolate()); | 4608 throwTypeError(ExceptionMessages::failedToExecute("methodWithNullableArg
uments", "TestObject", ExceptionMessages::notEnoughArguments(3, info.Length())),
info.GetIsolate()); |
4537 return; | 4609 return; |
4538 } | 4610 } |
4539 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4611 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4540 bool strIsNull = info[0]->IsNull(); | 4612 bool strIsNull = info[0]->IsNull(); |
4541 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strStringResource,
info[0]); | 4613 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strStringResource,
info[0]); |
4542 String str = strStringResource; | 4614 String str = strStringResource; |
4543 bool lIsNull = info[1]->IsNull(); | 4615 bool lIsNull = info[1]->IsNull(); |
4544 V8TRYCATCH_VOID(int, l, toInt32(info[1])); | 4616 V8TRYCATCH_VOID(int, l, toInt32(info[1])); |
4545 V8TRYCATCH_VOID(TestObj*, obj, V8TestObject::hasInstance(info[2], info.GetIs
olate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::O
bject>::Cast(info[2])) : 0); | 4617 V8TRYCATCH_VOID(TestObj*, obj, V8TestObject::hasInstance(info[2], info.GetIs
olate(), worldType(info.GetIsolate())) ? V8TestObject::toNative(v8::Handle<v8::O
bject>::Cast(info[2])) : 0); |
4546 if (UNLIKELY(info.Length() <= 3)) { | 4618 if (UNLIKELY(info.Length() <= 3)) { |
4547 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l,
obj); | 4619 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l,
obj); |
4548 return; | 4620 return; |
4549 } | 4621 } |
4550 bool dIsNull = info[3]->IsNull(); | 4622 bool dIsNull = info[3]->IsNull(); |
4551 V8TRYCATCH_VOID(double, d, static_cast<double>(info[3]->NumberValue())); | 4623 V8TRYCATCH_VOID(double, d, static_cast<double>(info[3]->NumberValue())); |
4552 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj
, dIsNull ? 0 : &d); | 4624 imp->methodWithNullableArguments(strIsNull ? 0 : &str, lIsNull ? 0 : &l, obj
, dIsNull ? 0 : &d); |
4553 } | 4625 } |
4554 | 4626 |
4555 static void methodWithNullableArgumentsMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | 4627 static void methodWithNullableArgumentsMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) |
4556 { | 4628 { |
4557 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4629 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4558 TestObjV8Internal::methodWithNullableArgumentsMethod(info); | 4630 TestObjV8Internal::methodWithNullableArgumentsMethod(info); |
4559 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4631 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4560 } | 4632 } |
4561 | 4633 |
4562 static void perWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) | 4634 static void perWorldMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info
) |
4563 { | 4635 { |
| 4636 ExceptionState exceptionState(ExceptionState::ExecutionContext, "perWorldMet
hod", "TestObject", info.Holder(), info.GetIsolate()); |
4564 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4637 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4565 imp->perWorldMethod(); | 4638 imp->perWorldMethod(); |
4566 } | 4639 } |
4567 | 4640 |
4568 static void perWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 4641 static void perWorldMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
4569 { | 4642 { |
4570 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4643 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4571 TestObjV8Internal::perWorldMethodMethod(info); | 4644 TestObjV8Internal::perWorldMethodMethod(info); |
4572 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4645 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4573 } | 4646 } |
4574 | 4647 |
4575 static void perWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::
Value>& info) | 4648 static void perWorldMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::
Value>& info) |
4576 { | 4649 { |
| 4650 ExceptionState exceptionState(ExceptionState::ExecutionContext, "perWorldMet
hod", "TestObject", info.Holder(), info.GetIsolate()); |
4577 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4651 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4578 imp->perWorldMethod(); | 4652 imp->perWorldMethod(); |
4579 } | 4653 } |
4580 | 4654 |
4581 static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 4655 static void perWorldMethodMethodCallbackForMainWorld(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
4582 { | 4656 { |
4583 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4657 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4584 TestObjV8Internal::perWorldMethodMethodForMainWorld(info); | 4658 TestObjV8Internal::perWorldMethodMethodForMainWorld(info); |
4585 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4659 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4586 } | 4660 } |
4587 | 4661 |
4588 static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 4662 static void overloadedPerWorldMethod1Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
4589 { | 4663 { |
| 4664 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedP
erWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4590 if (UNLIKELY(info.Length() < 1)) { | 4665 if (UNLIKELY(info.Length() < 1)) { |
4591 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); | 4666 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); |
4592 return; | 4667 return; |
4593 } | 4668 } |
4594 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4669 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4595 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4670 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4596 imp->overloadedPerWorldMethod(longArg); | 4671 imp->overloadedPerWorldMethod(longArg); |
4597 } | 4672 } |
4598 | 4673 |
4599 static void overloadedPerWorldMethod1MethodForMainWorld(const v8::FunctionCallba
ckInfo<v8::Value>& info) | 4674 static void overloadedPerWorldMethod1MethodForMainWorld(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
4600 { | 4675 { |
| 4676 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedP
erWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4601 if (UNLIKELY(info.Length() < 1)) { | 4677 if (UNLIKELY(info.Length() < 1)) { |
4602 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); | 4678 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); |
4603 return; | 4679 return; |
4604 } | 4680 } |
4605 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4681 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4606 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4682 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4607 imp->overloadedPerWorldMethod(longArg); | 4683 imp->overloadedPerWorldMethod(longArg); |
4608 } | 4684 } |
4609 | 4685 |
4610 static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 4686 static void overloadedPerWorldMethod2Method(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
4611 { | 4687 { |
| 4688 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedP
erWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4612 if (UNLIKELY(info.Length() < 2)) { | 4689 if (UNLIKELY(info.Length() < 2)) { |
4613 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), in
fo.GetIsolate()); | 4690 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), in
fo.GetIsolate()); |
4614 return; | 4691 return; |
4615 } | 4692 } |
4616 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4693 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4617 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 4694 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
4618 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); | 4695 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
4619 imp->overloadedPerWorldMethod(strArg, longArg); | 4696 imp->overloadedPerWorldMethod(strArg, longArg); |
4620 } | 4697 } |
4621 | 4698 |
(...skipping 16 matching lines...) Expand all Loading... |
4638 | 4715 |
4639 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | 4716 static void overloadedPerWorldMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) |
4640 { | 4717 { |
4641 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4718 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4642 TestObjV8Internal::overloadedPerWorldMethodMethod(info); | 4719 TestObjV8Internal::overloadedPerWorldMethodMethod(info); |
4643 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4720 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4644 } | 4721 } |
4645 | 4722 |
4646 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallba
ckInfo<v8::Value>& info) | 4723 static void overloadedPerWorldMethod2MethodForMainWorld(const v8::FunctionCallba
ckInfo<v8::Value>& info) |
4647 { | 4724 { |
| 4725 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedP
erWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4648 if (UNLIKELY(info.Length() < 2)) { | 4726 if (UNLIKELY(info.Length() < 2)) { |
4649 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), in
fo.GetIsolate()); | 4727 throwTypeError(ExceptionMessages::failedToExecute("overloadedPerWorldMet
hod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length())), in
fo.GetIsolate()); |
4650 return; | 4728 return; |
4651 } | 4729 } |
4652 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4730 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4653 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 4731 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
4654 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); | 4732 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
4655 imp->overloadedPerWorldMethod(strArg, longArg); | 4733 imp->overloadedPerWorldMethod(strArg, longArg); |
4656 } | 4734 } |
4657 | 4735 |
(...skipping 16 matching lines...) Expand all Loading... |
4674 | 4752 |
4675 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::Functio
nCallbackInfo<v8::Value>& info) | 4753 static void overloadedPerWorldMethodMethodCallbackForMainWorld(const v8::Functio
nCallbackInfo<v8::Value>& info) |
4676 { | 4754 { |
4677 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4755 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4678 TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(info); | 4756 TestObjV8Internal::overloadedPerWorldMethodMethodForMainWorld(info); |
4679 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4757 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4680 } | 4758 } |
4681 | 4759 |
4682 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value
>& info) | 4760 static void activityLoggedMethod1Method(const v8::FunctionCallbackInfo<v8::Value
>& info) |
4683 { | 4761 { |
| 4762 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedMethod1", "TestObject", info.Holder(), info.GetIsolate()); |
4684 if (UNLIKELY(info.Length() < 1)) { | 4763 if (UNLIKELY(info.Length() < 1)) { |
4685 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod1
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); | 4764 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod1
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
4686 return; | 4765 return; |
4687 } | 4766 } |
4688 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4767 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4689 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4768 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4690 imp->activityLoggedMethod1(longArg); | 4769 imp->activityLoggedMethod1(longArg); |
4691 } | 4770 } |
4692 | 4771 |
4693 static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 4772 static void activityLoggedMethod1MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
4694 { | 4773 { |
4695 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4774 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4696 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 4775 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
4697 if (contextData && contextData->activityLogger()) { | 4776 if (contextData && contextData->activityLogger()) { |
4698 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 4777 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
4699 contextData->activityLogger()->log("TestObject.activityLoggedMethod1", i
nfo.Length(), loggerArgs.data(), "Method"); | 4778 contextData->activityLogger()->log("TestObject.activityLoggedMethod1", i
nfo.Length(), loggerArgs.data(), "Method"); |
4700 } | 4779 } |
4701 TestObjV8Internal::activityLoggedMethod1Method(info); | 4780 TestObjV8Internal::activityLoggedMethod1Method(info); |
4702 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4781 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4703 } | 4782 } |
4704 | 4783 |
4705 static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value
>& info) | 4784 static void activityLoggedMethod2Method(const v8::FunctionCallbackInfo<v8::Value
>& info) |
4706 { | 4785 { |
| 4786 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedMethod2", "TestObject", info.Holder(), info.GetIsolate()); |
4707 if (UNLIKELY(info.Length() < 1)) { | 4787 if (UNLIKELY(info.Length() < 1)) { |
4708 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); | 4788 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
4709 return; | 4789 return; |
4710 } | 4790 } |
4711 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4791 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4712 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4792 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4713 imp->activityLoggedMethod2(longArg); | 4793 imp->activityLoggedMethod2(longArg); |
4714 } | 4794 } |
4715 | 4795 |
4716 static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 4796 static void activityLoggedMethod2MethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) |
4717 { | 4797 { |
4718 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4798 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4719 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 4799 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
4720 if (contextData && contextData->activityLogger()) { | 4800 if (contextData && contextData->activityLogger()) { |
4721 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 4801 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
4722 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", i
nfo.Length(), loggerArgs.data(), "Method"); | 4802 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", i
nfo.Length(), loggerArgs.data(), "Method"); |
4723 } | 4803 } |
4724 TestObjV8Internal::activityLoggedMethod2Method(info); | 4804 TestObjV8Internal::activityLoggedMethod2Method(info); |
4725 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4805 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4726 } | 4806 } |
4727 | 4807 |
4728 static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackIn
fo<v8::Value>& info) | 4808 static void activityLoggedMethod2MethodForMainWorld(const v8::FunctionCallbackIn
fo<v8::Value>& info) |
4729 { | 4809 { |
| 4810 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedMethod2", "TestObject", info.Holder(), info.GetIsolate()); |
4730 if (UNLIKELY(info.Length() < 1)) { | 4811 if (UNLIKELY(info.Length() < 1)) { |
4731 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); | 4812 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedMethod2
", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); |
4732 return; | 4813 return; |
4733 } | 4814 } |
4734 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4815 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4735 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4816 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4736 imp->activityLoggedMethod2(longArg); | 4817 imp->activityLoggedMethod2(longArg); |
4737 } | 4818 } |
4738 | 4819 |
4739 static void activityLoggedMethod2MethodCallbackForMainWorld(const v8::FunctionCa
llbackInfo<v8::Value>& info) | 4820 static void activityLoggedMethod2MethodCallbackForMainWorld(const v8::FunctionCa
llbackInfo<v8::Value>& info) |
4740 { | 4821 { |
4741 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4822 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4742 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 4823 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
4743 if (contextData && contextData->activityLogger()) { | 4824 if (contextData && contextData->activityLogger()) { |
4744 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 4825 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
4745 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", i
nfo.Length(), loggerArgs.data(), "Method"); | 4826 contextData->activityLogger()->log("TestObject.activityLoggedMethod2", i
nfo.Length(), loggerArgs.data(), "Method"); |
4746 } | 4827 } |
4747 TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(info); | 4828 TestObjV8Internal::activityLoggedMethod2MethodForMainWorld(info); |
4748 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4829 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4749 } | 4830 } |
4750 | 4831 |
4751 static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallback
Info<v8::Value>& info) | 4832 static void activityLoggedInIsolatedWorldMethodMethod(const v8::FunctionCallback
Info<v8::Value>& info) |
4752 { | 4833 { |
| 4834 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedInIsolatedWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4753 if (UNLIKELY(info.Length() < 1)) { | 4835 if (UNLIKELY(info.Length() < 1)) { |
4754 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsola
tedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Len
gth())), info.GetIsolate()); | 4836 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsola
tedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Len
gth())), info.GetIsolate()); |
4755 return; | 4837 return; |
4756 } | 4838 } |
4757 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4839 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4758 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4840 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4759 imp->activityLoggedInIsolatedWorldMethod(longArg); | 4841 imp->activityLoggedInIsolatedWorldMethod(longArg); |
4760 } | 4842 } |
4761 | 4843 |
4762 static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) | 4844 static void activityLoggedInIsolatedWorldMethodMethodCallback(const v8::Function
CallbackInfo<v8::Value>& info) |
4763 { | 4845 { |
4764 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4846 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4765 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); | 4847 V8PerContextData* contextData = V8PerContextData::from(info.GetIsolate()->Ge
tCurrentContext()); |
4766 if (contextData && contextData->activityLogger()) { | 4848 if (contextData && contextData->activityLogger()) { |
4767 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 4849 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
4768 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldMethod", info.Length(), loggerArgs.data(), "Method"); | 4850 contextData->activityLogger()->log("TestObject.activityLoggedInIsolatedW
orldMethod", info.Length(), loggerArgs.data(), "Method"); |
4769 } | 4851 } |
4770 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethod(info); | 4852 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethod(info); |
4771 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4853 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4772 } | 4854 } |
4773 | 4855 |
4774 static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::Func
tionCallbackInfo<v8::Value>& info) | 4856 static void activityLoggedInIsolatedWorldMethodMethodForMainWorld(const v8::Func
tionCallbackInfo<v8::Value>& info) |
4775 { | 4857 { |
| 4858 ExceptionState exceptionState(ExceptionState::ExecutionContext, "activityLog
gedInIsolatedWorldMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4776 if (UNLIKELY(info.Length() < 1)) { | 4859 if (UNLIKELY(info.Length() < 1)) { |
4777 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsola
tedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Len
gth())), info.GetIsolate()); | 4860 throwTypeError(ExceptionMessages::failedToExecute("activityLoggedInIsola
tedWorldMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Len
gth())), info.GetIsolate()); |
4778 return; | 4861 return; |
4779 } | 4862 } |
4780 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4863 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4781 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4864 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4782 imp->activityLoggedInIsolatedWorldMethod(longArg); | 4865 imp->activityLoggedInIsolatedWorldMethod(longArg); |
4783 } | 4866 } |
4784 | 4867 |
4785 static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const
v8::FunctionCallbackInfo<v8::Value>& info) | 4868 static void activityLoggedInIsolatedWorldMethodMethodCallbackForMainWorld(const
v8::FunctionCallbackInfo<v8::Value>& info) |
4786 { | 4869 { |
4787 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4870 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4788 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(inf
o); | 4871 TestObjV8Internal::activityLoggedInIsolatedWorldMethodMethodForMainWorld(inf
o); |
4789 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4872 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4790 } | 4873 } |
4791 | 4874 |
4792 static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo
<v8::Value>& info) | 4875 static void overloadedActivityLoggedMethod1Method(const v8::FunctionCallbackInfo
<v8::Value>& info) |
4793 { | 4876 { |
| 4877 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedA
ctivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4794 if (UNLIKELY(info.Length() < 1)) { | 4878 if (UNLIKELY(info.Length() < 1)) { |
4795 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); | 4879 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); |
4796 return; | 4880 return; |
4797 } | 4881 } |
4798 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4882 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4799 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4883 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4800 imp->overloadedActivityLoggedMethod(longArg); | 4884 imp->overloadedActivityLoggedMethod(longArg); |
4801 } | 4885 } |
4802 | 4886 |
4803 static void overloadedActivityLoggedMethod1MethodForMainWorld(const v8::Function
CallbackInfo<v8::Value>& info) | 4887 static void overloadedActivityLoggedMethod1MethodForMainWorld(const v8::Function
CallbackInfo<v8::Value>& info) |
4804 { | 4888 { |
| 4889 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedA
ctivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4805 if (UNLIKELY(info.Length() < 1)) { | 4890 if (UNLIKELY(info.Length() < 1)) { |
4806 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); | 4891 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(1, info.Length()
)), info.GetIsolate()); |
4807 return; | 4892 return; |
4808 } | 4893 } |
4809 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4894 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4810 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); | 4895 V8TRYCATCH_VOID(int, longArg, toInt32(info[0])); |
4811 imp->overloadedActivityLoggedMethod(longArg); | 4896 imp->overloadedActivityLoggedMethod(longArg); |
4812 } | 4897 } |
4813 | 4898 |
4814 static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo
<v8::Value>& info) | 4899 static void overloadedActivityLoggedMethod2Method(const v8::FunctionCallbackInfo
<v8::Value>& info) |
4815 { | 4900 { |
| 4901 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedA
ctivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4816 if (UNLIKELY(info.Length() < 2)) { | 4902 if (UNLIKELY(info.Length() < 2)) { |
4817 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length()
)), info.GetIsolate()); | 4903 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length()
)), info.GetIsolate()); |
4818 return; | 4904 return; |
4819 } | 4905 } |
4820 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4906 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4821 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 4907 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
4822 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); | 4908 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
4823 imp->overloadedActivityLoggedMethod(strArg, longArg); | 4909 imp->overloadedActivityLoggedMethod(strArg, longArg); |
4824 } | 4910 } |
4825 | 4911 |
(...skipping 21 matching lines...) Expand all Loading... |
4847 if (contextData && contextData->activityLogger()) { | 4933 if (contextData && contextData->activityLogger()) { |
4848 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 4934 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
4849 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", info.Length(), loggerArgs.data(), "Method"); | 4935 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", info.Length(), loggerArgs.data(), "Method"); |
4850 } | 4936 } |
4851 TestObjV8Internal::overloadedActivityLoggedMethodMethod(info); | 4937 TestObjV8Internal::overloadedActivityLoggedMethodMethod(info); |
4852 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4938 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4853 } | 4939 } |
4854 | 4940 |
4855 static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::Function
CallbackInfo<v8::Value>& info) | 4941 static void overloadedActivityLoggedMethod2MethodForMainWorld(const v8::Function
CallbackInfo<v8::Value>& info) |
4856 { | 4942 { |
| 4943 ExceptionState exceptionState(ExceptionState::ExecutionContext, "overloadedA
ctivityLoggedMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4857 if (UNLIKELY(info.Length() < 2)) { | 4944 if (UNLIKELY(info.Length() < 2)) { |
4858 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length()
)), info.GetIsolate()); | 4945 throwTypeError(ExceptionMessages::failedToExecute("overloadedActivityLog
gedMethod", "TestObject", ExceptionMessages::notEnoughArguments(2, info.Length()
)), info.GetIsolate()); |
4859 return; | 4946 return; |
4860 } | 4947 } |
4861 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4948 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4862 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 4949 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
4863 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); | 4950 V8TRYCATCH_VOID(int, longArg, toInt32(info[1])); |
4864 imp->overloadedActivityLoggedMethod(strArg, longArg); | 4951 imp->overloadedActivityLoggedMethod(strArg, longArg); |
4865 } | 4952 } |
4866 | 4953 |
(...skipping 21 matching lines...) Expand all Loading... |
4888 if (contextData && contextData->activityLogger()) { | 4975 if (contextData && contextData->activityLogger()) { |
4889 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); | 4976 Vector<v8::Handle<v8::Value> > loggerArgs = toNativeArguments<v8::Handle
<v8::Value> >(info, 0); |
4890 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", info.Length(), loggerArgs.data(), "Method"); | 4977 contextData->activityLogger()->log("TestObject.overloadedActivityLoggedM
ethod", info.Length(), loggerArgs.data(), "Method"); |
4891 } | 4978 } |
4892 TestObjV8Internal::overloadedActivityLoggedMethodMethodForMainWorld(info); | 4979 TestObjV8Internal::overloadedActivityLoggedMethodMethodForMainWorld(info); |
4893 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4980 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4894 } | 4981 } |
4895 | 4982 |
4896 static void deprecatedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 4983 static void deprecatedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
4897 { | 4984 { |
| 4985 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecatedM
ethod", "TestObject", info.Holder(), info.GetIsolate()); |
4898 TestObj* imp = V8TestObject::toNative(info.Holder()); | 4986 TestObj* imp = V8TestObject::toNative(info.Holder()); |
4899 imp->deprecatedMethod(); | 4987 imp->deprecatedMethod(); |
4900 } | 4988 } |
4901 | 4989 |
4902 static void deprecatedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 4990 static void deprecatedMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
4903 { | 4991 { |
4904 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4992 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4905 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Method); | 4993 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::Method); |
4906 TestObjV8Internal::deprecatedMethodMethod(info); | 4994 TestObjV8Internal::deprecatedMethodMethod(info); |
4907 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4995 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4908 } | 4996 } |
4909 | 4997 |
4910 static void deprecatedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | 4998 static void deprecatedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::Valu
e>& info) |
4911 { | 4999 { |
| 5000 ExceptionState exceptionState(ExceptionState::ExecutionContext, "deprecatedS
taticMethod", "TestObject", info.Holder(), info.GetIsolate()); |
4912 TestObj::deprecatedStaticMethod(); | 5001 TestObj::deprecatedStaticMethod(); |
4913 } | 5002 } |
4914 | 5003 |
4915 static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 5004 static void deprecatedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
4916 { | 5005 { |
4917 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5006 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4918 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticMet
hod); | 5007 UseCounter::countDeprecation(activeExecutionContext(), UseCounter::StaticMet
hod); |
4919 TestObjV8Internal::deprecatedStaticMethodMethod(info); | 5008 TestObjV8Internal::deprecatedStaticMethodMethod(info); |
4920 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5009 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4921 } | 5010 } |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5407 fromInternalPointer(object)->deref(); | 5496 fromInternalPointer(object)->deref(); |
5408 } | 5497 } |
5409 | 5498 |
5410 template<> | 5499 template<> |
5411 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) | 5500 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio
nContext, v8::Isolate* isolate) |
5412 { | 5501 { |
5413 return toV8(impl, creationContext, isolate); | 5502 return toV8(impl, creationContext, isolate); |
5414 } | 5503 } |
5415 | 5504 |
5416 } // namespace WebCore | 5505 } // namespace WebCore |
OLD | NEW |