| 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 readonlyUnsignedShortAttributeAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) | 72 static void readonlyUnsignedShortAttributeAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) |
| 73 { | 73 { |
| 74 TestException* imp = V8TestException::toNative(info.Holder()); | 74 TestException* imp = V8TestException::toNative(info.Holder()); |
| 75 v8SetReturnValueUnsigned(info, imp->readonlyUnsignedShortAttribute()); | 75 v8SetReturnValueUnsigned(info, imp->readonlyUnsignedShortAttribute()); |
| 76 } | 76 } |
| 77 | 77 |
| 78 static void readonlyUnsignedShortAttributeAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 78 static void readonlyUnsignedShortAttributeAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 79 { | 79 { |
| 80 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 80 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 81 TestExceptionV8Internal::readonlyUnsignedShortAttributeAttributeGetter(info)
; | 81 TestExceptionV8Internal::readonlyUnsignedShortAttributeAttributeGetter(info)
; |
| 82 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 82 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 83 } | 83 } |
| 84 | 84 |
| 85 static void readonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) | 85 static void readonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) |
| 86 { | 86 { |
| 87 TestException* imp = V8TestException::toNative(info.Holder()); | 87 TestException* imp = V8TestException::toNative(info.Holder()); |
| 88 v8SetReturnValueString(info, imp->readonlyStringAttribute(), info.GetIsolate
()); | 88 v8SetReturnValueString(info, imp->readonlyStringAttribute(), info.GetIsolate
()); |
| 89 } | 89 } |
| 90 | 90 |
| 91 static void readonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) | 91 static void readonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) |
| 92 { | 92 { |
| 93 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 93 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 94 TestExceptionV8Internal::readonlyStringAttributeAttributeGetter(info); | 94 TestExceptionV8Internal::readonlyStringAttributeAttributeGetter(info); |
| 95 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 95 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 96 } | 96 } |
| 97 | 97 |
| 98 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 98 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
| 99 { | 99 { |
| 100 TestException* imp = V8TestException::toNative(info.Holder()); | 100 TestException* imp = V8TestException::toNative(info.Holder()); |
| 101 v8SetReturnValueString(info, imp->toString(), info.GetIsolate()); | 101 v8SetReturnValueString(info, imp->toString(), info.GetIsolate()); |
| 102 } | 102 } |
| 103 | 103 |
| 104 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 104 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
| 105 { | 105 { |
| 106 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 106 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
| 107 TestExceptionV8Internal::toStringMethod(info); | 107 TestExceptionV8Internal::toStringMethod(info); |
| 108 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 108 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 109 } | 109 } |
| 110 | 110 |
| 111 } // namespace TestExceptionV8Internal | 111 } // namespace TestExceptionV8Internal |
| 112 | 112 |
| 113 static const V8DOMConfiguration::AttributeConfiguration V8TestExceptionAttribute
s[] = { | 113 static const V8DOMConfiguration::AttributeConfiguration V8TestExceptionAttribute
s[] = { |
| 114 {"readonlyUnsignedShortAttribute", TestExceptionV8Internal::readonlyUnsigned
ShortAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance *
/}, | 114 {"readonlyUnsignedShortAttribute", TestExceptionV8Internal::readonlyUnsigned
ShortAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance *
/}, |
| 115 {"readonlyStringAttribute", TestExceptionV8Internal::readonlyStringAttribute
AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 115 {"readonlyStringAttribute", TestExceptionV8Internal::readonlyStringAttribute
AttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT)
, static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
| 116 }; | 116 }; |
| 117 | 117 |
| 118 static void configureV8TestExceptionTemplate(v8::Handle<v8::FunctionTemplate> fu
nctionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) | 118 static void configureV8TestExceptionTemplate(v8::Handle<v8::FunctionTemplate> fu
nctionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 fromInternalPointer(object)->deref(); | 189 fromInternalPointer(object)->deref(); |
| 190 } | 190 } |
| 191 | 191 |
| 192 template<> | 192 template<> |
| 193 v8::Handle<v8::Value> toV8NoInline(TestException* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) | 193 v8::Handle<v8::Value> toV8NoInline(TestException* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
| 194 { | 194 { |
| 195 return toV8(impl, creationContext, isolate); | 195 return toV8(impl, creationContext, isolate); |
| 196 } | 196 } |
| 197 | 197 |
| 198 } // namespace WebCore | 198 } // namespace WebCore |
| OLD | NEW |