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

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

Issue 163883006: Add context to generated named and indexed property operations. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Ugh. Created 6 years, 10 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
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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 { 161 {
162 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 162 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
163 TestSpecialOperationsAnonymousV8Internal::namedPropertySetter(name, jsValue, info); 163 TestSpecialOperationsAnonymousV8Internal::namedPropertySetter(name, jsValue, info);
164 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 164 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
165 } 165 }
166 166
167 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal lbackInfo<v8::Integer>& info) 167 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal lbackInfo<v8::Integer>& info)
168 { 168 {
169 TestSpecialOperationsAnonymous* imp = V8TestSpecialOperationsAnonymous::toNa tive(info.Holder()); 169 TestSpecialOperationsAnonymous* imp = V8TestSpecialOperationsAnonymous::toNa tive(info.Holder());
170 AtomicString propertyName = toCoreAtomicString(name); 170 AtomicString propertyName = toCoreAtomicString(name);
171 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 171 v8::String::Utf8Value namedProperty(name);
172 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestSpecialOperationsAnonymous", info.Holder(), info.GetIsolate());
172 bool result = imp->namedPropertyQuery(propertyName, exceptionState); 173 bool result = imp->namedPropertyQuery(propertyName, exceptionState);
173 if (exceptionState.throwIfNeeded()) 174 if (exceptionState.throwIfNeeded())
174 return; 175 return;
175 if (!result) 176 if (!result)
176 return; 177 return;
177 v8SetReturnValueInt(info, v8::None); 178 v8SetReturnValueInt(info, v8::None);
178 } 179 }
179 180
180 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro pertyCallbackInfo<v8::Integer>& info) 181 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro pertyCallbackInfo<v8::Integer>& info)
181 { 182 {
(...skipping 15 matching lines...) Expand all
197 { 198 {
198 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 199 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
199 TestSpecialOperationsAnonymousV8Internal::namedPropertyDeleter(name, info); 200 TestSpecialOperationsAnonymousV8Internal::namedPropertyDeleter(name, info);
200 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); 201 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
201 } 202 }
202 203
203 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo) 204 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo)
204 { 205 {
205 TestSpecialOperationsAnonymous* imp = V8TestSpecialOperationsAnonymous::toNa tive(info.Holder()); 206 TestSpecialOperationsAnonymous* imp = V8TestSpecialOperationsAnonymous::toNa tive(info.Holder());
206 Vector<String> names; 207 Vector<String> names;
207 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 208 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestSpeci alOperationsAnonymous", info.Holder(), info.GetIsolate());
208 imp->namedPropertyEnumerator(names, exceptionState); 209 imp->namedPropertyEnumerator(names, exceptionState);
209 if (exceptionState.throwIfNeeded()) 210 if (exceptionState.throwIfNeeded())
210 return; 211 return;
211 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size ()); 212 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size ());
212 for (size_t i = 0; i < names.size(); ++i) 213 for (size_t i = 0; i < names.size(); ++i)
213 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs olate(), names[i])); 214 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs olate(), names[i]));
214 v8SetReturnValue(info, v8names); 215 v8SetReturnValue(info, v8names);
215 } 216 }
216 217
217 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info) 218 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info)
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 fromInternalPointer(object)->deref(); 294 fromInternalPointer(object)->deref();
294 } 295 }
295 296
296 template<> 297 template<>
297 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsAnonymous* impl, v8::Han dle<v8::Object> creationContext, v8::Isolate* isolate) 298 v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsAnonymous* impl, v8::Han dle<v8::Object> creationContext, v8::Isolate* isolate)
298 { 299 {
299 return toV8(impl, creationContext, isolate); 300 return toV8(impl, creationContext, isolate);
300 } 301 }
301 302
302 } // namespace WebCore 303 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698