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

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/core/V8TestInterface.cpp

Issue 1993593003: binding: Check the type of property names in FooCallback instead of Foo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "V8TestInterface.h" 7 #include "V8TestInterface.h"
8 8
9 #include "bindings/core/v8/ExceptionState.h" 9 #include "bindings/core/v8/ExceptionState.h"
10 #include "bindings/core/v8/PrivateScriptRunner.h" 10 #include "bindings/core/v8/PrivateScriptRunner.h"
(...skipping 1857 matching lines...) Expand 10 before | Expand all | Expand 10 after
1868 return v8SetReturnValueBool(info, result == DeleteSuccess); 1868 return v8SetReturnValueBool(info, result == DeleteSuccess);
1869 } 1869 }
1870 1870
1871 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal lbackInfo<v8::Boolean>& info) 1871 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal lbackInfo<v8::Boolean>& info)
1872 { 1872 {
1873 TestInterfaceImplementationV8Internal::indexedPropertyDeleter(index, info); 1873 TestInterfaceImplementationV8Internal::indexedPropertyDeleter(index, info);
1874 } 1874 }
1875 1875
1876 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall backInfo<v8::Value>& info) 1876 static void namedPropertyGetter(v8::Local<v8::Name> name, const v8::PropertyCall backInfo<v8::Value>& info)
1877 { 1877 {
1878 if (!name->IsString())
1879 return;
1880 auto nameString = name.As<v8::String>(); 1878 auto nameString = name.As<v8::String>();
1881 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); 1879 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
1882 AtomicString propertyName = toCoreAtomicString(nameString); 1880 AtomicString propertyName = toCoreAtomicString(nameString);
1883 String result = impl->anonymousNamedGetter(propertyName); 1881 String result = impl->anonymousNamedGetter(propertyName);
1884 if (result.isNull()) 1882 if (result.isNull())
1885 return; 1883 return;
1886 v8SetReturnValueString(info, result, info.GetIsolate()); 1884 v8SetReturnValueString(info, result, info.GetIsolate());
1887 } 1885 }
1888 1886
1889 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop ertyCallbackInfo<v8::Value>& info) 1887 static void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::Prop ertyCallbackInfo<v8::Value>& info)
1890 { 1888 {
1889 if (!name->IsString())
1890 return;
1891 TestInterfaceImplementationV8Internal::namedPropertyGetter(name, info); 1891 TestInterfaceImplementationV8Internal::namedPropertyGetter(name, info);
1892 } 1892 }
1893 1893
1894 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 1894 static void namedPropertySetter(v8::Local<v8::Name> name, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
1895 { 1895 {
1896 if (!name->IsString())
1897 return;
1898 auto nameString = name.As<v8::String>(); 1896 auto nameString = name.As<v8::String>();
1899 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); 1897 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
1900 V8StringResource<> propertyName(nameString); 1898 V8StringResource<> propertyName(nameString);
1901 if (!propertyName.prepare()) 1899 if (!propertyName.prepare())
1902 return; 1900 return;
1903 V8StringResource<> propertyValue = v8Value; 1901 V8StringResource<> propertyValue = v8Value;
1904 if (!propertyValue.prepare()) 1902 if (!propertyValue.prepare())
1905 return; 1903 return;
1906 bool result = impl->anonymousNamedSetter(propertyName, propertyValue); 1904 bool result = impl->anonymousNamedSetter(propertyName, propertyValue);
1907 if (!result) 1905 if (!result)
1908 return; 1906 return;
1909 v8SetReturnValue(info, v8Value); 1907 v8SetReturnValue(info, v8Value);
1910 } 1908 }
1911 1909
1912 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8:: Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) 1910 static void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Local<v8:: Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
1913 { 1911 {
1912 if (!name->IsString())
1913 return;
1914 TestInterfaceImplementationV8Internal::namedPropertySetter(name, v8Value, in fo); 1914 TestInterfaceImplementationV8Internal::namedPropertySetter(name, v8Value, in fo);
1915 } 1915 }
1916 1916
1917 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb ackInfo<v8::Integer>& info) 1917 static void namedPropertyQuery(v8::Local<v8::Name> name, const v8::PropertyCallb ackInfo<v8::Integer>& info)
1918 { 1918 {
1919 if (!name->IsString())
1920 return;
1921 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); 1919 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
1922 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); 1920 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
1923 v8::String::Utf8Value namedProperty(name); 1921 v8::String::Utf8Value namedProperty(name);
1924 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface", info.Holder(), info.GetIsolate()); 1922 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface", info.Holder(), info.GetIsolate());
1925 bool result = impl->namedPropertyQuery(propertyName, exceptionState); 1923 bool result = impl->namedPropertyQuery(propertyName, exceptionState);
1926 if (exceptionState.throwIfNeeded()) 1924 if (exceptionState.throwIfNeeded())
1927 return; 1925 return;
1928 if (!result) 1926 if (!result)
1929 return; 1927 return;
1930 v8SetReturnValueInt(info, v8::None); 1928 v8SetReturnValueInt(info, v8::None);
1931 } 1929 }
1932 1930
1933 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope rtyCallbackInfo<v8::Integer>& info) 1931 static void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v8::Prope rtyCallbackInfo<v8::Integer>& info)
1934 { 1932 {
1933 if (!name->IsString())
1934 return;
1935 TestInterfaceImplementationV8Internal::namedPropertyQuery(name, info); 1935 TestInterfaceImplementationV8Internal::namedPropertyQuery(name, info);
1936 } 1936 }
1937 1937
1938 static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCal lbackInfo<v8::Boolean>& info) 1938 static void namedPropertyDeleter(v8::Local<v8::Name> name, const v8::PropertyCal lbackInfo<v8::Boolean>& info)
1939 { 1939 {
1940 if (!name->IsString())
1941 return;
1942 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); 1940 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
1943 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>()); 1941 AtomicString propertyName = toCoreAtomicString(name.As<v8::String>());
1944 DeleteResult result = impl->anonymousNamedDeleter(propertyName); 1942 DeleteResult result = impl->anonymousNamedDeleter(propertyName);
1945 if (result != DeleteUnknownProperty) 1943 if (result != DeleteUnknownProperty)
1946 return v8SetReturnValueBool(info, result == DeleteSuccess); 1944 return v8SetReturnValueBool(info, result == DeleteSuccess);
1947 } 1945 }
1948 1946
1949 static void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::Pro pertyCallbackInfo<v8::Boolean>& info) 1947 static void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::Pro pertyCallbackInfo<v8::Boolean>& info)
1950 { 1948 {
1949 if (!name->IsString())
1950 return;
1951 TestInterfaceImplementationV8Internal::namedPropertyDeleter(name, info); 1951 TestInterfaceImplementationV8Internal::namedPropertyDeleter(name, info);
1952 } 1952 }
1953 1953
1954 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo) 1954 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo)
1955 { 1955 {
1956 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder()); 1956 TestInterfaceImplementation* impl = V8TestInterface::toImpl(info.Holder());
1957 Vector<String> names; 1957 Vector<String> names;
1958 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter face", info.Holder(), info.GetIsolate()); 1958 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter face", info.Holder(), info.GetIsolate());
1959 impl->namedPropertyEnumerator(names, exceptionState); 1959 impl->namedPropertyEnumerator(names, exceptionState);
1960 if (exceptionState.throwIfNeeded()) 1960 if (exceptionState.throwIfNeeded())
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
2365 { 2365 {
2366 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt erface = method; 2366 TestInterfaceImplementationV8Internal::partial2VoidMethodMethodForPartialInt erface = method;
2367 } 2367 }
2368 2368
2369 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface( void (*method)(const v8::FunctionCallbackInfo<v8::Value>&)) 2369 void V8TestInterface::registerPartial2StaticVoidMethodMethodForPartialInterface( void (*method)(const v8::FunctionCallbackInfo<v8::Value>&))
2370 { 2370 {
2371 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart ialInterface = method; 2371 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodForPart ialInterface = method;
2372 } 2372 }
2373 2373
2374 } // namespace blink 2374 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698