| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 static void hrefAttributeGetterCallback(v8::Local<v8::String>, const v8::Propert
yCallbackInfo<v8::Value>& info) | 84 static void hrefAttributeGetterCallback(v8::Local<v8::String>, const v8::Propert
yCallbackInfo<v8::Value>& info) |
| 85 { | 85 { |
| 86 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 86 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 87 TestNodeV8Internal::hrefAttributeGetter(info); | 87 TestNodeV8Internal::hrefAttributeGetter(info); |
| 88 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 88 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 89 } | 89 } |
| 90 | 90 |
| 91 static void hrefAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Property
CallbackInfo<void>& info) | 91 static void hrefAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Property
CallbackInfo<void>& info) |
| 92 { | 92 { |
| 93 ExceptionState exceptionState(ExceptionState::SetterContext, "href", "TestNo
de", info.Holder(), info.GetIsolate()); |
| 93 TestNode* imp = V8TestNode::toNative(info.Holder()); | 94 TestNode* imp = V8TestNode::toNative(info.Holder()); |
| 94 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 95 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
| 95 imp->setHref(cppValue); | 96 imp->setHref(cppValue); |
| 96 } | 97 } |
| 97 | 98 |
| 98 static void hrefAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Val
ue> jsValue, const v8::PropertyCallbackInfo<void>& info) | 99 static void hrefAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Val
ue> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 99 { | 100 { |
| 100 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 101 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 101 TestNodeV8Internal::hrefAttributeSetter(jsValue, info); | 102 TestNodeV8Internal::hrefAttributeSetter(jsValue, info); |
| 102 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 103 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 103 } | 104 } |
| 104 | 105 |
| 105 static void hrefThrowsAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) | 106 static void hrefThrowsAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>&
info) |
| 106 { | 107 { |
| 107 TestNode* imp = V8TestNode::toNative(info.Holder()); | 108 TestNode* imp = V8TestNode::toNative(info.Holder()); |
| 108 v8SetReturnValueString(info, imp->hrefThrows(), info.GetIsolate()); | 109 v8SetReturnValueString(info, imp->hrefThrows(), info.GetIsolate()); |
| 109 } | 110 } |
| 110 | 111 |
| 111 static void hrefThrowsAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) | 112 static void hrefThrowsAttributeGetterCallback(v8::Local<v8::String>, const v8::P
ropertyCallbackInfo<v8::Value>& info) |
| 112 { | 113 { |
| 113 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 114 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 114 TestNodeV8Internal::hrefThrowsAttributeGetter(info); | 115 TestNodeV8Internal::hrefThrowsAttributeGetter(info); |
| 115 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 116 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 116 } | 117 } |
| 117 | 118 |
| 118 static void hrefThrowsAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pr
opertyCallbackInfo<void>& info) | 119 static void hrefThrowsAttributeSetter(v8::Local<v8::Value> jsValue, const v8::Pr
opertyCallbackInfo<void>& info) |
| 119 { | 120 { |
| 121 ExceptionState exceptionState(ExceptionState::SetterContext, "hrefThrows", "
TestNode", info.Holder(), info.GetIsolate()); |
| 120 TestNode* imp = V8TestNode::toNative(info.Holder()); | 122 TestNode* imp = V8TestNode::toNative(info.Holder()); |
| 121 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); | 123 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, jsValue); |
| 122 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
| 123 imp->setHrefThrows(cppValue, exceptionState); | 124 imp->setHrefThrows(cppValue, exceptionState); |
| 124 exceptionState.throwIfNeeded(); | 125 exceptionState.throwIfNeeded(); |
| 125 } | 126 } |
| 126 | 127 |
| 127 static void hrefThrowsAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 128 static void hrefThrowsAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v
8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
| 128 { | 129 { |
| 129 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 130 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
| 130 TestNodeV8Internal::hrefThrowsAttributeSetter(jsValue, info); | 131 TestNodeV8Internal::hrefThrowsAttributeSetter(jsValue, info); |
| 131 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 132 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
| 132 } | 133 } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 fromInternalPointer(object)->deref(); | 245 fromInternalPointer(object)->deref(); |
| 245 } | 246 } |
| 246 | 247 |
| 247 template<> | 248 template<> |
| 248 v8::Handle<v8::Value> toV8NoInline(TestNode* impl, v8::Handle<v8::Object> creati
onContext, v8::Isolate* isolate) | 249 v8::Handle<v8::Value> toV8NoInline(TestNode* impl, v8::Handle<v8::Object> creati
onContext, v8::Isolate* isolate) |
| 249 { | 250 { |
| 250 return toV8(impl, creationContext, isolate); | 251 return toV8(impl, creationContext, isolate); |
| 251 } | 252 } |
| 252 | 253 |
| 253 } // namespace WebCore | 254 } // namespace WebCore |
| OLD | NEW |