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

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

Issue 113213002: Rename toWebCoreString*() utility methods to toCoreString*() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Keep "to" prefix Created 7 years 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
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 5002 matching lines...) Expand 10 before | Expand all | Expand 10 after
5013 { 5013 {
5014 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) 5014 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
5015 return; 5015 return;
5016 if (info.Holder()->HasRealNamedCallbackProperty(name)) 5016 if (info.Holder()->HasRealNamedCallbackProperty(name))
5017 return; 5017 return;
5018 if (info.Holder()->HasRealNamedProperty(name)) 5018 if (info.Holder()->HasRealNamedProperty(name))
5019 return; 5019 return;
5020 5020
5021 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder())); 5021 ASSERT(V8DOMWrapper::maybeDOMWrapper(info.Holder()));
5022 TestObj* collection = V8TestObject::toNative(info.Holder()); 5022 TestObj* collection = V8TestObject::toNative(info.Holder());
5023 AtomicString propertyName = toWebCoreAtomicString(name); 5023 AtomicString propertyName = toCoreAtomicString(name);
5024 String element = collection->namedItem(propertyName); 5024 String element = collection->namedItem(propertyName);
5025 if (element.isNull()) 5025 if (element.isNull())
5026 return; 5026 return;
5027 v8SetReturnValueString(info, element, info.GetIsolate()); 5027 v8SetReturnValueString(info, element, info.GetIsolate());
5028 } 5028 }
5029 5029
5030 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info) 5030 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr opertyCallbackInfo<v8::Value>& info)
5031 { 5031 {
5032 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); 5032 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
5033 TestObjV8Internal::namedPropertyGetter(name, info); 5033 TestObjV8Internal::namedPropertyGetter(name, info);
(...skipping 10 matching lines...) Expand all
5044 return; 5044 return;
5045 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size ()); 5045 v8::Handle<v8::Array> v8names = v8::Array::New(info.GetIsolate(), names.size ());
5046 for (size_t i = 0; i < names.size(); ++i) 5046 for (size_t i = 0; i < names.size(); ++i)
5047 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs olate(), names[i])); 5047 v8names->Set(v8::Integer::New(info.GetIsolate(), i), v8String(info.GetIs olate(), names[i]));
5048 v8SetReturnValue(info, v8names); 5048 v8SetReturnValue(info, v8names);
5049 } 5049 }
5050 5050
5051 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal lbackInfo<v8::Integer>& info) 5051 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal lbackInfo<v8::Integer>& info)
5052 { 5052 {
5053 TestObj* collection = V8TestObject::toNative(info.Holder()); 5053 TestObj* collection = V8TestObject::toNative(info.Holder());
5054 AtomicString propertyName = toWebCoreAtomicString(name); 5054 AtomicString propertyName = toCoreAtomicString(name);
5055 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); 5055 ExceptionState exceptionState(info.Holder(), info.GetIsolate());
5056 bool result = collection->namedPropertyQuery(propertyName, exceptionState); 5056 bool result = collection->namedPropertyQuery(propertyName, exceptionState);
5057 if (exceptionState.throwIfNeeded()) 5057 if (exceptionState.throwIfNeeded())
5058 return; 5058 return;
5059 if (!result) 5059 if (!result)
5060 return; 5060 return;
5061 v8SetReturnValueInt(info, v8::None); 5061 v8SetReturnValueInt(info, v8::None);
5062 } 5062 }
5063 5063
5064 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info) 5064 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A rray>& info)
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
5435 fromInternalPointer(object)->deref(); 5435 fromInternalPointer(object)->deref();
5436 } 5436 }
5437 5437
5438 template<> 5438 template<>
5439 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate) 5439 v8::Handle<v8::Value> toV8NoInline(TestObj* impl, v8::Handle<v8::Object> creatio nContext, v8::Isolate* isolate)
5440 { 5440 {
5441 return toV8(impl, creationContext, isolate); 5441 return toV8(impl, creationContext, isolate);
5442 } 5442 }
5443 5443
5444 } // namespace WebCore 5444 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.cpp ('k') | Source/bindings/v8/IDBBindingUtilities.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698