Changeset 58345 in webkit


Ignore:
Timestamp:
Apr 27, 2010 3:51:27 PM (14 years ago)
Author:
jamesr@google.com
Message:

2010-04-27 James Robinson <jamesr@chromium.org>

Reviewed by Adam Barth.

Fix gcc 4.4.1 warnings on Linux in the chromium V8 bindings code.
https://bugs.webkit.org/show_bug.cgi?id=38153

  • bindings/scripts/CodeGeneratorV8.pm:
  • bindings/v8/V8Proxy.cpp: (WebCore::V8Proxy::callFunction):
Location:
trunk/WebCore
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r58342 r58345  
     12010-04-27  James Robinson  <jamesr@chromium.org>
     2
     3        Reviewed by Adam Barth.
     4
     5        Fix gcc 4.4.1 warnings on Linux in the chromium V8 bindings code.
     6        https://bugs.webkit.org/show_bug.cgi?id=38153
     7
     8        * bindings/scripts/CodeGeneratorV8.pm:
     9        * bindings/v8/V8Proxy.cpp:
     10        (WebCore::V8Proxy::callFunction):
     11
    1122010-04-27  Eric Seidel  <eric@webkit.org>
    213
  • trunk/WebCore/bindings/scripts/CodeGeneratorGObject.pm

    r58108 r58345  
    209209                 "char", "char",
    210210                 "long", "long",
     211                 "long long", "int64",
    211212                 "short", "int",
    212213                 "uchar", "uchar",
     
    233234                 "char", "gchar",
    234235                 "long", "glong",
     236                 "long long", "gint64",
    235237                 "short", "gshort",
    236238                 "uchar", "guchar",
     
    256258    return 0 if $type eq "char";
    257259    return 0 if $type eq "long";
     260    return 0 if $type eq "long long";
    258261    return 0 if $type eq "short";
    259262    return 0 if $type eq "uchar";
     
    440443                          "uint64", "0, /* min */\nG_MAXUINT64, /* min */\n0, /* default */",
    441444                          "long", "G_MINLONG, /* min */\nG_MAXLONG, /* max */\n0, /* default */",
     445                          "int64", "G_MININT64, /* min */\nG_MAXINT64, /* max */\n0, /* default */",
    442446                          "ulong", "0, /* min */\nG_MAXULONG, /* max */\n0, /* default */",
    443447                          "uint", "0, /* min */\nG_MAXUINT, /* max */\n0, /* default */",
     
    585589    return "" if $type eq "int";
    586590    return "" if $type eq "long";
     591    return "" if $type eq "long long";
    587592    return "" if $type eq "short";
    588593    return "" if $type eq "char";
  • trunk/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r58333 r58345  
    28532853
    28542854    return "return v8DateOrNull($value)" if $type eq "Date";
     2855    # long long and unsigned long long are not representable in ECMAScript.
     2856    return "return v8::Number::New(static_cast<double>($value))" if $type eq "long long" or $type eq "unsigned long long";
    28552857    return "return v8::Number::New($value)" if $codeGenerator->IsPrimitiveType($type) or $type eq "SVGPaintType";
    28562858    return "return $value.v8Value()" if $nativeType eq "ScriptValue";
  • trunk/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp

    r58333 r58345  
    322322}
    323323
     324gint64
     325webkit_dom_test_obj_get_long_long_attr (WebKitDOMTestObj *self)
     326{
     327    g_return_val_if_fail (self, 0);
     328    WebCore::TestObj * item = WebKit::core(self);
     329    gint64 res = item->longLongAttr();
     330    return res;
     331
     332}
     333
     334void
     335webkit_dom_test_obj_set_long_long_attr (WebKitDOMTestObj *self, gint64 value)
     336{
     337    g_return_if_fail (self);
     338    WebCore::TestObj * item = WebKit::core(self);
     339    item->setLongLongAttr(value);
     340
     341}
     342
     343guint64
     344webkit_dom_test_obj_get_unsigned_long_long_attr (WebKitDOMTestObj *self)
     345{
     346    g_return_val_if_fail (self, 0);
     347    WebCore::TestObj * item = WebKit::core(self);
     348    guint64 res = item->unsignedLongLongAttr();
     349    return res;
     350
     351}
     352
     353void
     354webkit_dom_test_obj_set_unsigned_long_long_attr (WebKitDOMTestObj *self, guint64 value)
     355{
     356    g_return_if_fail (self);
     357    WebCore::TestObj * item = WebKit::core(self);
     358    item->setUnsignedLongLongAttr(value);
     359
     360}
     361
    324362gchar*
    325363webkit_dom_test_obj_get_string_attr (WebKitDOMTestObj *self)
     
    463501    PROP_READ_ONLY_TEST_OBJ_ATTR,
    464502    PROP_INT_ATTR,
     503    PROP_LONG_LONG_ATTR,
     504    PROP_UNSIGNED_LONG_LONG_ATTR,
    465505    PROP_STRING_ATTR,
    466506    PROP_TEST_OBJ_ATTR,
     
    499539         break;
    500540    }
     541    case PROP_UNSIGNED_LONG_LONG_ATTR:
     542    {
     543         coreSelf->setUnsignedLongLongAttr((g_value_get_uint64(value)) );
     544         break;
     545    }
    501546    case PROP_STRING_ATTR:
    502547    {
     
    556601    {
    557602         g_value_set_long(value, coreSelf->intAttr());
     603         break;
     604    }
     605    case PROP_LONG_LONG_ATTR:
     606    {
     607         g_value_set_int64(value, coreSelf->longLongAttr());
     608         break;
     609    }
     610    case PROP_UNSIGNED_LONG_LONG_ATTR:
     611    {
     612         g_value_set_uint64(value, coreSelf->unsignedLongLongAttr());
    558613         break;
    559614    }
     
    636691                                                           WEBKIT_PARAM_READWRITE));
    637692     g_object_class_install_property(gobjectClass,
     693                                    PROP_LONG_LONG_ATTR,
     694                                    g_param_spec_int64("long-long-attr", /* name */
     695                                                           "test_obj_long-long-attr", /* short description */
     696                                                           "read-write  gint64 TestObj.long-long-attr", /* longer - could do with some extra doc stuff here */
     697                                                           G_MININT64, /* min */
     698G_MAXINT64, /* max */
     6990, /* default */
     700                                                           WEBKIT_PARAM_READWRITE));
     701     g_object_class_install_property(gobjectClass,
     702                                    PROP_UNSIGNED_LONG_LONG_ATTR,
     703                                    g_param_spec_uint64("unsigned-long-long-attr", /* name */
     704                                                           "test_obj_unsigned-long-long-attr", /* short description */
     705                                                           "read-write  guint64 TestObj.unsigned-long-long-attr", /* longer - could do with some extra doc stuff here */
     706                                                           0, /* min */
     707G_MAXUINT64, /* min */
     7080, /* default */
     709                                                           WEBKIT_PARAM_READWRITE));
     710     g_object_class_install_property(gobjectClass,
    638711                                    PROP_STRING_ATTR,
    639712                                    g_param_spec_string("string-attr", /* name */
  • trunk/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h

    r58333 r58345  
    128128webkit_dom_test_obj_set_int_attr (WebKitDOMTestObj *self, glong value);
    129129
     130WEBKIT_API gint64
     131webkit_dom_test_obj_get_long_long_attr (WebKitDOMTestObj *self);
     132
     133WEBKIT_API void
     134webkit_dom_test_obj_set_long_long_attr (WebKitDOMTestObj *self, gint64 value);
     135
     136WEBKIT_API guint64
     137webkit_dom_test_obj_get_unsigned_long_long_attr (WebKitDOMTestObj *self);
     138
     139WEBKIT_API void
     140webkit_dom_test_obj_set_unsigned_long_long_attr (WebKitDOMTestObj *self, guint64 value);
     141
    130142WEBKIT_API gchar*
    131143webkit_dom_test_obj_get_string_attr (WebKitDOMTestObj *self);
  • trunk/WebCore/bindings/scripts/test/JS/JSTestObj.cpp

    r58333 r58345  
    4646#endif
    4747
    48 static const HashTableValue JSTestObjTableValues[12] =
     48static const HashTableValue JSTestObjTableValues[14] =
    4949{
    5050    { "readOnlyIntAttr", DontDelete|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyIntAttr), (intptr_t)0 THUNK_GENERATOR(0) },
     
    5252    { "readOnlyTestObjAttr", DontDelete|ReadOnly, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReadOnlyTestObjAttr), (intptr_t)0 THUNK_GENERATOR(0) },
    5353    { "intAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjIntAttr), (intptr_t)setJSTestObjIntAttr THUNK_GENERATOR(0) },
     54    { "longLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjLongLongAttr), (intptr_t)setJSTestObjLongLongAttr THUNK_GENERATOR(0) },
     55    { "unsignedLongLongAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjUnsignedLongLongAttr), (intptr_t)setJSTestObjUnsignedLongLongAttr THUNK_GENERATOR(0) },
    5456    { "stringAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttr), (intptr_t)setJSTestObjStringAttr THUNK_GENERATOR(0) },
    5557    { "testObjAttr", DontDelete, (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTestObjAttr), (intptr_t)setJSTestObjTestObjAttr THUNK_GENERATOR(0) },
     
    248250}
    249251
     252JSValue jsTestObjLongLongAttr(ExecState* exec, JSValue slotBase, const Identifier&)
     253{
     254    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
     255    UNUSED_PARAM(exec);
     256    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
     257    JSValue result = jsNumber(exec, imp->longLongAttr());
     258    return result;
     259}
     260
     261JSValue jsTestObjUnsignedLongLongAttr(ExecState* exec, JSValue slotBase, const Identifier&)
     262{
     263    JSTestObj* castedThis = static_cast<JSTestObj*>(asObject(slotBase));
     264    UNUSED_PARAM(exec);
     265    TestObj* imp = static_cast<TestObj*>(castedThis->impl());
     266    JSValue result = jsNumber(exec, imp->unsignedLongLongAttr());
     267    return result;
     268}
     269
    250270JSValue jsTestObjStringAttr(ExecState* exec, JSValue slotBase, const Identifier&)
    251271{
     
    314334    TestObj* imp = static_cast<TestObj*>(castedThisObj->impl());
    315335    imp->setIntAttr(value.toInt32(exec));
     336}
     337
     338void setJSTestObjLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value)
     339{
     340    JSTestObj* castedThisObj = static_cast<JSTestObj*>(thisObject);
     341    TestObj* imp = static_cast<TestObj*>(castedThisObj->impl());
     342    imp->setLongLongAttr(static_cast<long long>(value.toInteger(exec)));
     343}
     344
     345void setJSTestObjUnsignedLongLongAttr(ExecState* exec, JSObject* thisObject, JSValue value)
     346{
     347    JSTestObj* castedThisObj = static_cast<JSTestObj*>(thisObject);
     348    TestObj* imp = static_cast<TestObj*>(castedThisObj->impl());
     349    imp->setUnsignedLongLongAttr(static_cast<unsigned long long>(value.toInteger(exec)));
    316350}
    317351
  • trunk/WebCore/bindings/scripts/test/JS/JSTestObj.h

    r58333 r58345  
    117117JSC::JSValue jsTestObjIntAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
    118118void setJSTestObjIntAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
     119JSC::JSValue jsTestObjLongLongAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
     120void setJSTestObjLongLongAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
     121JSC::JSValue jsTestObjUnsignedLongLongAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
     122void setJSTestObjUnsignedLongLongAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
    119123JSC::JSValue jsTestObjStringAttr(JSC::ExecState*, JSC::JSValue, const JSC::Identifier&);
    120124void setJSTestObjStringAttr(JSC::ExecState*, JSC::JSObject*, JSC::JSValue);
  • trunk/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h

    r58333 r58345  
    4040- (int)intAttr;
    4141- (void)setIntAttr:(int)newIntAttr;
     42- (long long)longLongAttr;
     43- (void)setLongLongAttr:(long long)newLongLongAttr;
     44- (unsigned long long)unsignedLongLongAttr;
     45- (void)setUnsignedLongLongAttr:(unsigned long long)newUnsignedLongLongAttr;
    4246- (NSString *)stringAttr;
    4347- (void)setStringAttr:(NSString *)newStringAttr;
  • trunk/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm

    r58333 r58345  
    9595}
    9696
     97- (long long)longLongAttr
     98{
     99    return IMPL->longLongAttr();
     100}
     101
     102- (void)setLongLongAttr:(long long)newLongLongAttr
     103{
     104    IMPL->setLongLongAttr(newLongLongAttr);
     105}
     106
     107- (unsigned long long)unsignedLongLongAttr
     108{
     109    return IMPL->unsignedLongLongAttr();
     110}
     111
     112- (void)setUnsignedLongLongAttr:(unsigned long long)newUnsignedLongLongAttr
     113{
     114    IMPL->setUnsignedLongLongAttr(newUnsignedLongLongAttr);
     115}
     116
    97117- (NSString *)stringAttr
    98118{
  • trunk/WebCore/bindings/scripts/test/TestObj.idl

    r58333 r58345  
    3636        readonly attribute TestObj         readOnlyTestObjAttr;
    3737        attribute long                     intAttr;
     38        attribute long long                longLongAttr;
     39        attribute unsigned long long       unsignedLongLongAttr;
    3840        attribute DOMString                stringAttr;
    3941        attribute TestObj                  testObjAttr;
  • trunk/WebCore/bindings/scripts/test/V8/V8TestObj.cpp

    r58333 r58345  
    8787}
    8888
     89static v8::Handle<v8::Value> longLongAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
     90{
     91    INC_STATS("DOM.TestObj.longLongAttr._get");
     92    TestObj* imp = V8TestObj::toNative(info.Holder());
     93    return v8::Number::New(static_cast<double>(imp->longLongAttr()));
     94}
     95
     96static void longLongAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
     97{
     98    INC_STATS("DOM.TestObj.longLongAttr._set");
     99    TestObj* imp = V8TestObj::toNative(info.Holder());
     100    long long v = toInt64(value);
     101    imp->setLongLongAttr(WTF::getPtr(v));
     102    return;
     103}
     104
     105static v8::Handle<v8::Value> unsignedLongLongAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
     106{
     107    INC_STATS("DOM.TestObj.unsignedLongLongAttr._get");
     108    TestObj* imp = V8TestObj::toNative(info.Holder());
     109    return v8::Number::New(static_cast<double>(imp->unsignedLongLongAttr()));
     110}
     111
     112static void unsignedLongLongAttrAttrSetter(v8::Local<v8::String> name, v8::Local<v8::Value> value, const v8::AccessorInfo& info)
     113{
     114    INC_STATS("DOM.TestObj.unsignedLongLongAttr._set");
     115    TestObj* imp = V8TestObj::toNative(info.Holder());
     116    unsigned long long v = toInt64(value);
     117    imp->setUnsignedLongLongAttr(WTF::getPtr(v));
     118    return;
     119}
     120
    89121static v8::Handle<v8::Value> stringAttrAttrGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
    90122{
     
    523555    // Attribute 'intAttr' (Type: 'attribute' ExtAttr: '')
    524556    {"intAttr", TestObjInternal::intAttrAttrGetter, TestObjInternal::intAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
     557    // Attribute 'longLongAttr' (Type: 'attribute' ExtAttr: '')
     558    {"longLongAttr", TestObjInternal::longLongAttrAttrGetter, TestObjInternal::longLongAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
     559    // Attribute 'unsignedLongLongAttr' (Type: 'attribute' ExtAttr: '')
     560    {"unsignedLongLongAttr", TestObjInternal::unsignedLongLongAttrAttrGetter, TestObjInternal::unsignedLongLongAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
    525561    // Attribute 'stringAttr' (Type: 'attribute' ExtAttr: '')
    526562    {"stringAttr", TestObjInternal::stringAttrAttrGetter, TestObjInternal::stringAttrAttrSetter, 0 /* no data */, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
  • trunk/WebCore/bindings/v8/V8Proxy.cpp

    r57269 r58345  
    475475#if ENABLE(INSPECTOR)
    476476        Page* inspectedPage = InspectorTimelineAgent::instanceCount() ? m_frame->page(): 0;
    477         if (inspectedPage)
     477        if (inspectedPage) {
    478478            if (InspectorTimelineAgent* timelineAgent = inspectedPage->inspectorTimelineAgent()) {
    479479                v8::ScriptOrigin origin = function->GetScriptOrigin();
     
    487487            } else
    488488                inspectedPage = 0;
     489        }
    489490#endif // !ENABLE(INSPECTOR)
    490491
Note: See TracChangeset for help on using the changeset viewer.