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

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

Issue 116153002: IDL compiler: [NamedConstructor] (basic) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Revised 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 side-by-side diff with in-line comments
Download patch
Index: Source/bindings/tests/results/V8TestInterfaceNamedConstructor.cpp
diff --git a/Source/bindings/tests/results/V8TestNamedConstructor.cpp b/Source/bindings/tests/results/V8TestInterfaceNamedConstructor.cpp
similarity index 61%
copy from Source/bindings/tests/results/V8TestNamedConstructor.cpp
copy to Source/bindings/tests/results/V8TestInterfaceNamedConstructor.cpp
index 3b504fa89d5fbc79b2b9d5ad115ff868432bb494..aa9c4f2ca33a897b966aa10915b830bac3df162a 100644
--- a/Source/bindings/tests/results/V8TestNamedConstructor.cpp
+++ b/Source/bindings/tests/results/V8TestInterfaceNamedConstructor.cpp
@@ -31,10 +31,9 @@
// This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY!
#include "config.h"
-#include "V8TestNamedConstructor.h"
+#include "V8TestInterfaceNamedConstructor.h"
#include "RuntimeEnabledFeatures.h"
-#include "V8Document.h"
#include "bindings/v8/ExceptionState.h"
#include "bindings/v8/V8DOMConfiguration.h"
#include "bindings/v8/V8ObjectConstructor.h"
@@ -44,10 +43,10 @@
namespace WebCore {
-static void initializeScriptWrappableForInterface(TestNamedConstructor* object)
+static void initializeScriptWrappableForInterface(TestInterfaceNamedConstructor* object)
{
if (ScriptWrappable::wrapperCanBeStoredInObject(object))
- ScriptWrappable::setTypeInfoInObject(object, &V8TestNamedConstructor::wrapperTypeInfo);
+ ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfaceNamedConstructor::wrapperTypeInfo);
else
ASSERT_NOT_REACHED();
}
@@ -58,23 +57,23 @@ static void initializeScriptWrappableForInterface(TestNamedConstructor* object)
// 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::TestNamedConstructor* object)
+void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceNamedConstructor* object)
{
WebCore::initializeScriptWrappableForInterface(object);
}
namespace WebCore {
-const WrapperTypeInfo V8TestNamedConstructor::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestNamedConstructor::domTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0, 0, V8TestNamedConstructor::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestInterfaceNamedConstructor::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceNamedConstructor::domTemplate, V8TestInterfaceNamedConstructor::derefObject, 0, 0, 0, V8TestInterfaceNamedConstructor::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-namespace TestNamedConstructorV8Internal {
+namespace TestInterfaceNamedConstructorV8Internal {
template <typename T> void V8_USE(T) { }
-} // namespace TestNamedConstructorV8Internal
+} // namespace TestInterfaceNamedConstructorV8Internal
-const WrapperTypeInfo V8TestNamedConstructorConstructor::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestNamedConstructorConstructor::domTemplate, V8TestNamedConstructor::derefObject, V8TestNamedConstructor::toActiveDOMObject, 0, 0, V8TestNamedConstructor::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
+const WrapperTypeInfo V8TestInterfaceNamedConstructorConstructor::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceNamedConstructorConstructor::domTemplate, V8TestInterfaceNamedConstructor::derefObject, 0, 0, 0, V8TestInterfaceNamedConstructor::installPerContextEnabledMethods, 0, WrapperTypeObjectPrototype };
-static void V8TestNamedConstructorConstructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
+static void V8TestInterfaceNamedConstructorConstructorCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
{
if (!info.IsConstructCall()) {
throwTypeError(ExceptionMessages::failedToConstruct("Audio", "Please use the 'new' operator, this DOM object constructor cannot be called as a function."), info.GetIsolate());
@@ -89,30 +88,18 @@ static void V8TestNamedConstructorConstructorCallback(const v8::FunctionCallback
Document* document = currentDocument();
ASSERT(document);
- // Make sure the document is added to the DOM Node map. Otherwise, the TestNamedConstructor instance
+ // Make sure the document is added to the DOM Node map. Otherwise, the TestInterfaceNamedConstructor instance
// may end up being the only node in the map and get garbage-collected prematurely.
toV8(document, info.Holder(), info.GetIsolate());
- ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestNamedConstructor", info.Holder(), info.GetIsolate());
- if (UNLIKELY(info.Length() < 1)) {
- exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
- exceptionState.throwIfNeeded();
- return;
- }
- V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]);
- V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]);
- V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str3, argumentOrNull(info, 2));
-
- RefPtr<TestNamedConstructor> impl = TestNamedConstructor::createForJSConstructor(*document, str1, str2, str3, exceptionState);
+ RefPtr<TestInterfaceNamedConstructor> impl = TestInterfaceNamedConstructor::createForJSConstructor(*document);
v8::Handle<v8::Object> wrapper = info.Holder();
- if (exceptionState.throwIfNeeded())
- return;
- V8DOMWrapper::associateObjectWithWrapper<V8TestNamedConstructor>(impl.release(), &V8TestNamedConstructorConstructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
+ V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceNamedConstructor>(impl.release(), &V8TestInterfaceNamedConstructorConstructor::wrapperTypeInfo, wrapper, info.GetIsolate(), WrapperConfiguration::Dependent);
v8SetReturnValue(info, wrapper);
}
-v8::Handle<v8::FunctionTemplate> V8TestNamedConstructorConstructor::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestInterfaceNamedConstructorConstructor::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
{
// This is only for getting a unique pointer which we can pass to privateTemplate.
static int privateTemplateUniqueKey;
@@ -123,23 +110,23 @@ v8::Handle<v8::FunctionTemplate> V8TestNamedConstructorConstructor::domTemplate(
TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
v8::EscapableHandleScope scope(isolate);
- result = v8::FunctionTemplate::New(isolate, V8TestNamedConstructorConstructorCallback);
+ result = v8::FunctionTemplate::New(isolate, V8TestInterfaceNamedConstructorConstructorCallback);
v8::Local<v8::ObjectTemplate> instanceTemplate = result->InstanceTemplate();
- instanceTemplate->SetInternalFieldCount(V8TestNamedConstructor::internalFieldCount);
- result->SetClassName(v8::String::NewFromUtf8(isolate, "TestNamedConstructor", v8::String::kInternalizedString));
- result->Inherit(V8TestNamedConstructor::domTemplate(isolate, currentWorldType));
+ instanceTemplate->SetInternalFieldCount(V8TestInterfaceNamedConstructor::internalFieldCount);
+ result->SetClassName(v8::String::NewFromUtf8(isolate, "TestInterfaceNamedConstructor", v8::String::kInternalizedString));
+ result->Inherit(V8TestInterfaceNamedConstructor::domTemplate(isolate, currentWorldType));
data->setPrivateTemplate(currentWorldType, &privateTemplateUniqueKey, result);
return scope.Escape(result);
}
-static v8::Handle<v8::FunctionTemplate> ConfigureV8TestNamedConstructorTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+static v8::Handle<v8::FunctionTemplate> ConfigureV8TestInterfaceNamedConstructorTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate, WrapperWorldType currentWorldType)
{
functionTemplate->ReadOnlyPrototype();
v8::Local<v8::Signature> defaultSignature;
- defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestNamedConstructor", v8::Local<v8::FunctionTemplate>(), V8TestNamedConstructor::internalFieldCount,
+ defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfaceNamedConstructor", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceNamedConstructor::internalFieldCount,
0, 0,
0, 0,
0, 0,
@@ -152,7 +139,7 @@ static v8::Handle<v8::FunctionTemplate> ConfigureV8TestNamedConstructorTemplate(
return functionTemplate;
}
-v8::Handle<v8::FunctionTemplate> V8TestNamedConstructor::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
+v8::Handle<v8::FunctionTemplate> V8TestInterfaceNamedConstructor::domTemplate(v8::Isolate* isolate, WrapperWorldType currentWorldType)
{
V8PerIsolateData* data = V8PerIsolateData::from(isolate);
V8PerIsolateData::TemplateMap::iterator result = data->templateMap(currentWorldType).find(&wrapperTypeInfo);
@@ -162,32 +149,27 @@ v8::Handle<v8::FunctionTemplate> V8TestNamedConstructor::domTemplate(v8::Isolate
TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
v8::EscapableHandleScope handleScope(isolate);
v8::Local<v8::FunctionTemplate> templ =
- ConfigureV8TestNamedConstructorTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
+ ConfigureV8TestInterfaceNamedConstructorTemplate(data->rawDOMTemplate(&wrapperTypeInfo, currentWorldType), isolate, currentWorldType);
data->templateMap(currentWorldType).add(&wrapperTypeInfo, UnsafePersistent<v8::FunctionTemplate>(isolate, templ));
return handleScope.Escape(templ);
}
-bool V8TestNamedConstructor::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
+bool V8TestInterfaceNamedConstructor::hasInstance(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate, WrapperWorldType currentWorldType)
{
return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, currentWorldType);
}
-bool V8TestNamedConstructor::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
+bool V8TestInterfaceNamedConstructor::hasInstanceInAnyWorld(v8::Handle<v8::Value> jsValue, v8::Isolate* isolate)
{
return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, MainWorld)
|| V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, IsolatedWorld)
|| V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, jsValue, WorkerWorld);
}
-ActiveDOMObject* V8TestNamedConstructor::toActiveDOMObject(v8::Handle<v8::Object> wrapper)
-{
- return toNative(wrapper);
-}
-
-v8::Handle<v8::Object> V8TestNamedConstructor::createWrapper(PassRefPtr<TestNamedConstructor> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+v8::Handle<v8::Object> V8TestInterfaceNamedConstructor::createWrapper(PassRefPtr<TestInterfaceNamedConstructor> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
ASSERT(impl);
- ASSERT(!DOMDataStore::containsWrapper<V8TestNamedConstructor>(impl.get(), isolate));
+ ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceNamedConstructor>(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
@@ -200,17 +182,17 @@ v8::Handle<v8::Object> V8TestNamedConstructor::createWrapper(PassRefPtr<TestName
return wrapper;
installPerContextEnabledProperties(wrapper, impl.get(), isolate);
- V8DOMWrapper::associateObjectWithWrapper<V8TestNamedConstructor>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Dependent);
+ V8DOMWrapper::associateObjectWithWrapper<V8TestInterfaceNamedConstructor>(impl, &wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Independent);
return wrapper;
}
-void V8TestNamedConstructor::derefObject(void* object)
+void V8TestInterfaceNamedConstructor::derefObject(void* object)
{
fromInternalPointer(object)->deref();
}
template<>
-v8::Handle<v8::Value> toV8NoInline(TestNamedConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
+v8::Handle<v8::Value> toV8NoInline(TestInterfaceNamedConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
{
return toV8(impl, creationContext, isolate);
}

Powered by Google App Engine
This is Rietveld 408576698