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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 static void hrefAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) | 72 static void hrefAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info) |
73 { | 73 { |
74 TestNode* imp = V8TestNode::toNative(info.Holder()); | 74 TestNode* imp = V8TestNode::toNative(info.Holder()); |
75 v8SetReturnValueString(info, imp->href(), info.GetIsolate()); | 75 v8SetReturnValueString(info, imp->href(), info.GetIsolate()); |
76 } | 76 } |
77 | 77 |
78 static void hrefAttributeGetterCallback(v8::Local<v8::String>, const v8::Propert
yCallbackInfo<v8::Value>& info) | 78 static void hrefAttributeGetterCallback(v8::Local<v8::String>, const v8::Propert
yCallbackInfo<v8::Value>& info) |
79 { | 79 { |
80 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 80 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
81 TestNodeV8Internal::hrefAttributeGetter(info); | 81 TestNodeV8Internal::hrefAttributeGetter(info); |
82 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 82 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
83 } | 83 } |
84 | 84 |
85 static void hrefAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Property
CallbackInfo<void>& info) | 85 static void hrefAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Property
CallbackInfo<void>& info) |
86 { | 86 { |
87 TestNode* imp = V8TestNode::toNative(info.Holder()); | 87 TestNode* imp = V8TestNode::toNative(info.Holder()); |
88 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 88 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
89 imp->setHref(cppValue); | 89 imp->setHref(cppValue); |
90 } | 90 } |
91 | 91 |
92 static void hrefAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Val
ue> jsValue, const v8::PropertyCallbackInfo<void>& info) | 92 static void hrefAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Val
ue> jsValue, const v8::PropertyCallbackInfo<void>& info) |
93 { | 93 { |
94 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 94 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
95 TestNodeV8Internal::hrefAttributeSetter(jsValue, info); | 95 TestNodeV8Internal::hrefAttributeSetter(jsValue, info); |
96 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 96 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
97 } | 97 } |
98 | 98 |
99 static void hrefThrowsAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) | 99 static void hrefThrowsAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) |
100 { | 100 { |
101 TestNode* imp = V8TestNode::toNative(info.Holder()); | 101 TestNode* imp = V8TestNode::toNative(info.Holder()); |
102 v8SetReturnValueString(info, imp->hrefThrows(), info.GetIsolate()); | 102 v8SetReturnValueString(info, imp->hrefThrows(), info.GetIsolate()); |
103 } | 103 } |
104 | 104 |
105 static void hrefThrowsAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) | 105 static void hrefThrowsAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) |
106 { | 106 { |
107 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 107 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
108 TestNodeV8Internal::hrefThrowsAttributeGetter(info); | 108 TestNodeV8Internal::hrefThrowsAttributeGetter(info); |
109 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 109 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
110 } | 110 } |
111 | 111 |
112 static void hrefThrowsAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pr
opertyCallbackInfo<void>& info) | 112 static void hrefThrowsAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pr
opertyCallbackInfo<void>& info) |
113 { | 113 { |
114 ExceptionState exceptionState(ExceptionState::SetterContext, "hrefThrows", "
TestNode", info.Holder(), info.GetIsolate()); | 114 ExceptionState exceptionState(ExceptionState::SetterContext, "hrefThrows", "
TestNode", info.Holder(), info.GetIsolate()); |
115 TestNode* imp = V8TestNode::toNative(info.Holder()); | 115 TestNode* imp = V8TestNode::toNative(info.Holder()); |
116 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 116 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
117 imp->setHrefThrows(cppValue, exceptionState); | 117 imp->setHrefThrows(cppValue, exceptionState); |
118 exceptionState.throwIfNeeded(); | 118 exceptionState.throwIfNeeded(); |
119 } | 119 } |
120 | 120 |
121 static void hrefThrowsAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 121 static void hrefThrowsAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
122 { | 122 { |
123 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 123 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
124 TestNodeV8Internal::hrefThrowsAttributeSetter(jsValue, info); | 124 TestNodeV8Internal::hrefThrowsAttributeSetter(jsValue, info); |
125 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 125 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
126 } | 126 } |
127 | 127 |
128 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) | 128 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
129 { | 129 { |
130 RefPtr<TestNode> impl = TestNode::create(); | 130 RefPtr<TestNode> impl = TestNode::create(); |
131 v8::Handle<v8::Object> wrapper = info.Holder(); | 131 v8::Handle<v8::Object> wrapper = info.Holder(); |
132 | 132 |
133 V8DOMWrapper::associateObjectWithWrapper<V8TestNode>(impl.release(), &V8Test
Node::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Depende
nt); | 133 V8DOMWrapper::associateObjectWithWrapper<V8TestNode>(impl.release(), &V8Test
Node::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Depende
nt); |
134 v8SetReturnValue(info, wrapper); | 134 v8SetReturnValue(info, wrapper); |
135 } | 135 } |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 fromInternalPointer(object)->deref(); | 233 fromInternalPointer(object)->deref(); |
234 } | 234 } |
235 | 235 |
236 template<> | 236 template<> |
237 v8::Handle<v8::Value> toV8NoInline(TestNode* impl, v8::Handle<v8::Object> creati
onContext, v8::Isolate* isolate) | 237 v8::Handle<v8::Value> toV8NoInline(TestNode* impl, v8::Handle<v8::Object> creati
onContext, v8::Isolate* isolate) |
238 { | 238 { |
239 return toV8(impl, creationContext, isolate); | 239 return toV8(impl, creationContext, isolate); |
240 } | 240 } |
241 | 241 |
242 } // namespace WebCore | 242 } // namespace WebCore |
OLD | NEW |