| 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 3074 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3085 imp->optionsObject(oo, ooo); | 3085 imp->optionsObject(oo, ooo); |
| 3086 } | 3086 } |
| 3087 | 3087 |
| 3088 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value
>& info) | 3088 static void optionsObjectMethodCallback(const v8::FunctionCallbackInfo<v8::Value
>& info) |
| 3089 { | 3089 { |
| 3090 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 3090 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3091 TestObjV8Internal::optionsObjectMethod(info); | 3091 TestObjV8Internal::optionsObjectMethod(info); |
| 3092 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 3092 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3093 } | 3093 } |
| 3094 | 3094 |
| 3095 static void optionsObjectListMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
| 3096 { |
| 3097 if (UNLIKELY(info.Length() < 1)) { |
| 3098 throwTypeError(ExceptionMessages::failedToExecute("optionsObjectList", "
TestObject", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetI
solate()); |
| 3099 return; |
| 3100 } |
| 3101 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3102 V8TRYCATCH_VOID(Vector<Dictionary>, list, toNativeArray<Dictionary>(info[0],
1, info.GetIsolate())); |
| 3103 imp->optionsObjectList(list); |
| 3104 } |
| 3105 |
| 3106 static void optionsObjectListMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
| 3107 { |
| 3108 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 3109 TestObjV8Internal::optionsObjectListMethod(info); |
| 3110 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 3111 } |
| 3112 |
| 3095 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 3113 static void methodWithExceptionMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
| 3096 { | 3114 { |
| 3097 TestObj* imp = V8TestObject::toNative(info.Holder()); | 3115 TestObj* imp = V8TestObject::toNative(info.Holder()); |
| 3098 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 3116 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); |
| 3099 imp->methodWithException(exceptionState); | 3117 imp->methodWithException(exceptionState); |
| 3100 if (exceptionState.throwIfNeeded()) | 3118 if (exceptionState.throwIfNeeded()) |
| 3101 return; | 3119 return; |
| 3102 } | 3120 } |
| 3103 | 3121 |
| 3104 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 3122 static void methodWithExceptionMethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
| (...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5047 | 5065 |
| 5048 static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = { | 5066 static const V8DOMConfiguration::MethodConfiguration V8TestObjectMethods[] = { |
| 5049 {"voidMethod", TestObjV8Internal::voidMethodMethodCallback, 0, 0}, | 5067 {"voidMethod", TestObjV8Internal::voidMethodMethodCallback, 0, 0}, |
| 5050 {"longMethod", TestObjV8Internal::longMethodMethodCallback, 0, 0}, | 5068 {"longMethod", TestObjV8Internal::longMethodMethodCallback, 0, 0}, |
| 5051 {"objMethod", TestObjV8Internal::objMethodMethodCallback, 0, 0}, | 5069 {"objMethod", TestObjV8Internal::objMethodMethodCallback, 0, 0}, |
| 5052 {"methodWithSequenceArg", TestObjV8Internal::methodWithSequenceArgMethodCall
back, 0, 1}, | 5070 {"methodWithSequenceArg", TestObjV8Internal::methodWithSequenceArgMethodCall
back, 0, 1}, |
| 5053 {"methodReturningSequence", TestObjV8Internal::methodReturningSequenceMethod
Callback, 0, 1}, | 5071 {"methodReturningSequence", TestObjV8Internal::methodReturningSequenceMethod
Callback, 0, 1}, |
| 5054 {"methodWithEnumArg", TestObjV8Internal::methodWithEnumArgMethodCallback, 0,
1}, | 5072 {"methodWithEnumArg", TestObjV8Internal::methodWithEnumArgMethodCallback, 0,
1}, |
| 5055 {"serializedValue", TestObjV8Internal::serializedValueMethodCallback, 0, 1}, | 5073 {"serializedValue", TestObjV8Internal::serializedValueMethodCallback, 0, 1}, |
| 5056 {"optionsObject", TestObjV8Internal::optionsObjectMethodCallback, 0, 1}, | 5074 {"optionsObject", TestObjV8Internal::optionsObjectMethodCallback, 0, 1}, |
| 5075 {"optionsObjectList", TestObjV8Internal::optionsObjectListMethodCallback, 0,
1}, |
| 5057 {"methodWithException", TestObjV8Internal::methodWithExceptionMethodCallback
, 0, 0}, | 5076 {"methodWithException", TestObjV8Internal::methodWithExceptionMethodCallback
, 0, 0}, |
| 5058 {"customMethod", TestObjV8Internal::customMethodMethodCallback, 0, 0}, | 5077 {"customMethod", TestObjV8Internal::customMethodMethodCallback, 0, 0}, |
| 5059 {"customMethodWithArgs", TestObjV8Internal::customMethodWithArgsMethodCallba
ck, 0, 3}, | 5078 {"customMethodWithArgs", TestObjV8Internal::customMethodWithArgsMethodCallba
ck, 0, 3}, |
| 5060 {"addEventListener", TestObjV8Internal::addEventListenerMethodCallback, 0, 2
}, | 5079 {"addEventListener", TestObjV8Internal::addEventListenerMethodCallback, 0, 2
}, |
| 5061 {"removeEventListener", TestObjV8Internal::removeEventListenerMethodCallback
, 0, 2}, | 5080 {"removeEventListener", TestObjV8Internal::removeEventListenerMethodCallback
, 0, 2}, |
| 5062 {"withScriptStateVoid", TestObjV8Internal::withScriptStateVoidMethodCallback
, 0, 0}, | 5081 {"withScriptStateVoid", TestObjV8Internal::withScriptStateVoidMethodCallback
, 0, 0}, |
| 5063 {"withScriptStateObj", TestObjV8Internal::withScriptStateObjMethodCallback,
0, 0}, | 5082 {"withScriptStateObj", TestObjV8Internal::withScriptStateObjMethodCallback,
0, 0}, |
| 5064 {"withScriptStateVoidException", TestObjV8Internal::withScriptStateVoidExcep
tionMethodCallback, 0, 0}, | 5083 {"withScriptStateVoidException", TestObjV8Internal::withScriptStateVoidExcep
tionMethodCallback, 0, 0}, |
| 5065 {"withScriptStateObjException", TestObjV8Internal::withScriptStateObjExcepti
onMethodCallback, 0, 0}, | 5084 {"withScriptStateObjException", TestObjV8Internal::withScriptStateObjExcepti
onMethodCallback, 0, 0}, |
| 5066 {"withExecutionContext", TestObjV8Internal::withExecutionContextMethodCallba
ck, 0, 0}, | 5085 {"withExecutionContext", TestObjV8Internal::withExecutionContextMethodCallba
ck, 0, 0}, |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5311 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf
o, wrapper, isolate, WrapperConfiguration::Independent); | 5330 V8DOMWrapper::associateObjectWithWrapper<V8TestObject>(impl, &wrapperTypeInf
o, wrapper, isolate, WrapperConfiguration::Independent); |
| 5312 return wrapper; | 5331 return wrapper; |
| 5313 } | 5332 } |
| 5314 | 5333 |
| 5315 void V8TestObject::derefObject(void* object) | 5334 void V8TestObject::derefObject(void* object) |
| 5316 { | 5335 { |
| 5317 fromInternalPointer(object)->deref(); | 5336 fromInternalPointer(object)->deref(); |
| 5318 } | 5337 } |
| 5319 | 5338 |
| 5320 } // namespace WebCore | 5339 } // namespace WebCore |
| OLD | NEW |