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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 static void readOnlyStringAttrAttributeGetterCallback(v8::Local<v8::String>, con
st v8::PropertyCallbackInfo<v8::Value>& info) | 118 static void readOnlyStringAttrAttributeGetterCallback(v8::Local<v8::String>, con
st v8::PropertyCallbackInfo<v8::Value>& info) |
119 { | 119 { |
120 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 120 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
121 TestObjectV8Internal::readOnlyStringAttrAttributeGetter(info); | 121 TestObjectV8Internal::readOnlyStringAttrAttributeGetter(info); |
122 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 122 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
123 } | 123 } |
124 | 124 |
125 static void readOnlyTestObjectAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) | 125 static void readOnlyTestObjectAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) |
126 { | 126 { |
127 TestObject* imp = V8TestObject::toNative(info.Holder()); | 127 TestObject* imp = V8TestObject::toNative(info.Holder()); |
128 RefPtr<TestObject> result = imp->readOnlyTestObjectAttr(); | 128 RefPtr<TestObject> result(imp->readOnlyTestObjectAttr()); |
129 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.Get
ReturnValue(), result.get())) | 129 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.Get
ReturnValue(), result.get())) |
130 return; | 130 return; |
131 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); | 131 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); |
132 if (!wrapper.IsEmpty()) { | 132 if (!wrapper.IsEmpty()) { |
133 setHiddenValue(info.GetIsolate(), info.Holder(), "readOnlyTestObjectAttr
", wrapper); | 133 setHiddenValue(info.GetIsolate(), info.Holder(), "readOnlyTestObjectAttr
", wrapper); |
134 v8SetReturnValue(info, wrapper); | 134 v8SetReturnValue(info, wrapper); |
135 } | 135 } |
136 } | 136 } |
137 | 137 |
138 static void readOnlyTestObjectAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 138 static void readOnlyTestObjectAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
(...skipping 2298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2437 static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) | 2437 static void nullableLongSettableAttributeAttributeSetterCallback(v8::Local<v8::S
tring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info
) |
2438 { | 2438 { |
2439 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2439 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2440 TestObjectV8Internal::nullableLongSettableAttributeAttributeSetter(jsValue,
info); | 2440 TestObjectV8Internal::nullableLongSettableAttributeAttributeSetter(jsValue,
info); |
2441 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 2441 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2442 } | 2442 } |
2443 | 2443 |
2444 static void perWorldReadOnlyAttributeAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) | 2444 static void perWorldReadOnlyAttributeAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) |
2445 { | 2445 { |
2446 TestObject* imp = V8TestObject::toNative(info.Holder()); | 2446 TestObject* imp = V8TestObject::toNative(info.Holder()); |
2447 RefPtr<TestObject> result = imp->perWorldReadOnlyAttribute(); | 2447 RefPtr<TestObject> result(imp->perWorldReadOnlyAttribute()); |
2448 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.Get
ReturnValue(), result.get())) | 2448 if (result && DOMDataStore::setReturnValueFromWrapper<V8TestObject>(info.Get
ReturnValue(), result.get())) |
2449 return; | 2449 return; |
2450 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); | 2450 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); |
2451 if (!wrapper.IsEmpty()) { | 2451 if (!wrapper.IsEmpty()) { |
2452 setHiddenValue(info.GetIsolate(), info.Holder(), "perWorldReadOnlyAttrib
ute", wrapper); | 2452 setHiddenValue(info.GetIsolate(), info.Holder(), "perWorldReadOnlyAttrib
ute", wrapper); |
2453 v8SetReturnValue(info, wrapper); | 2453 v8SetReturnValue(info, wrapper); |
2454 } | 2454 } |
2455 } | 2455 } |
2456 | 2456 |
2457 static void perWorldReadOnlyAttributeAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2457 static void perWorldReadOnlyAttributeAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2458 { | 2458 { |
2459 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2459 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2460 TestObjectV8Internal::perWorldReadOnlyAttributeAttributeGetter(info); | 2460 TestObjectV8Internal::perWorldReadOnlyAttributeAttributeGetter(info); |
2461 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 2461 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
2462 } | 2462 } |
2463 | 2463 |
2464 static void perWorldReadOnlyAttributeAttributeGetterForMainWorld(const v8::Prope
rtyCallbackInfo<v8::Value>& info) | 2464 static void perWorldReadOnlyAttributeAttributeGetterForMainWorld(const v8::Prope
rtyCallbackInfo<v8::Value>& info) |
2465 { | 2465 { |
2466 TestObject* imp = V8TestObject::toNative(info.Holder()); | 2466 TestObject* imp = V8TestObject::toNative(info.Holder()); |
2467 RefPtr<TestObject> result = imp->perWorldReadOnlyAttribute(); | 2467 RefPtr<TestObject> result(imp->perWorldReadOnlyAttribute()); |
2468 if (result && DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestObje
ct>(info.GetReturnValue(), result.get())) | 2468 if (result && DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestObje
ct>(info.GetReturnValue(), result.get())) |
2469 return; | 2469 return; |
2470 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); | 2470 v8::Handle<v8::Value> wrapper = toV8(result.get(), info.Holder(), info.GetIs
olate()); |
2471 if (!wrapper.IsEmpty()) { | 2471 if (!wrapper.IsEmpty()) { |
2472 setHiddenValue(info.GetIsolate(), info.Holder(), "perWorldReadOnlyAttrib
ute", wrapper); | 2472 setHiddenValue(info.GetIsolate(), info.Holder(), "perWorldReadOnlyAttrib
ute", wrapper); |
2473 v8SetReturnValue(info, wrapper); | 2473 v8SetReturnValue(info, wrapper); |
2474 } | 2474 } |
2475 } | 2475 } |
2476 | 2476 |
2477 static void perWorldReadOnlyAttributeAttributeGetterCallbackForMainWorld(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2477 static void perWorldReadOnlyAttributeAttributeGetterCallbackForMainWorld(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3113 static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::Pro
pertyCallbackInfo<v8::Value>& info) | 3113 static void locationAttributeGetterCallback(v8::Local<v8::String>, const v8::Pro
pertyCallbackInfo<v8::Value>& info) |
3114 { | 3114 { |
3115 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 3115 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
3116 TestObjectV8Internal::locationAttributeGetter(info); | 3116 TestObjectV8Internal::locationAttributeGetter(info); |
3117 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 3117 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3118 } | 3118 } |
3119 | 3119 |
3120 static void locationAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Prop
ertyCallbackInfo<void>& info) | 3120 static void locationAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Prop
ertyCallbackInfo<void>& info) |
3121 { | 3121 { |
3122 TestObject* proxyImp = V8TestObject::toNative(info.Holder()); | 3122 TestObject* proxyImp = V8TestObject::toNative(info.Holder()); |
3123 TestNode* imp = proxyImp->location(); | 3123 TestNode* imp = WTF::getPtr(proxyImp->location()); |
3124 if (!imp) | 3124 if (!imp) |
3125 return; | 3125 return; |
3126 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 3126 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
3127 imp->setHref(cppValue); | 3127 imp->setHref(cppValue); |
3128 } | 3128 } |
3129 | 3129 |
3130 static void locationAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 3130 static void locationAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8:
:Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
3131 { | 3131 { |
3132 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 3132 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
3133 TestObjectV8Internal::locationAttributeSetter(jsValue, info); | 3133 TestObjectV8Internal::locationAttributeSetter(jsValue, info); |
3134 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 3134 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3135 } | 3135 } |
3136 | 3136 |
3137 static void locationWithExceptionAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) | 3137 static void locationWithExceptionAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) |
3138 { | 3138 { |
3139 TestObject* imp = V8TestObject::toNative(info.Holder()); | 3139 TestObject* imp = V8TestObject::toNative(info.Holder()); |
3140 v8SetReturnValueFast(info, WTF::getPtr(imp->locationWithException()), imp); | 3140 v8SetReturnValueFast(info, WTF::getPtr(imp->locationWithException()), imp); |
3141 } | 3141 } |
3142 | 3142 |
3143 static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | 3143 static void locationWithExceptionAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
3144 { | 3144 { |
3145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 3145 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
3146 TestObjectV8Internal::locationWithExceptionAttributeGetter(info); | 3146 TestObjectV8Internal::locationWithExceptionAttributeGetter(info); |
3147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 3147 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
3148 } | 3148 } |
3149 | 3149 |
3150 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) | 3150 static void locationWithExceptionAttributeSetter(v8::Local<v8::Value> jsValue, c
onst v8::PropertyCallbackInfo<void>& info) |
3151 { | 3151 { |
3152 TestObject* proxyImp = V8TestObject::toNative(info.Holder()); | 3152 TestObject* proxyImp = V8TestObject::toNative(info.Holder()); |
3153 TestNode* imp = proxyImp->locationWithException(); | 3153 TestNode* imp = WTF::getPtr(proxyImp->locationWithException()); |
3154 if (!imp) | 3154 if (!imp) |
3155 return; | 3155 return; |
3156 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 3156 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
3157 imp->setHrefThrows(cppValue); | 3157 imp->setHrefThrows(cppValue); |
3158 } | 3158 } |
3159 | 3159 |
3160 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 3160 static void locationWithExceptionAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
3161 { | 3161 { |
3162 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 3162 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
3163 TestObjectV8Internal::locationWithExceptionAttributeSetter(jsValue, info); | 3163 TestObjectV8Internal::locationWithExceptionAttributeSetter(jsValue, info); |
(...skipping 2447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5611 fromInternalPointer(object)->deref(); | 5611 fromInternalPointer(object)->deref(); |
5612 } | 5612 } |
5613 | 5613 |
5614 template<> | 5614 template<> |
5615 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> crea
tionContext, v8::Isolate* isolate) | 5615 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> crea
tionContext, v8::Isolate* isolate) |
5616 { | 5616 { |
5617 return toV8(impl, creationContext, isolate); | 5617 return toV8(impl, creationContext, isolate); |
5618 } | 5618 } |
5619 | 5619 |
5620 } // namespace WebCore | 5620 } // namespace WebCore |
OLD | NEW |