[Gtk][DOM Bindings] Feature-protected interface usage in set/get property must be...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 May 2012 15:28:24 +0000 (15:28 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 May 2012 15:28:24 +0000 (15:28 +0000)
https://bugs.webkit.org/show_bug.cgi?id=86060

Patch by Sriram Neelakandan <sriram.neelakandan@gmail.com> on 2012-05-14
Reviewed by Martin Robinson.

Property set/get functions generated was referencing WebCore::interface without any condition guard.
This issue was triggered usually when an interface gets disabled; For instance; --disable-video, disables WebCore::HTMLMediaElement.
Also updated the GObject binding reference tests

No new tests - covered by existing bindings tests

* bindings/scripts/CodeGeneratorGObject.pm:
(GenerateProperties):
* bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp:
(webkit_dom_test_active_dom_object_get_property):
* bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
(webkit_dom_test_event_constructor_get_property):
* bindings/scripts/test/GObject/WebKitDOMTestException.cpp:
(webkit_dom_test_exception_get_property):
* bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
(webkit_dom_test_interface_set_property):
(webkit_dom_test_interface_get_property):
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_set_property):
(webkit_dom_test_obj_get_property):
* bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
(webkit_dom_test_serialized_script_value_interface_get_property):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@116949 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestException.cpp
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp
Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp

index 0c720f4..d61eff2 100644 (file)
@@ -1,3 +1,33 @@
+2012-05-14  Sriram Neelakandan  <sriram.neelakandan@gmail.com>
+
+        [Gtk][DOM Bindings] Feature-protected interface usage in set/get property must be under condition guards
+        https://bugs.webkit.org/show_bug.cgi?id=86060
+
+        Reviewed by Martin Robinson.
+
+        Property set/get functions generated was referencing WebCore::interface without any condition guard.
+        This issue was triggered usually when an interface gets disabled; For instance; --disable-video, disables WebCore::HTMLMediaElement.
+        Also updated the GObject binding reference tests
+
+        No new tests - covered by existing bindings tests
+
+        * bindings/scripts/CodeGeneratorGObject.pm:
+        (GenerateProperties):
+        * bindings/scripts/test/GObject/WebKitDOMTestActiveDOMObject.cpp:
+        (webkit_dom_test_active_dom_object_get_property):
+        * bindings/scripts/test/GObject/WebKitDOMTestEventConstructor.cpp:
+        (webkit_dom_test_event_constructor_get_property):
+        * bindings/scripts/test/GObject/WebKitDOMTestException.cpp:
+        (webkit_dom_test_exception_get_property):
+        * bindings/scripts/test/GObject/WebKitDOMTestInterface.cpp:
+        (webkit_dom_test_interface_set_property):
+        (webkit_dom_test_interface_get_property):
+        * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+        (webkit_dom_test_obj_set_property):
+        (webkit_dom_test_obj_get_property):
+        * bindings/scripts/test/GObject/WebKitDOMTestSerializedScriptValueInterface.cpp:
+        (webkit_dom_test_serialized_script_value_interface_get_property):
+
 2012-05-14  Alexander Pavlov  <apavlov@chromium.org>
 
         Web Inspector: [Styles] css properties copied into clipboard contain extra line breaks before color values
index 04898db..177d404 100644 (file)
@@ -558,8 +558,10 @@ EOF
     push(@txtGetProps, $txtGetProp);
     if (scalar @readableProperties > 0) {
         $txtGetProp = << "EOF";
+$conditionGuardStart
     ${className}* self = WEBKIT_DOM_${clsCaps}(object);
     $privFunction
+$conditionGuardEnd
 EOF
         push(@txtGetProps, $txtGetProp);
     }
@@ -580,8 +582,10 @@ EOF
 
     if (scalar @writeableProperties > 0) {
         $txtSetProps = << "EOF";
+$conditionGuardStart
     ${className}* self = WEBKIT_DOM_${clsCaps}(object);
     $privFunction
+$conditionGuardEnd
 EOF
         push(@txtSetProps, $txtSetProps);
     }
index cd6ade5..3110d4f 100644 (file)
@@ -111,8 +111,10 @@ static void webkit_dom_test_active_dom_object_set_property(GObject* object, guin
 static void webkit_dom_test_active_dom_object_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec)
 {
     WebCore::JSMainThreadNullState state;
+
     WebKitDOMTestActiveDOMObject* self = WEBKIT_DOM_TEST_ACTIVE_DOM_OBJECT(object);
     WebCore::TestActiveDOMObject* coreSelf = WebKit::core(self);
+
     switch (propertyId) {
     case PROP_EXCITING_ATTR: {
         g_value_set_long(value, coreSelf->excitingAttr());
index 8b3e980..9ed7456 100644 (file)
@@ -110,8 +110,10 @@ static void webkit_dom_test_event_constructor_set_property(GObject* object, guin
 static void webkit_dom_test_event_constructor_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec)
 {
     WebCore::JSMainThreadNullState state;
+
     WebKitDOMTestEventConstructor* self = WEBKIT_DOM_TEST_EVENT_CONSTRUCTOR(object);
     WebCore::TestEventConstructor* coreSelf = WebKit::core(self);
+
     switch (propertyId) {
     case PROP_ATTR1: {
         g_value_take_string(value, convertToUTF8String(coreSelf->attr1()));
index 74fe6a6..089e91f 100644 (file)
@@ -109,8 +109,10 @@ static void webkit_dom_test_exception_set_property(GObject* object, guint proper
 static void webkit_dom_test_exception_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec)
 {
     WebCore::JSMainThreadNullState state;
+
     WebKitDOMTestException* self = WEBKIT_DOM_TEST_EXCEPTION(object);
     WebCore::TestException* coreSelf = WebKit::core(self);
+
     switch (propertyId) {
     case PROP_NAME: {
         g_value_take_string(value, convertToUTF8String(coreSelf->name()));
index fb4734f..45253df 100644 (file)
@@ -111,8 +111,10 @@ static void webkit_dom_test_interface_finalize(GObject* object)
 static void webkit_dom_test_interface_set_property(GObject* object, guint propertyId, const GValue* value, GParamSpec* pspec)
 {
     WebCore::JSMainThreadNullState state;
+#if ENABLE(Condition1) || ENABLE(Condition2)
     WebKitDOMTestInterface* self = WEBKIT_DOM_TEST_INTERFACE(object);
     WebCore::TestInterface* coreSelf = WebKit::core(self);
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
     switch (propertyId) {
     case PROP_SUPPLEMENTAL_STR2: {
 #if ENABLE(Condition1) || ENABLE(Condition2)
@@ -138,8 +140,10 @@ static void webkit_dom_test_interface_set_property(GObject* object, guint proper
 static void webkit_dom_test_interface_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec)
 {
     WebCore::JSMainThreadNullState state;
+#if ENABLE(Condition1) || ENABLE(Condition2)
     WebKitDOMTestInterface* self = WEBKIT_DOM_TEST_INTERFACE(object);
     WebCore::TestInterface* coreSelf = WebKit::core(self);
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
     switch (propertyId) {
     case PROP_SUPPLEMENTAL_STR1: {
 #if ENABLE(Condition1) || ENABLE(Condition2)
index ef72eab..34a8075 100644 (file)
@@ -167,8 +167,10 @@ static void webkit_dom_test_obj_finalize(GObject* object)
 static void webkit_dom_test_obj_set_property(GObject* object, guint propertyId, const GValue* value, GParamSpec* pspec)
 {
     WebCore::JSMainThreadNullState state;
+
     WebKitDOMTestObj* self = WEBKIT_DOM_TEST_OBJ(object);
     WebCore::TestObj* coreSelf = WebKit::core(self);
+
     switch (propertyId) {
     case PROP_UNSIGNED_SHORT_ATTR: {
         coreSelf->setUnsignedShortAttr((g_value_get_uint(value)));
@@ -298,8 +300,10 @@ static void webkit_dom_test_obj_set_property(GObject* object, guint propertyId,
 static void webkit_dom_test_obj_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec)
 {
     WebCore::JSMainThreadNullState state;
+
     WebKitDOMTestObj* self = WEBKIT_DOM_TEST_OBJ(object);
     WebCore::TestObj* coreSelf = WebKit::core(self);
+
     switch (propertyId) {
     case PROP_READ_ONLY_INT_ATTR: {
         g_value_set_long(value, coreSelf->readOnlyIntAttr());
index fe5724e..cf9fd3a 100644 (file)
@@ -125,8 +125,10 @@ static void webkit_dom_test_serialized_script_value_interface_set_property(GObje
 static void webkit_dom_test_serialized_script_value_interface_get_property(GObject* object, guint propertyId, GValue* value, GParamSpec* pspec)
 {
     WebCore::JSMainThreadNullState state;
+#if ENABLE(Condition1) || ENABLE(Condition2)
     WebKitDOMTestSerializedScriptValueInterface* self = WEBKIT_DOM_TEST_SERIALIZED_SCRIPT_VALUE_INTERFACE(object);
     WebCore::TestSerializedScriptValueInterface* coreSelf = WebKit::core(self);
+#endif // ENABLE(Condition1) || ENABLE(Condition2)
     switch (propertyId) {
     case PROP_VALUE: {
 #if ENABLE(Condition1) || ENABLE(Condition2)