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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 } | 77 } |
78 TestCustomAccessors* imp = V8TestCustomAccessors::toNative(info.Holder()); | 78 TestCustomAccessors* imp = V8TestCustomAccessors::toNative(info.Holder()); |
79 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); | 79 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str, info[0]); |
80 imp->anotherFunction(str); | 80 imp->anotherFunction(str); |
81 } | 81 } |
82 | 82 |
83 static void anotherFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 83 static void anotherFunctionMethodCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
84 { | 84 { |
85 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 85 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
86 TestCustomAccessorsV8Internal::anotherFunctionMethod(info); | 86 TestCustomAccessorsV8Internal::anotherFunctionMethod(info); |
87 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 87 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
88 } | 88 } |
89 | 89 |
90 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) | 90 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) |
91 { | 91 { |
92 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 92 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
93 V8TestCustomAccessors::indexedPropertyGetterCustom(index, info); | 93 V8TestCustomAccessors::indexedPropertyGetterCustom(index, info); |
94 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 94 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
95 } | 95 } |
96 | 96 |
97 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> j
sValue, const v8::PropertyCallbackInfo<v8::Value>& info) | 97 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> j
sValue, const v8::PropertyCallbackInfo<v8::Value>& info) |
98 { | 98 { |
99 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 99 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
100 V8TestCustomAccessors::indexedPropertySetterCustom(index, jsValue, info); | 100 V8TestCustomAccessors::indexedPropertySetterCustom(index, jsValue, info); |
101 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 101 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
102 } | 102 } |
103 | 103 |
104 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | 104 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) |
105 { | 105 { |
106 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | 106 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); |
107 V8TestCustomAccessors::indexedPropertyDeleterCustom(index, info); | 107 V8TestCustomAccessors::indexedPropertyDeleterCustom(index, info); |
108 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 108 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
109 } | 109 } |
110 | 110 |
111 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 111 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
112 { | 112 { |
113 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 113 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
114 V8TestCustomAccessors::namedPropertyGetterCustom(name, info); | 114 V8TestCustomAccessors::namedPropertyGetterCustom(name, info); |
115 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 115 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
116 } | 116 } |
117 | 117 |
118 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8
::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info) | 118 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8
::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info) |
119 { | 119 { |
120 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 120 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
121 V8TestCustomAccessors::namedPropertySetterCustom(name, jsValue, info); | 121 V8TestCustomAccessors::namedPropertySetterCustom(name, jsValue, info); |
122 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 122 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
123 } | 123 } |
124 | 124 |
125 static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::P
ropertyCallbackInfo<v8::Boolean>& info) | 125 static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::P
ropertyCallbackInfo<v8::Boolean>& info) |
126 { | 126 { |
127 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 127 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
128 V8TestCustomAccessors::namedPropertyDeleterCustom(name, info); | 128 V8TestCustomAccessors::namedPropertyDeleterCustom(name, info); |
129 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 129 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
130 } | 130 } |
131 | 131 |
132 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) | 132 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) |
133 { | 133 { |
134 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 134 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
135 V8TestCustomAccessors::namedPropertyEnumeratorCustom(info); | 135 V8TestCustomAccessors::namedPropertyEnumeratorCustom(info); |
136 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 136 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
137 } | 137 } |
138 | 138 |
139 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Integer>& info) | 139 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Integer>& info) |
140 { | 140 { |
141 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 141 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
142 V8TestCustomAccessors::namedPropertyQueryCustom(name, info); | 142 V8TestCustomAccessors::namedPropertyQueryCustom(name, info); |
143 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 143 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
144 } | 144 } |
145 | 145 |
146 } // namespace TestCustomAccessorsV8Internal | 146 } // namespace TestCustomAccessorsV8Internal |
147 | 147 |
148 static const V8DOMConfiguration::MethodConfiguration V8TestCustomAccessorsMethod
s[] = { | 148 static const V8DOMConfiguration::MethodConfiguration V8TestCustomAccessorsMethod
s[] = { |
149 {"anotherFunction", TestCustomAccessorsV8Internal::anotherFunctionMethodCall
back, 0, 1}, | 149 {"anotherFunction", TestCustomAccessorsV8Internal::anotherFunctionMethodCall
back, 0, 1}, |
150 }; | 150 }; |
151 | 151 |
152 static void configureV8TestCustomAccessorsTemplate(v8::Handle<v8::FunctionTempla
te> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) | 152 static void configureV8TestCustomAccessorsTemplate(v8::Handle<v8::FunctionTempla
te> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType) |
153 { | 153 { |
(...skipping 66 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 |