Changeset 83115 in webkit


Ignore:
Timestamp:
Apr 6, 2011 4:01:30 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-04-06 Leandro Gracia Gil <leandrogracia@chromium.org>

Reviewed by Steve Block.

Make the style of createFunctionOnlyCallback in V8 consistent with the JavaScriptCore version.
https://bugs.webkit.org/show_bug.cgi?id=57963

No new tests. LayoutTests/fast/dom/Geolocation/argument-types.html

  • bindings/v8/V8Utilities.h: (WebCore::createFunctionOnlyCallback):
  • bindings/v8/custom/V8GeolocationCustom.cpp: (WebCore::V8Geolocation::getCurrentPositionCallback): (WebCore::V8Geolocation::watchPositionCallback):
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r83113 r83115  
     12011-04-06  Leandro Gracia Gil  <leandrogracia@chromium.org>
     2
     3        Reviewed by Steve Block.
     4
     5        Make the style of createFunctionOnlyCallback in V8 consistent with the JavaScriptCore version.
     6        https://bugs.webkit.org/show_bug.cgi?id=57963
     7
     8        No new tests. LayoutTests/fast/dom/Geolocation/argument-types.html
     9
     10        * bindings/v8/V8Utilities.h:
     11        (WebCore::createFunctionOnlyCallback):
     12        * bindings/v8/custom/V8GeolocationCustom.cpp:
     13        (WebCore::V8Geolocation::getCurrentPositionCallback):
     14        (WebCore::V8Geolocation::watchPositionCallback):
     15
    1162011-04-06  Brian Weinstein  <bweinstein@apple.com>
    217
  • trunk/Source/WebCore/bindings/v8/V8Utilities.h

    r82940 r83115  
    5959
    6060    enum CallbackAllowedValueFlag {
    61         CallbackAllowFunction = 0,
    6261        CallbackAllowUndefined = 1,
    6362        CallbackAllowNull = 1 << 1
     
    6867    // 'FunctionOnly' is assumed for the created callback.
    6968    template <typename V8CallbackType>
    70     PassRefPtr<V8CallbackType> createFunctionOnlyCallback(v8::Local<v8::Value> value, CallbackAllowedValueFlags acceptedValues, bool& succeeded)
     69    PassRefPtr<V8CallbackType> createFunctionOnlyCallback(v8::Local<v8::Value> value, bool& succeeded, CallbackAllowedValueFlags acceptedValues = 0)
    7170    {
    7271        succeeded = true;
    7372
    74         if ((value->IsUndefined() && (acceptedValues & CallbackAllowUndefined))
    75             || (value->IsNull() && (acceptedValues & CallbackAllowNull)))
     73        if (value->IsUndefined() && (acceptedValues & CallbackAllowUndefined))
     74            return 0;
     75
     76        if (value->IsNull() && (acceptedValues & CallbackAllowNull))
    7677            return 0;
    7778
  • trunk/Source/WebCore/bindings/v8/custom/V8GeolocationCustom.cpp

    r82940 r83115  
    134134    bool succeeded = false;
    135135
    136     RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8CustomPositionCallback>(args[0], CallbackAllowFunction, succeeded);
     136    RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8CustomPositionCallback>(args[0], succeeded);
    137137    if (!succeeded)
    138138        return v8::Undefined();
     
    140140
    141141    // Argument is optional (hence undefined is allowed), and null is allowed.
    142     RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8CustomPositionErrorCallback>(args[1], CallbackAllowUndefined | CallbackAllowNull, succeeded);
     142    RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8CustomPositionErrorCallback>(args[1], succeeded, CallbackAllowUndefined | CallbackAllowNull);
    143143    if (!succeeded)
    144144        return v8::Undefined();
     
    160160    bool succeeded = false;
    161161
    162     RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8CustomPositionCallback>(args[0], CallbackAllowFunction, succeeded);
     162    RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8CustomPositionCallback>(args[0], succeeded);
    163163    if (!succeeded)
    164164        return v8::Undefined();
     
    166166
    167167    // Argument is optional (hence undefined is allowed), and null is allowed.
    168     RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8CustomPositionErrorCallback>(args[1], CallbackAllowUndefined | CallbackAllowNull, succeeded);
     168    RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8CustomPositionErrorCallback>(args[1], succeeded, CallbackAllowUndefined | CallbackAllowNull);
    169169    if (!succeeded)
    170170        return v8::Undefined();
Note: See TracChangeset for help on using the changeset viewer.