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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 { | 366 { |
367 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 367 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
368 TestTypedefsV8Internal::immutablePointFunctionMethod(info); | 368 TestTypedefsV8Internal::immutablePointFunctionMethod(info); |
369 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 369 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
370 } | 370 } |
371 | 371 |
372 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 372 static void stringArrayFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
373 { | 373 { |
374 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray
Function", "TestTypedefs", info.Holder(), info.GetIsolate()); | 374 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray
Function", "TestTypedefs", info.Holder(), info.GetIsolate()); |
375 if (UNLIKELY(info.Length() < 1)) { | 375 if (UNLIKELY(info.Length() < 1)) { |
376 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction",
"TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())), info.
GetIsolate()); | 376 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 377 exceptionState.throwIfNeeded(); |
377 return; | 378 return; |
378 } | 379 } |
379 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); | 380 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); |
380 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in
fo.GetIsolate())); | 381 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in
fo.GetIsolate())); |
381 Vector<String> result = imp->stringArrayFunction(values, exceptionState); | 382 Vector<String> result = imp->stringArrayFunction(values, exceptionState); |
382 if (exceptionState.throwIfNeeded()) | 383 if (exceptionState.throwIfNeeded()) |
383 return; | 384 return; |
384 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); | 385 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); |
385 } | 386 } |
386 | 387 |
387 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 388 static void stringArrayFunctionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
388 { | 389 { |
389 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 390 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
390 TestTypedefsV8Internal::stringArrayFunctionMethod(info); | 391 TestTypedefsV8Internal::stringArrayFunctionMethod(info); |
391 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 392 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
392 } | 393 } |
393 | 394 |
394 static void stringArrayFunction2Method(const v8::FunctionCallbackInfo<v8::Value>
& info) | 395 static void stringArrayFunction2Method(const v8::FunctionCallbackInfo<v8::Value>
& info) |
395 { | 396 { |
396 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray
Function2", "TestTypedefs", info.Holder(), info.GetIsolate()); | 397 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringArray
Function2", "TestTypedefs", info.Holder(), info.GetIsolate()); |
397 if (UNLIKELY(info.Length() < 1)) { | 398 if (UNLIKELY(info.Length() < 1)) { |
398 throwTypeError(ExceptionMessages::failedToExecute("stringArrayFunction2"
, "TestTypedefs", ExceptionMessages::notEnoughArguments(1, info.Length())), info
.GetIsolate()); | 399 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
| 400 exceptionState.throwIfNeeded(); |
399 return; | 401 return; |
400 } | 402 } |
401 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); | 403 TestTypedefs* imp = V8TestTypedefs::toNative(info.Holder()); |
402 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in
fo.GetIsolate())); | 404 V8TRYCATCH_VOID(Vector<String>, values, toNativeArray<String>(info[0], 1, in
fo.GetIsolate())); |
403 Vector<String> result = imp->stringArrayFunction2(values, exceptionState); | 405 Vector<String> result = imp->stringArrayFunction2(values, exceptionState); |
404 if (exceptionState.throwIfNeeded()) | 406 if (exceptionState.throwIfNeeded()) |
405 return; | 407 return; |
406 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); | 408 v8SetReturnValue(info, v8Array(result, info.GetIsolate())); |
407 } | 409 } |
408 | 410 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 fromInternalPointer(object)->deref(); | 564 fromInternalPointer(object)->deref(); |
563 } | 565 } |
564 | 566 |
565 template<> | 567 template<> |
566 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) | 568 v8::Handle<v8::Value> toV8NoInline(TestTypedefs* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate* isolate) |
567 { | 569 { |
568 return toV8(impl, creationContext, isolate); | 570 return toV8(impl, creationContext, isolate); |
569 } | 571 } |
570 | 572 |
571 } // namespace WebCore | 573 } // namespace WebCore |
OLD | NEW |