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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 | 63 |
64 namespace WebCore { | 64 namespace WebCore { |
65 const WrapperTypeInfo V8TestCustomAccessors::wrapperTypeInfo = { gin::kEmbedderB
link, V8TestCustomAccessors::domTemplate, V8TestCustomAccessors::derefObject, 0,
0, 0, V8TestCustomAccessors::installPerContextEnabledMethods, 0, WrapperTypeObj
ectPrototype }; | 65 const WrapperTypeInfo V8TestCustomAccessors::wrapperTypeInfo = { gin::kEmbedderB
link, V8TestCustomAccessors::domTemplate, V8TestCustomAccessors::derefObject, 0,
0, 0, V8TestCustomAccessors::installPerContextEnabledMethods, 0, WrapperTypeObj
ectPrototype }; |
66 | 66 |
67 namespace TestCustomAccessorsV8Internal { | 67 namespace TestCustomAccessorsV8Internal { |
68 | 68 |
69 template <typename T> void V8_USE(T) { } | 69 template <typename T> void V8_USE(T) { } |
70 | 70 |
71 static void anotherFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) | 71 static void anotherFunctionMethod(const v8::FunctionCallbackInfo<v8::Value>& inf
o) |
72 { | 72 { |
73 if (UNLIKELY(info.Length() < 1)) { | 73 if (info.Length() < 1) { |
74 throwTypeError(ExceptionMessages::failedToExecute("anotherFunction", "Te
stCustomAccessors", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); | 74 throwTypeError(ExceptionMessages::failedToExecute("anotherFunction", "Te
stCustomAccessors", ExceptionMessages::notEnoughArguments(1, info.Length())), in
fo.GetIsolate()); |
75 return; | 75 return; |
76 } | 76 } |
77 TestCustomAccessors* imp = V8TestCustomAccessors::toNative(info.Holder()); | 77 TestCustomAccessors* imp = V8TestCustomAccessors::toNative(info.Holder()); |
78 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); | 78 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
79 imp->anotherFunction(str); | 79 imp->anotherFunction(str); |
80 } | 80 } |
81 | 81 |
82 static void anotherFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 82 static void anotherFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
83 { | 83 { |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 fromInternalPointer(object)->deref(); | 220 fromInternalPointer(object)->deref(); |
221 } | 221 } |
222 | 222 |
223 template<> | 223 template<> |
224 v8::Handle<v8::Value> toV8NoInline(TestCustomAccessors* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) | 224 v8::Handle<v8::Value> toV8NoInline(TestCustomAccessors* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) |
225 { | 225 { |
226 return toV8(impl, creationContext, isolate); | 226 return toV8(impl, creationContext, isolate); |
227 } | 227 } |
228 | 228 |
229 } // namespace WebCore | 229 } // namespace WebCore |
OLD | NEW |