Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(13)

Side by Side Diff: Source/bindings/tests/results/V8TestEventTarget.cpp

Issue 182243002: Allow the implementation to return references instead of pointers to the bindings (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/scripts/v8_types.py ('k') | Source/bindings/tests/results/V8TestInterface.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 TestEventTargetV8Internal::namedItemMethod(info); 109 TestEventTargetV8Internal::namedItemMethod(info);
110 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 110 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
111 } 111 }
112 112
113 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) 113 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info)
114 { 114 {
115 TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder()); 115 TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder());
116 RefPtr<Node> result = imp->item(index); 116 RefPtr<Node> result = imp->item(index);
117 if (!result) 117 if (!result)
118 return; 118 return;
119 v8SetReturnValueFast(info, result.release(), imp); 119 v8SetReturnValueFast(info, WTF::getPtr(result.release()), imp);
120 } 120 }
121 121
122 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info) 122 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info)
123 { 123 {
124 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); 124 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
125 TestEventTargetV8Internal::indexedPropertyGetter(index, info); 125 TestEventTargetV8Internal::indexedPropertyGetter(index, info);
126 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 126 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
127 } 127 }
128 128
129 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info) 129 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 if (info.Holder()->HasRealNamedProperty(name)) 171 if (info.Holder()->HasRealNamedProperty(name))
172 return; 172 return;
173 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) 173 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
174 return; 174 return;
175 175
176 TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder()); 176 TestEventTarget* imp = V8TestEventTarget::toNative(info.Holder());
177 AtomicString propertyName = toCoreAtomicString(name); 177 AtomicString propertyName = toCoreAtomicString(name);
178 RefPtr<Node> result = imp->namedItem(propertyName); 178 RefPtr<Node> result = imp->namedItem(propertyName);
179 if (!result) 179 if (!result)
180 return; 180 return;
181 v8SetReturnValueFast(info, result.release(), imp); 181 v8SetReturnValueFast(info, WTF::getPtr(result.release()), imp);
182 } 182 }
183 183
184 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info) 184 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info)
185 { 185 {
186 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 186 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
187 TestEventTargetV8Internal::namedPropertyGetter(name, info); 187 TestEventTargetV8Internal::namedPropertyGetter(name, info);
188 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 188 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
189 } 189 }
190 190
191 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info) 191 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 fromInternalPointer(object)->deref(); 354 fromInternalPointer(object)->deref();
355 } 355 }
356 356
357 template<> 357 template<>
358 v8::Handle<v8::Value> toV8NoInline(TestEventTarget* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 358 v8::Handle<v8::Value> toV8NoInline(TestEventTarget* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
359 { 359 {
360 return toV8(impl, creationContext, isolate); 360 return toV8(impl, creationContext, isolate);
361 } 361 }
362 362
363 } // namespace WebCore 363 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_types.py ('k') | Source/bindings/tests/results/V8TestInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698