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

Unified Diff: Source/bindings/tests/results/V8TestSpecialOperationsInt.cpp

Issue 140693016: IDL compiler: interface and integer types for special operations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Typo Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/bindings/tests/results/V8TestSpecialOperationsInt.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/tests/results/V8TestSpecialOperationsInt.cpp
diff --git a/Source/bindings/tests/results/V8TestSpecialOperationsAnonymous.cpp b/Source/bindings/tests/results/V8TestSpecialOperationsInt.cpp
similarity index 63%
copy from Source/bindings/tests/results/V8TestSpecialOperationsAnonymous.cpp
copy to Source/bindings/tests/results/V8TestSpecialOperationsInt.cpp
index a348750973d5036fc58027455eb49c32ef983017..6ddd1ab3490ea7cd741fd4640cf870613b0b188a 100644
--- a/Source/bindings/tests/results/V8TestSpecialOperationsAnonymous.cpp
+++ b/Source/bindings/tests/results/V8TestSpecialOperationsInt.cpp
@@ -31,7 +31,7 @@
// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
#include "config.h"
-#include "V8TestSpecialOperationsAnonymous.h"
+#include "V8TestSpecialOperationsInt.h"
#include "RuntimeEnabledFeatures.h"
#include "bindings/v8/ExceptionState.h"
@@ -43,10 +43,10 @@
namespace WebCore {
-static void initializeScriptWrappableForInterface(TestSpecialOperationsAnonymous* object)
+static void initializeScriptWrappableForInterface(TestSpecialOperationsInt* object)
{
if (ScriptWrappable::wrapperCanBeStoredInObject(object))
- ScriptWrappable::setTypeInfoInObject(object, &V8TestSpecialOperationsAnonymous::wrapperTypeInfo);
+ ScriptWrappable::setTypeInfoInObject(object, &V8TestSpecialOperationsInt::wrapperTypeInfo);
else
ASSERT_NOT_REACHED();
}
@@ -57,38 +57,39 @@ static void initializeScriptWrappableForInterface(TestSpecialOperationsAnonymous
// the local declaration does not pick up the surrounding namespace. Therefore, we provide this function
// in the global namespace.
// (More info on the MSVC bug here: http://connect.microsoft.com/VisualStudio/feedback/details/664619/the-namespace-of-local-function-declarations-in-c)
-void webCoreInitializeScriptWrappableForInterface(WebCore::TestSpecialOperationsAnonymous* object)
+void webCoreInitializeScriptWrappableForInterface(WebCore::TestSpecialOperationsInt* object)
{
WebCore::initializeScriptWrappableForInterface(object);
}
namespace WebCore {
-const WrapperTypeInfo V8TestSpecialOperationsAnonymous::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestSpecialOperationsAnonymous::domTemplate, V8TestSpecialOperationsAnonymous::derefObject, 0, 0, 0, V8TestSpecialOperationsAnonymous::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestSpecialOperationsInt::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestSpecialOperationsInt::domTemplate, V8TestSpecialOperationsInt::derefObject, 0, 0, 0, V8TestSpecialOperationsInt::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-namespace TestSpecialOperationsAnonymousV8Internal {
+namespace TestSpecialOperationsIntV8Internal {
template <typename T> void V8_USE(T) { }
static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
{
- TestSpecialOperationsAnonymous* collection = V8TestSpecialOperationsAnonymous::toNative(info.Holder());
- String element = collection->anonymousIndexedGetter(index);
- if (element.isNull())
+ TestSpecialOperationsInt* collection = V8TestSpecialOperationsInt::toNative(info.Holder());
+ int element = collection->anonymousIndexedGetter(index);
+ if ()
return;
- v8SetReturnValueString(info, element, info.GetIsolate());
+ v8SetReturnValueInt(info, element);
}
static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
- TestSpecialOperationsAnonymousV8Internal::indexedPropertyGetter(index, info);
+ TestSpecialOperationsIntV8Internal::indexedPropertyGetter(index, info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
{
- TestSpecialOperationsAnonymous* collection = V8TestSpecialOperationsAnonymous::toNative(info.Holder());
- V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, jsValue);
+ TestSpecialOperationsInt* collection = V8TestSpecialOperationsInt::toNative(info.Holder());
+ V8TRYCATCH_EXCEPTION_VOID(unsigned, propertyValue, toUInt32(jsValue, exceptionState), exceptionState);
+ ExceptionState exceptionState(info.Holder(), info.GetIsolate());
bool result = collection->anonymousIndexedSetter(index, propertyValue);
if (!result)
return;
@@ -98,22 +99,7 @@ static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> jsValue,
static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
- TestSpecialOperationsAnonymousV8Internal::indexedPropertySetter(index, jsValue, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
-}
-
-static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
-{
- TestSpecialOperationsAnonymous* collection = V8TestSpecialOperationsAnonymous::toNative(info.Holder());
- DeleteResult result = collection->anonymousIndexedDeleter(index);
- if (result != DeleteUnknownProperty)
- return v8SetReturnValueBool(info, result == DeleteSuccess);
-}
-
-static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
-{
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
- TestSpecialOperationsAnonymousV8Internal::indexedPropertyDeleter(index, info);
+ TestSpecialOperationsIntV8Internal::indexedPropertySetter(index, jsValue, info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
@@ -126,18 +112,18 @@ static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
if (info.Holder()->HasRealNamedProperty(name))
return;
- TestSpecialOperationsAnonymous* collection = V8TestSpecialOperationsAnonymous::toNative(info.Holder());
+ TestSpecialOperationsInt* collection = V8TestSpecialOperationsInt::toNative(info.Holder());
AtomicString propertyName = toCoreAtomicString(name);
- String element = collection->anonymousNamedGetter(propertyName);
- if (element.isNull())
+ int element = collection->anonymousNamedGetter(propertyName);
+ if ()
return;
- v8SetReturnValueString(info, element, info.GetIsolate());
+ v8SetReturnValueInt(info, element);
}
static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
- TestSpecialOperationsAnonymousV8Internal::namedPropertyGetter(name, info);
+ TestSpecialOperationsIntV8Internal::namedPropertyGetter(name, info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
@@ -150,9 +136,10 @@ static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value>
if (info.Holder()->HasRealNamedProperty(name))
return;
- TestSpecialOperationsAnonymous* collection = V8TestSpecialOperationsAnonymous::toNative(info.Holder());
+ TestSpecialOperationsInt* collection = V8TestSpecialOperationsInt::toNative(info.Holder());
V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name);
- V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, jsValue);
+ V8TRYCATCH_EXCEPTION_VOID(unsigned, propertyValue, toUInt32(jsValue, exceptionState), exceptionState);
+ ExceptionState exceptionState(info.Holder(), info.GetIsolate());
bool result = collection->anonymousNamedSetter(propertyName, propertyValue);
if (!result)
return;
@@ -162,13 +149,13 @@ static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value>
static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<v8::Value>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
- TestSpecialOperationsAnonymousV8Internal::namedPropertySetter(name, jsValue, info);
+ TestSpecialOperationsIntV8Internal::namedPropertySetter(name, jsValue, info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
{
- TestSpecialOperationsAnonymous* collection = V8TestSpecialOperationsAnonymous::toNative(info.Holder());
+ TestSpecialOperationsInt* collection = V8TestSpecialOperationsInt::toNative(info.Holder());
AtomicString propertyName = toCoreAtomicString(name);
ExceptionState exceptionState(info.Holder(), info.GetIsolate());
bool result = collection->namedPropertyQuery(propertyName, exceptionState);
@@ -182,29 +169,13 @@ static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
- TestSpecialOperationsAnonymousV8Internal::namedPropertyQuery(name, info);
- TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
-}
-
-static void namedPropertyDeleter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
-{
- TestSpecialOperationsAnonymous* collection = V8TestSpecialOperationsAnonymous::toNative(info.Holder());
- AtomicString propertyName = toCoreAtomicString(name);
- DeleteResult result = collection->anonymousNamedDeleter(propertyName);
- if (result != DeleteUnknownProperty)
- return v8SetReturnValueBool(info, result == DeleteSuccess);
-}
-
-static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
-{
- TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
- TestSpecialOperationsAnonymousV8Internal::namedPropertyDeleter(name, info);
+ TestSpecialOperationsIntV8Internal::namedPropertyQuery(name, info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
{
- TestSpecialOperationsAnonymous* collection = V8TestSpecialOperationsAnonymous::toNative(info.Holder());
+ TestSpecialOperationsInt* collection = V8TestSpecialOperationsInt::toNative(info.Holder());
Vector<String> names;
ExceptionState exceptionState(info.Holder(), info.GetIsolate());
collection->namedPropertyEnumerator(names, exceptionState);
@@ -219,32 +190,32 @@ static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info)
{
TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
- TestSpecialOperationsAnonymousV8Internal::namedPropertyEnumerator(info);
+ TestSpecialOperationsIntV8Internal::namedPropertyEnumerator(info);
TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
}
-} // namespace TestSpecialOperationsAnonymousV8Internal
+} // namespace TestSpecialOperationsIntV8Internal
-static void configureV8TestSpecialOperationsAnonymousTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+static void configureV8TestSpecialOperationsIntTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
{
functionTemplate->ReadOnlyPrototype();
v8::Local<v8::Signature> defaultSignature;
- defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestSpecialOperationsAnonymous", v8::Local<v8::FunctionTemplate>(), V8TestSpecialOperationsAnonymous::internalFieldCount,
+ defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestSpecialOperationsInt", v8::Local<v8::FunctionTemplate>(), V8TestSpecialOperationsInt::internalFieldCount,
0, 0,
0, 0,
0, 0,
isolate, currentWorldType);
v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
- functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestSpecialOperationsAnonymousV8Internal::indexedPropertyGetterCallback, TestSpecialOperationsAnonymousV8Internal::indexedPropertySetterCallback, 0, TestSpecialOperationsAnonymousV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestSpecialOperationsAnonymous>);
- functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestSpecialOperationsAnonymousV8Internal::namedPropertyGetterCallback, TestSpecialOperationsAnonymousV8Internal::namedPropertySetterCallback, TestSpecialOperationsAnonymousV8Internal::namedPropertyQueryCallback, TestSpecialOperationsAnonymousV8Internal::namedPropertyDeleterCallback, TestSpecialOperationsAnonymousV8Internal::namedPropertyEnumeratorCallback);
+ functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestSpecialOperationsIntV8Internal::indexedPropertyGetterCallback, TestSpecialOperationsIntV8Internal::indexedPropertySetterCallback, 0, 0, indexedPropertyEnumerator<TestSpecialOperationsInt>);
+ functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestSpecialOperationsIntV8Internal::namedPropertyGetterCallback, TestSpecialOperationsIntV8Internal::namedPropertySetterCallback, TestSpecialOperationsIntV8Internal::namedPropertyQueryCallback, 0, TestSpecialOperationsIntV8Internal::namedPropertyEnumeratorCallback);
// Custom toString template
functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::current()->toStringTemplate());
}
-v8::Handle<v8::FunctionTemplate> V8TestSpecialOperationsAnonymous::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestSpecialOperationsInt::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
{
V8PerIsolateData* data = V8PerIsolateData::from(isolate);
V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -254,21 +225,21 @@ v8::Handle<v8::FunctionTemplate> V8TestSpecialOperationsAnonymous::domTemplate(v
TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
v8::EscapableHandleScope handleScope(isolate);
v8::Local<v8::FunctionTemplate> templ = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidConstructorMode);
- configureV8TestSpecialOperationsAnonymousTemplate(templ, isolate, currentWorldType);
+ configureV8TestSpecialOperationsIntTemplate(templ, isolate, currentWorldType);
data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
return handleScope.Escape(templ);
}
-bool V8TestSpecialOperationsAnonymous::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
+bool V8TestSpecialOperationsInt::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
{
return V8PerIsolateData::from(isolate)->hasInstanceInMainWorld(&wrapperTypeInfo, jsValue)
|| V8PerIsolateData::from(isolate)->hasInstanceInNonMainWorld(&wrapperTypeInfo, jsValue);
}
-v8::Handle<v8::Object> V8TestSpecialOperationsAnonymous::createWrapper(PassRefPtr<TestSpecialOperationsAnonymous> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+v8::Handle<v8::Object> V8TestSpecialOperationsInt::createWrapper(PassRefPtr<TestSpecialOperationsInt> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
ASSERT(impl);
- ASSERT(!DOMDataStore::containsWrapper<V8TestSpecialOperationsAnonymous>(impl.get(), isolate));
+ ASSERT(!DOMDataStore::containsWrapper<V8TestSpecialOperationsInt>(impl.get(), isolate));
if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) {
const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObject(impl.get());
// Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapperTypeInfo. These will both have
@@ -281,17 +252,17 @@ v8::Handle<v8::Object> V8TestSpecialOperationsAnonymous::createWrapper(PassRefPt
return wrapper;
installPerContextEnabledProperties(wrapper, impl.get(), isolate);
- V8DOMWrapper::associateObjectWithWrapper<V8TestSpecialOperationsAnonymous>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
+ V8DOMWrapper::associateObjectWithWrapper<V8TestSpecialOperationsInt>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
return wrapper;
}
-void V8TestSpecialOperationsAnonymous::derefObject(void* object)
+void V8TestSpecialOperationsInt::derefObject(void* object)
{
fromInternalPointer(object)->deref();
}
template<>
-v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsAnonymous* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+v8::Handle<v8::Value> toV8NoInline(TestSpecialOperationsInt* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
return toV8(impl, creationContext, isolate);
}
« no previous file with comments | « Source/bindings/tests/results/V8TestSpecialOperationsInt.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698