[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
kinuko at chromium.org
kinuko at chromium.org
Wed Dec 22 13:23:25 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 9d79aee9c3dc80d7cb5df2c1e86e6dc37d7a739b
Author: kinuko at chromium.org <kinuko at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Sep 13 23:14:51 2010 +0000
2010-09-13 Kinuko Yasuda <kinuko at chromium.org>
Reviewed by Dumitru Daniliuc.
Expose Flags constructor if FileSystem API is Enabled
https://bugs.webkit.org/show_bug.cgi?id=45165
This change also includes:
- Changed Flags' attribute names from UPPERCASE to camelCase to reflect the recent spec change.
http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interface
- Enhanced EnabledAtRuntime attribute to take parameter that is used to generate a RuntimeEnabledFeatures method name.
No new tests; tests will be added when we fully expose the interface.
* bindings/v8/V8DOMWindowCustom.cpp: Added custom getter for FlagsConstructor.
* fileapi/Flags.idl: Changed attribute names to camelCase.
* page/DOMWindow.idl: Exposed Flags constructor.
* bindings/scripts/CodeGenerator.pm: Updated the WK_lcfirst hack to work around getter method for 'create' (create() should be avoided as it's widely used to instantiate an object).
* bindings/scripts/CodeGeneratorV8.pm: Added EnabledAtRuntime=FeatureName support.
* bindings/scripts/test/CPP/WebDOMTestObj.cpp:
(WebDOMTestObj::create):
(WebDOMTestObj::setCreate):
* bindings/scripts/test/CPP/WebDOMTestObj.h:
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_set_property):
(webkit_dom_test_obj_get_property):
(webkit_dom_test_obj_class_init):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
* bindings/scripts/test/TestObj.idl:
* bindings/scripts/test/V8/V8TestObj.cpp:
(WebCore::TestObjInternal::createAttrGetter):
(WebCore::TestObjInternal::createAttrSetter):
(WebCore::TestObjInternal::enabledAtRuntimeAttr1AttrGetter):
(WebCore::TestObjInternal::enabledAtRuntimeAttr1AttrSetter):
(WebCore::TestObjInternal::enabledAtRuntimeAttr2AttrGetter):
(WebCore::TestObjInternal::enabledAtRuntimeAttr2AttrSetter):
(WebCore::TestObjInternal::enabledAtRuntimeMethod1Callback):
(WebCore::TestObjInternal::enabledAtRuntimeMethod2Callback):
(WebCore::ConfigureV8TestObjTemplate):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67421 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 62bbb12..103e05c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,47 @@
+2010-09-13 Kinuko Yasuda <kinuko at chromium.org>
+
+ Reviewed by Dumitru Daniliuc.
+
+ Expose Flags constructor if FileSystem API is Enabled
+ https://bugs.webkit.org/show_bug.cgi?id=45165
+
+ This change also includes:
+ - Changed Flags' attribute names from UPPERCASE to camelCase to reflect the recent spec change.
+ http://dev.w3.org/2009/dap/file-system/file-dir-sys.html#the-flags-interface
+ - Enhanced EnabledAtRuntime attribute to take parameter that is used to generate a RuntimeEnabledFeatures method name.
+
+ No new tests; tests will be added when we fully expose the interface.
+
+ * bindings/v8/V8DOMWindowCustom.cpp: Added custom getter for FlagsConstructor.
+ * fileapi/Flags.idl: Changed attribute names to camelCase.
+ * page/DOMWindow.idl: Exposed Flags constructor.
+
+ * bindings/scripts/CodeGenerator.pm: Updated the WK_lcfirst hack to work around getter method for 'create' (create() should be avoided as it's widely used to instantiate an object).
+ * bindings/scripts/CodeGeneratorV8.pm: Added EnabledAtRuntime=FeatureName support.
+ * bindings/scripts/test/CPP/WebDOMTestObj.cpp:
+ (WebDOMTestObj::create):
+ (WebDOMTestObj::setCreate):
+ * bindings/scripts/test/CPP/WebDOMTestObj.h:
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ (webkit_dom_test_obj_set_property):
+ (webkit_dom_test_obj_get_property):
+ (webkit_dom_test_obj_class_init):
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+ * bindings/scripts/test/ObjC/DOMTestObj.mm:
+ * bindings/scripts/test/TestObj.idl:
+ * bindings/scripts/test/V8/V8TestObj.cpp:
+ (WebCore::TestObjInternal::createAttrGetter):
+ (WebCore::TestObjInternal::createAttrSetter):
+ (WebCore::TestObjInternal::enabledAtRuntimeAttr1AttrGetter):
+ (WebCore::TestObjInternal::enabledAtRuntimeAttr1AttrSetter):
+ (WebCore::TestObjInternal::enabledAtRuntimeAttr2AttrGetter):
+ (WebCore::TestObjInternal::enabledAtRuntimeAttr2AttrSetter):
+ (WebCore::TestObjInternal::enabledAtRuntimeMethod1Callback):
+ (WebCore::TestObjInternal::enabledAtRuntimeMethod2Callback):
+ (WebCore::ConfigureV8TestObjTemplate):
+
2010-09-13 Adam Barth <abarth at webkit.org>
Reviewed by Darin Adler.
diff --git a/WebCore/bindings/scripts/CodeGenerator.pm b/WebCore/bindings/scripts/CodeGenerator.pm
index adc47d0..ec762b6 100644
--- a/WebCore/bindings/scripts/CodeGenerator.pm
+++ b/WebCore/bindings/scripts/CodeGenerator.pm
@@ -344,10 +344,6 @@ sub WK_ucfirst
my $ret = ucfirst($param);
$ret =~ s/Xml/XML/ if $ret =~ /^Xml[^a-z]/;
- # For HTML5 FileSystem API Flags attributes.
- $ret =~ s/^CREATE/Create/ if $ret =~ /^CREATE$/;
- $ret =~ s/^EXCLUSIVE/Exclusive/ if $ret =~ /^EXCLUSIVE$/;
-
return $ret;
}
@@ -364,8 +360,9 @@ sub WK_lcfirst
$ret =~ s/xSLT/xslt/ if $ret =~ /^xSLT/;
# For HTML5 FileSystem API Flags attributes.
- $ret =~ s/^cREATE/isCreate/ if $ret =~ /^cREATE$/;
- $ret =~ s/^eXCLUSIVE/isExclusive/ if $ret =~ /^eXCLUSIVE$/;
+ # (create is widely used to instantiate an object and must be avoided.)
+ $ret =~ s/^create/isCreate/ if $ret =~ /^create$/;
+ $ret =~ s/^exclusive/isExclusive/ if $ret =~ /^exclusive$/;
return $ret;
}
diff --git a/WebCore/bindings/scripts/CodeGeneratorV8.pm b/WebCore/bindings/scripts/CodeGeneratorV8.pm
index 06bce04..fde6995 100644
--- a/WebCore/bindings/scripts/CodeGeneratorV8.pm
+++ b/WebCore/bindings/scripts/CodeGeneratorV8.pm
@@ -1984,8 +1984,7 @@ END
# Setup the enable-at-runtime attrs if we have them
foreach my $runtime_attr (@enabledAtRuntime) {
- # A function named RuntimeEnabledFeatures::{methodName}Enabled() need to be written by hand.
- $enable_function = "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($runtime_attr->signature->name) . "Enabled";
+ my $enable_function = GetRuntimeEnableFunctionName($runtime_attr->signature);
my $conditionalString = GenerateConditionalString($runtime_attr->signature);
push(@implContent, "\n#if ${conditionalString}\n") if $conditionalString;
push(@implContent, " if (${enable_function}()) {\n");
@@ -2034,7 +2033,7 @@ END
my $conditional = "";
if ($attrExt->{"EnabledAtRuntime"}) {
# Only call Set()/SetAccessor() if this method should be enabled
- $enable_function = "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($function->signature->name) . "Enabled";
+ $enable_function = GetRuntimeEnableFunctionName($function->signature);
$conditional = "if (${enable_function}())\n ";
}
@@ -3389,6 +3388,18 @@ sub ConvertToV8Parameter
}
}
+# Returns the RuntimeEnabledFeatures function name that is hooked up to check if a method/attribute is enabled.
+sub GetRuntimeEnableFunctionName
+{
+ my $signature = shift;
+
+ # If a parameter is given (e.g. "EnabledAtRuntime=FeatureName") return the RuntimeEnabledFeatures::{FeatureName}Enabled() method.
+ return "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($signature->extendedAttributes->{"EnabledAtRuntime"}) . "Enabled" if ($signature->extendedAttributes->{"EnabledAtRuntime"} && $signature->extendedAttributes->{"EnabledAtRuntime"} ne "1");
+
+ # Otherwise return a function named RuntimeEnabledFeatures::{methodName}Enabled().
+ return "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($signature->name) . "Enabled";
+}
+
sub DebugPrint
{
my $output = shift;
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
index 9cceb3c..579295f 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.cpp
@@ -199,7 +199,7 @@ void WebDOMTestObj::setXMLObjAttr(const WebDOMTestObj& newXMLObjAttr)
impl()->setXMLObjAttr(toWebCore(newXMLObjAttr));
}
-bool WebDOMTestObj::CREATE() const
+bool WebDOMTestObj::create() const
{
if (!impl())
return false;
@@ -207,12 +207,12 @@ bool WebDOMTestObj::CREATE() const
return impl()->isCreate();
}
-void WebDOMTestObj::setCREATE(bool newCREATE)
+void WebDOMTestObj::setCreate(bool newCreate)
{
if (!impl())
return;
- impl()->setCreate(newCREATE);
+ impl()->setCreate(newCreate);
}
WebDOMString WebDOMTestObj::reflectedStringAttr() const
diff --git a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
index 037a1d3..cd6caaa 100644
--- a/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
+++ b/WebCore/bindings/scripts/test/CPP/WebDOMTestObj.h
@@ -72,8 +72,8 @@ public:
void setTestObjAttr(const WebDOMTestObj&);
WebDOMTestObj XMLObjAttr() const;
void setXMLObjAttr(const WebDOMTestObj&);
- bool CREATE() const;
- void setCREATE(bool);
+ bool create() const;
+ void setCreate(bool);
WebDOMString reflectedStringAttr() const;
void setReflectedStringAttr(const WebDOMString&);
int reflectedIntegralAttr() const;
diff --git a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
index 63bc368..5236267 100644
--- a/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
+++ b/WebCore/bindings/scripts/test/JS/JSTestObj.cpp
@@ -63,7 +63,7 @@ static const HashTableValue JSTestObjTableValues[34] =
{ "stringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t)setJSTestObjStringAttr THUNK_GENERATOR(0) },
{ "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr THUNK_GENERATOR(0) },
{ "XMLObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjXMLObjAttr), (intptr_t)setJSTestObjXMLObjAttr THUNK_GENERATOR(0) },
- { "CREATE", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t)setJSTestObjCreate THUNK_GENERATOR(0) },
+ { "create", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjCreate), (intptr_t)setJSTestObjCreate THUNK_GENERATOR(0) },
{ "reflectedStringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedStringAttr), (intptr_t)setJSTestObjReflectedStringAttr THUNK_GENERATOR(0) },
{ "reflectedIntegralAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedIntegralAttr), (intptr_t)setJSTestObjReflectedIntegralAttr THUNK_GENERATOR(0) },
{ "reflectedBooleanAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedBooleanAttr), (intptr_t)setJSTestObjReflectedBooleanAttr THUNK_GENERATOR(0) },
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
index 132b215..1ad29cb 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h
@@ -64,8 +64,8 @@ enum {
- (void)setTestObjAttr:(DOMTestObj *)newTestObjAttr;
- (DOMTestObj *)XMLObjAttr;
- (void)setXMLObjAttr:(DOMTestObj *)newXMLObjAttr;
-- (BOOL)CREATE;
-- (void)setCREATE:(BOOL)newCREATE;
+- (BOOL)create;
+- (void)setCreate:(BOOL)newCreate;
- (NSString *)reflectedStringAttr;
- (void)setReflectedStringAttr:(NSString *)newReflectedStringAttr;
- (int)reflectedIntegralAttr;
diff --git a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
index 9725b24..6788075 100644
--- a/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
+++ b/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm
@@ -168,16 +168,16 @@
IMPL->setXMLObjAttr(core(newXMLObjAttr));
}
-- (BOOL)CREATE
+- (BOOL)create
{
WebCore::JSMainThreadNullState state;
return IMPL->isCreate();
}
-- (void)setCREATE:(BOOL)newCREATE
+- (void)setCreate:(BOOL)newCreate
{
WebCore::JSMainThreadNullState state;
- IMPL->setCreate(newCREATE);
+ IMPL->setCreate(newCreate);
}
- (NSString *)reflectedStringAttr
diff --git a/WebCore/bindings/scripts/test/TestObj.idl b/WebCore/bindings/scripts/test/TestObj.idl
index 89dfdf7..22ed680 100644
--- a/WebCore/bindings/scripts/test/TestObj.idl
+++ b/WebCore/bindings/scripts/test/TestObj.idl
@@ -44,7 +44,7 @@ module test {
JS, V8
// WK_ucfirst, WK_lcfirst exceptional cases.
attribute TestObj XMLObjAttr;
- attribute boolean CREATE;
+ attribute boolean create;
// Reflected DOM attributes
attribute [Reflect] DOMString reflectedStringAttr;
@@ -142,6 +142,14 @@ module test {
[ClassMethod] void classMethod();
[ClassMethod] long classMethodWithOptional(in [Optional] long arg);
+#if defined(TESTING_V8)
+ // 'EnabledAtRuntime' methods and attributes.
+ [EnabledAtRuntime] void enabledAtRuntimeMethod1(in int intArg);
+ [EnabledAtRuntime=FeatureName] void enabledAtRuntimeMethod2(in int intArg);
+ attribute [EnabledAtRuntime] long enabledAtRuntimeAttr1;
+ attribute [EnabledAtRuntime=FeatureName] long enabledAtRuntimeAttr2;
+#endif
+
// ObjectiveC reserved words.
readonly attribute long description;
attribute long id;
diff --git a/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp b/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
index 340dca7..267f1f0 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestInterface.cpp
@@ -70,24 +70,16 @@ v8::Persistent<v8::FunctionTemplate> V8TestInterface::GetTemplate()
return V8TestInterfaceCache;
}
-TestInterface* V8TestInterface::toNative(v8::Handle<v8::Object> object)
-{
- return reinterpret_cast<TestInterface*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
-}
-
bool V8TestInterface::HasInstance(v8::Handle<v8::Value> value)
{
return GetRawTemplate()->HasInstance(value);
}
-v8::Handle<v8::Object> V8TestInterface::wrap(TestInterface* impl)
+v8::Handle<v8::Object> V8TestInterface::wrapSlow(TestInterface* impl)
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = getDOMObjectMap().get(impl);
- if (!wrapper.IsEmpty())
- return wrapper;
wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
if (wrapper.IsEmpty())
return wrapper;
@@ -97,18 +89,6 @@ v8::Handle<v8::Object> V8TestInterface::wrap(TestInterface* impl)
return wrapper;
}
-v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface > impl)
-{
- return toV8(impl.get());
-}
-
-v8::Handle<v8::Value> toV8(TestInterface* impl)
-{
- if (!impl)
- return v8::Null();
- return V8TestInterface::wrap(impl);
-}
-
void V8TestInterface::derefObject(void* object)
{
static_cast<TestInterface*>(object)->deref();
diff --git a/WebCore/bindings/scripts/test/V8/V8TestInterface.h b/WebCore/bindings/scripts/test/V8/V8TestInterface.h
index afdf381..c1e319b 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestInterface.h
+++ b/WebCore/bindings/scripts/test/V8/V8TestInterface.h
@@ -24,6 +24,7 @@
#define V8TestInterface_h
#include "TestInterface.h"
+#include "V8DOMWrapper.h"
#include "WrapperTypeInfo.h"
#include "wtf/text/StringHash.h"
#include <v8.h>
@@ -37,16 +38,38 @@ public:
static bool HasInstance(v8::Handle<v8::Value> value);
static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
static v8::Persistent<v8::FunctionTemplate> GetTemplate();
- static TestInterface* toNative(v8::Handle<v8::Object>);
- static v8::Handle<v8::Object> wrap(TestInterface*);
+ static TestInterface* toNative(v8::Handle<v8::Object> object)
+ {
+ return reinterpret_cast<TestInterface*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
+ }
+ inline static v8::Handle<v8::Object> wrap(TestInterface*);
static void derefObject(void*);
static WrapperTypeInfo info;
static v8::Handle<v8::Value> constructorCallback(const v8::Arguments& args);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+private:
+ static v8::Handle<v8::Object> wrapSlow(TestInterface*);
};
-v8::Handle<v8::Value> toV8(TestInterface*);
-v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface >);
+
+v8::Handle<v8::Object> V8TestInterface::wrap(TestInterface* impl)
+{
+ v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return V8TestInterface::wrapSlow(impl);
+}
+
+inline v8::Handle<v8::Value> toV8(TestInterface* impl)
+{
+ if (!impl)
+ return v8::Null();
+ return V8TestInterface::wrap(impl);
+}
+inline v8::Handle<v8::Value> toV8(PassRefPtr< TestInterface > impl)
+{
+ return toV8(impl.get());
+}
}
#endif // V8TestInterface_h
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
index 8f824d9..44f0d3e 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.cpp
@@ -35,6 +35,7 @@
#include "V8IsolatedContext.h"
#include "V8Proxy.h"
#include "V8TestCallback.h"
+#include "V8int.h"
#include "V8log.h"
#include <wtf/GetPtr.h>
#include <wtf/RefCounted.h>
@@ -172,16 +173,16 @@ static void XMLObjAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value
return;
}
-static v8::Handle<v8::Value> CREATEAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+static v8::Handle<v8::Value> createAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.CREATE._get");
+ INC_STATS("DOM.TestObj.create._get");
TestObj* imp = V8TestObj::toNative(info.Holder());
return v8Boolean(imp->isCreate());
}
-static void CREATEAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+static void createAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
{
- INC_STATS("DOM.TestObj.CREATE._set");
+ INC_STATS("DOM.TestObj.create._set");
TestObj* imp = V8TestObj::toNative(info.Holder());
bool v = value->BooleanValue();
imp->setCreate(v);
@@ -515,6 +516,38 @@ static void conditionalAttr3AttrSetter(v8::Local<v8::String> name, v8::Local<v8:
#endif // ENABLE(Condition1) || ENABLE(Condition2)
+static v8::Handle<v8::Value> enabledAtRuntimeAttr1AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeAttr1._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->enabledAtRuntimeAttr1());
+}
+
+static void enabledAtRuntimeAttr1AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeAttr1._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ imp->setEnabledAtRuntimeAttr1(v);
+ return;
+}
+
+static v8::Handle<v8::Value> enabledAtRuntimeAttr2AttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeAttr2._get");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ return v8::Integer::New(imp->enabledAtRuntimeAttr2());
+}
+
+static void enabledAtRuntimeAttr2AttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeAttr2._set");
+ TestObj* imp = V8TestObj::toNative(info.Holder());
+ int v = toInt32(value);
+ imp->setEnabledAtRuntimeAttr2(v);
+ return;
+}
+
static v8::Handle<v8::Value> descriptionAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
{
INC_STATS("DOM.TestObj.description._get");
@@ -1020,6 +1053,24 @@ static v8::Handle<v8::Value> classMethodWithOptionalCallback(const v8::Arguments
return v8::Integer::New(TestObj::classMethodWithOptional(arg));
}
+static v8::Handle<v8::Value> enabledAtRuntimeMethod1Callback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeMethod1");
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ EXCEPTION_BLOCK(int, intArg, V8int::HasInstance(args[0]) ? V8int::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
+ imp->enabledAtRuntimeMethod1(intArg);
+ return v8::Handle<v8::Value>();
+}
+
+static v8::Handle<v8::Value> enabledAtRuntimeMethod2Callback(const v8::Arguments& args)
+{
+ INC_STATS("DOM.TestObj.enabledAtRuntimeMethod2");
+ TestObj* imp = V8TestObj::toNative(args.Holder());
+ EXCEPTION_BLOCK(int, intArg, V8int::HasInstance(args[0]) ? V8int::toNative(v8::Handle<v8::Object>::Cast(args[0])) : 0);
+ imp->enabledAtRuntimeMethod2(intArg);
+ return v8::Handle<v8::Value>();
+}
+
} // namespace TestObjInternal
static const BatchedAttribute TestObjAttrs[] = {
@@ -1041,8 +1092,8 @@ static const BatchedAttribute TestObjAttrs[] = {
{"testObjAttr", TestObjInternal::testObjAttrAttrGetter, TestObjInternal::testObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'XMLObjAttr' (Type: 'attribute' ExtAttr: '')
{"XMLObjAttr", TestObjInternal::XMLObjAttrAttrGetter, TestObjInternal::XMLObjAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
- // Attribute 'CREATE' (Type: 'attribute' ExtAttr: '')
- {"CREATE", TestObjInternal::CREATEAttrGetter, TestObjInternal::CREATEAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
+ // Attribute 'create' (Type: 'attribute' ExtAttr: '')
+ {"create", TestObjInternal::createAttrGetter, TestObjInternal::createAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'reflectedStringAttr' (Type: 'attribute' ExtAttr: 'Reflect')
{"reflectedStringAttr", TestObjInternal::reflectedStringAttrAttrGetter, TestObjInternal::reflectedStringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
// Attribute 'reflectedIntegralAttr' (Type: 'attribute' ExtAttr: 'Reflect')
@@ -1157,6 +1208,18 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persi
v8::Local<v8::ObjectTemplate> instance = desc->InstanceTemplate();
v8::Local<v8::ObjectTemplate> proto = desc->PrototypeTemplate();
+ if (RuntimeEnabledFeatures::enabledAtRuntimeAttr1Enabled()) {
+ static const BatchedAttribute attrData =\
+ // Attribute 'enabledAtRuntimeAttr1' (Type: 'attribute' ExtAttr: 'EnabledAtRuntime')
+ {"enabledAtRuntimeAttr1", TestObjInternal::enabledAtRuntimeAttr1AttrGetter, TestObjInternal::enabledAtRuntimeAttr1AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
+ configureAttribute(instance, proto, attrData);
+ }
+ if (RuntimeEnabledFeatures::featureNameEnabled()) {
+ static const BatchedAttribute attrData =\
+ // Attribute 'enabledAtRuntimeAttr2' (Type: 'attribute' ExtAttr: 'EnabledAtRuntime')
+ {"enabledAtRuntimeAttr2", TestObjInternal::enabledAtRuntimeAttr2AttrGetter, TestObjInternal::enabledAtRuntimeAttr2AttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
+ configureAttribute(instance, proto, attrData);
+ }
// Custom Signature 'voidMethodWithArgs'
const int voidMethodWithArgsArgc = 3;
@@ -1195,6 +1258,10 @@ static v8::Persistent<v8::FunctionTemplate> ConfigureV8TestObjTemplate(v8::Persi
proto->Set(v8::String::New("customArgsAndException"), v8::FunctionTemplate::New(TestObjInternal::customArgsAndExceptionCallback, v8::Handle<v8::Value>(), customArgsAndExceptionSignature));
desc->Set(v8::String::New("classMethod"), v8::FunctionTemplate::New(TestObjInternal::classMethodCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
desc->Set(v8::String::New("classMethodWithOptional"), v8::FunctionTemplate::New(TestObjInternal::classMethodWithOptionalCallback, v8::Handle<v8::Value>(), v8::Local<v8::Signature>()));
+ if (RuntimeEnabledFeatures::enabledAtRuntimeMethod1Enabled())
+ proto->Set(v8::String::New("enabledAtRuntimeMethod1"), v8::FunctionTemplate::New(TestObjInternal::enabledAtRuntimeMethod1Callback, v8::Handle<v8::Value>(), defaultSignature));
+ if (RuntimeEnabledFeatures::featureNameEnabled())
+ proto->Set(v8::String::New("enabledAtRuntimeMethod2"), v8::FunctionTemplate::New(TestObjInternal::enabledAtRuntimeMethod2Callback, v8::Handle<v8::Value>(), defaultSignature));
batchConfigureConstants(desc, proto, TestObjConsts, sizeof(TestObjConsts) / sizeof(*TestObjConsts));
// Custom toString template
@@ -1214,24 +1281,16 @@ v8::Persistent<v8::FunctionTemplate> V8TestObj::GetTemplate()
return V8TestObjCache;
}
-TestObj* V8TestObj::toNative(v8::Handle<v8::Object> object)
-{
- return reinterpret_cast<TestObj*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
-}
-
bool V8TestObj::HasInstance(v8::Handle<v8::Value> value)
{
return GetRawTemplate()->HasInstance(value);
}
-v8::Handle<v8::Object> V8TestObj::wrap(TestObj* impl)
+v8::Handle<v8::Object> V8TestObj::wrapSlow(TestObj* impl)
{
v8::Handle<v8::Object> wrapper;
V8Proxy* proxy = 0;
- wrapper = getDOMObjectMap().get(impl);
- if (!wrapper.IsEmpty())
- return wrapper;
wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
if (wrapper.IsEmpty())
return wrapper;
@@ -1241,18 +1300,6 @@ v8::Handle<v8::Object> V8TestObj::wrap(TestObj* impl)
return wrapper;
}
-v8::Handle<v8::Value> toV8(PassRefPtr<TestObj > impl)
-{
- return toV8(impl.get());
-}
-
-v8::Handle<v8::Value> toV8(TestObj* impl)
-{
- if (!impl)
- return v8::Null();
- return V8TestObj::wrap(impl);
-}
-
void V8TestObj::derefObject(void* object)
{
static_cast<TestObj*>(object)->deref();
diff --git a/WebCore/bindings/scripts/test/V8/V8TestObj.h b/WebCore/bindings/scripts/test/V8/V8TestObj.h
index d9715c9..1e60488 100644
--- a/WebCore/bindings/scripts/test/V8/V8TestObj.h
+++ b/WebCore/bindings/scripts/test/V8/V8TestObj.h
@@ -22,6 +22,7 @@
#define V8TestObj_h
#include "TestObj.h"
+#include "V8DOMWrapper.h"
#include "WrapperTypeInfo.h"
#include "wtf/text/StringHash.h"
#include <v8.h>
@@ -35,8 +36,11 @@ public:
static bool HasInstance(v8::Handle<v8::Value> value);
static v8::Persistent<v8::FunctionTemplate> GetRawTemplate();
static v8::Persistent<v8::FunctionTemplate> GetTemplate();
- static TestObj* toNative(v8::Handle<v8::Object>);
- static v8::Handle<v8::Object> wrap(TestObj*);
+ static TestObj* toNative(v8::Handle<v8::Object> object)
+ {
+ return reinterpret_cast<TestObj*>(object->GetPointerFromInternalField(v8DOMWrapperObjectIndex));
+ }
+ inline static v8::Handle<v8::Object> wrap(TestObj*);
static void derefObject(void*);
static WrapperTypeInfo info;
static v8::Handle<v8::Value> customMethodCallback(const v8::Arguments&);
@@ -44,10 +48,29 @@ public:
static v8::Handle<v8::Value> customAttrAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info);
static void customAttrAccessorSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
+private:
+ static v8::Handle<v8::Object> wrapSlow(TestObj*);
};
-v8::Handle<v8::Value> toV8(TestObj*);
-v8::Handle<v8::Value> toV8(PassRefPtr<TestObj >);
+
+v8::Handle<v8::Object> V8TestObj::wrap(TestObj* impl)
+{
+ v8::Handle<v8::Object> wrapper = getDOMObjectMap().get(impl);
+ if (!wrapper.IsEmpty())
+ return wrapper;
+ return V8TestObj::wrapSlow(impl);
+}
+
+inline v8::Handle<v8::Value> toV8(TestObj* impl)
+{
+ if (!impl)
+ return v8::Null();
+ return V8TestObj::wrap(impl);
+}
+inline v8::Handle<v8::Value> toV8(PassRefPtr< TestObj > impl)
+{
+ return toV8(impl.get());
+}
}
#endif // V8TestObj_h
diff --git a/WebCore/fileapi/Flags.idl b/WebCore/fileapi/Flags.idl
index cfe73d2..29658a1 100644
--- a/WebCore/fileapi/Flags.idl
+++ b/WebCore/fileapi/Flags.idl
@@ -30,9 +30,10 @@
module storage {
interface [
- Conditional=FILE_SYSTEM
+ Conditional=FILE_SYSTEM,
+ CanBeConstructed
] Flags {
- attribute boolean CREATE;
- attribute boolean EXCLUSIVE;
+ attribute boolean create;
+ attribute boolean exclusive;
};
}
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index b1c292a..7e48f8c 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -193,6 +193,8 @@ module window {
const unsigned short TEMPORARY = 0;
const unsigned short PERSISTENT = 1;
[EnabledAtRuntime] void requestFileSystem(in unsigned short type, in long long size, in [Callback, Optional] FileSystemCallback successCallback, in [Callback, Optional] ErrorCallback errorCallback);
+
+ attribute [EnabledAtRuntime=FileSystem] FlagsConstructor Flags;
#endif
#if defined(ENABLE_ORIENTATION_EVENTS) && ENABLE_ORIENTATION_EVENTS
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list