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 4299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4310 | 4310 |
4311 static void voidMethodPromiseArgMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 4311 static void voidMethodPromiseArgMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
4312 { | 4312 { |
4313 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4313 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4314 TestObjectPythonV8Internal::voidMethodPromiseArgMethod(info); | 4314 TestObjectPythonV8Internal::voidMethodPromiseArgMethod(info); |
4315 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4315 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4316 } | 4316 } |
4317 | 4317 |
4318 static void voidMethodSerializedScriptValueArgMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 4318 static void voidMethodSerializedScriptValueArgMethod(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
4319 { | 4319 { |
| 4320 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodS
erializedScriptValueArg", "TestObjectPython", info.Holder(), info.GetIsolate()); |
4320 if (UNLIKELY(info.Length() < 1)) { | 4321 if (UNLIKELY(info.Length() < 1)) { |
4321 throwTypeError(ExceptionMessages::failedToExecute("voidMethodSerializedS
criptValueArg", "TestObjectPython", ExceptionMessages::notEnoughArguments(1, inf
o.Length())), info.GetIsolate()); | 4322 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 4323 exceptionState.throwIfNeeded(); |
4322 return; | 4324 return; |
4323 } | 4325 } |
4324 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 4326 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
4325 bool serializedScriptValueArgDidThrow = false; | 4327 RefPtr<SerializedScriptValue> serializedScriptValueArg = SerializedScriptVal
ue::create(info[0], 0, 0, exceptionState, info.GetIsolate()); |
4326 RefPtr<SerializedScriptValue> serializedScriptValueArg = SerializedScriptVal
ue::create(info[0], 0, 0, serializedScriptValueArgDidThrow, info.GetIsolate()); | 4328 if (exceptionState.throwIfNeeded()) |
4327 if (serializedScriptValueArgDidThrow) | |
4328 return; | 4329 return; |
4329 imp->voidMethodSerializedScriptValueArg(serializedScriptValueArg); | 4330 imp->voidMethodSerializedScriptValueArg(serializedScriptValueArg); |
4330 } | 4331 } |
4331 | 4332 |
4332 static void voidMethodSerializedScriptValueArgMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) | 4333 static void voidMethodSerializedScriptValueArgMethodCallback(const v8::FunctionC
allbackInfo<v8::Value>& info) |
4333 { | 4334 { |
4334 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 4335 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
4335 TestObjectPythonV8Internal::voidMethodSerializedScriptValueArgMethod(info); | 4336 TestObjectPythonV8Internal::voidMethodSerializedScriptValueArgMethod(info); |
4336 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 4337 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
4337 } | 4338 } |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5011 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strictTypeCheckingS
tringArg, info[0]); | 5012 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strictTypeCheckingS
tringArg, info[0]); |
5012 imp->overloadedMethodG(strictTypeCheckingStringArg); | 5013 imp->overloadedMethodG(strictTypeCheckingStringArg); |
5013 } | 5014 } |
5014 | 5015 |
5015 static void overloadedMethodGMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 5016 static void overloadedMethodGMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
5016 { | 5017 { |
5017 if (((info.Length() == 0))) { | 5018 if (((info.Length() == 0))) { |
5018 overloadedMethodG1Method(info); | 5019 overloadedMethodG1Method(info); |
5019 return; | 5020 return; |
5020 } | 5021 } |
5021 if (((info.Length() == 1) && (info[0]->IsNull() || info[0]->IsUndefined() ||
info[0]->IsString() || info[0]->IsObject()))) { | 5022 if (((info.Length() == 1) && (isUndefinedOrNull(info[0]) || info[0]->IsStrin
g() || info[0]->IsObject()))) { |
5022 overloadedMethodG2Method(info); | 5023 overloadedMethodG2Method(info); |
5023 return; | 5024 return; |
5024 } | 5025 } |
5025 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodG", "Test
ObjectPython", "No function was found that matched the signature provided."), in
fo.GetIsolate()); | 5026 throwTypeError(ExceptionMessages::failedToExecute("overloadedMethodG", "Test
ObjectPython", "No function was found that matched the signature provided."), in
fo.GetIsolate()); |
5026 } | 5027 } |
5027 | 5028 |
5028 static void overloadedMethodGMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 5029 static void overloadedMethodGMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
5029 { | 5030 { |
5030 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5031 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
5031 TestObjectPythonV8Internal::overloadedMethodGMethod(info); | 5032 TestObjectPythonV8Internal::overloadedMethodGMethod(info); |
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6552 fromInternalPointer(object)->deref(); | 6553 fromInternalPointer(object)->deref(); |
6553 } | 6554 } |
6554 | 6555 |
6555 template<> | 6556 template<> |
6556 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) | 6557 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) |
6557 { | 6558 { |
6558 return toV8(impl, creationContext, isolate); | 6559 return toV8(impl, creationContext, isolate); |
6559 } | 6560 } |
6560 | 6561 |
6561 } // namespace WebCore | 6562 } // namespace WebCore |
OLD | NEW |