Changeset 117730 in webkit


Ignore:
Timestamp:
May 20, 2012 10:53:42 PM (12 years ago)
Author:
haraken@chromium.org
Message:

[V8] Pass Isolate to V8Utilities::createFunctionCallback()
https://bugs.webkit.org/show_bug.cgi?id=86978

Reviewed by Adam Barth.

The objective is to pass Isolate around in V8 bindings.
This patch passes Isolate to V8Utilities::createFunctionCallback().

No tests. No change in behavior.

  • bindings/v8/V8Utilities.cpp:

(WebCore::throwTypeMismatchException):

  • bindings/v8/V8Utilities.h:

(WebCore):
(WebCore::createFunctionOnlyCallback):

  • bindings/v8/custom/V8GeolocationCustom.cpp:

(WebCore::V8Geolocation::getCurrentPositionCallback):
(WebCore::V8Geolocation::watchPositionCallback):

  • bindings/v8/custom/V8NotificationCustom.cpp:

(WebCore::V8Notification::requestPermissionCallback):

Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r117728 r117730  
     12012-05-20  Kentaro Hara  <haraken@chromium.org>
     2
     3        [V8] Pass Isolate to V8Utilities::createFunctionCallback()
     4        https://bugs.webkit.org/show_bug.cgi?id=86978
     5
     6        Reviewed by Adam Barth.
     7
     8        The objective is to pass Isolate around in V8 bindings.
     9        This patch passes Isolate to V8Utilities::createFunctionCallback().
     10
     11        No tests. No change in behavior.
     12
     13        * bindings/v8/V8Utilities.cpp:
     14        (WebCore::throwTypeMismatchException):
     15        * bindings/v8/V8Utilities.h:
     16        (WebCore):
     17        (WebCore::createFunctionOnlyCallback):
     18        * bindings/v8/custom/V8GeolocationCustom.cpp:
     19        (WebCore::V8Geolocation::getCurrentPositionCallback):
     20        (WebCore::V8Geolocation::watchPositionCallback):
     21        * bindings/v8/custom/V8NotificationCustom.cpp:
     22        (WebCore::V8Notification::requestPermissionCallback):
     23
    1242012-05-20  Kentaro Hara  <haraken@chromium.org>
    225
  • trunk/Source/WebCore/bindings/v8/V8Utilities.cpp

    r117536 r117730  
    203203}
    204204
    205 void throwTypeMismatchException()
    206 {
    207     V8Proxy::throwError(V8Proxy::GeneralError, "TYPE_MISMATCH_ERR: DOM Exception 17");
     205void throwTypeMismatchException(v8::Isolate* isolate)
     206{
     207    V8Proxy::throwError(V8Proxy::GeneralError, "TYPE_MISMATCH_ERR: DOM Exception 17", isolate);
    208208}
    209209
  • trunk/Source/WebCore/bindings/v8/V8Utilities.h

    r112184 r117730  
    6161    ScriptExecutionContext* getScriptExecutionContext();
    6262
    63     void throwTypeMismatchException();
     63    void throwTypeMismatchException(v8::Isolate*);
    6464
    6565    enum CallbackAllowedValueFlag {
     
    9191    // 'FunctionOnly' is assumed for the created callback.
    9292    template <typename V8CallbackType>
    93     PassRefPtr<V8CallbackType> createFunctionOnlyCallback(v8::Local<v8::Value> value, bool& succeeded, CallbackAllowedValueFlags acceptedValues = 0)
     93    PassRefPtr<V8CallbackType> createFunctionOnlyCallback(v8::Local<v8::Value> value, bool& succeeded, v8::Isolate* isolate, CallbackAllowedValueFlags acceptedValues = 0)
    9494    {
    9595        succeeded = true;
     
    103103        if (!value->IsFunction()) {
    104104            succeeded = false;
    105             throwTypeMismatchException();
     105            throwTypeMismatchException(isolate);
    106106            return 0;
    107107        }
  • trunk/Source/WebCore/bindings/v8/custom/V8GeolocationCustom.cpp

    r95901 r117730  
    134134    bool succeeded = false;
    135135
    136     RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8PositionCallback>(args[0], succeeded);
     136    RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8PositionCallback>(args[0], succeeded, args.GetIsolate());
    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<V8PositionErrorCallback>(args[1], succeeded, CallbackAllowUndefined | CallbackAllowNull);
     142    RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8PositionErrorCallback>(args[1], succeeded, args.GetIsolate(), CallbackAllowUndefined | CallbackAllowNull);
    143143    if (!succeeded)
    144144        return v8::Undefined();
     
    160160    bool succeeded = false;
    161161
    162     RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8PositionCallback>(args[0], succeeded);
     162    RefPtr<PositionCallback> positionCallback = createFunctionOnlyCallback<V8PositionCallback>(args[0], succeeded, args.GetIsolate());
    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<V8PositionErrorCallback>(args[1], succeeded, CallbackAllowUndefined | CallbackAllowNull);
     168    RefPtr<PositionErrorCallback> positionErrorCallback = createFunctionOnlyCallback<V8PositionErrorCallback>(args[1], succeeded, args.GetIsolate(), CallbackAllowUndefined | CallbackAllowNull);
    169169    if (!succeeded)
    170170        return v8::Undefined();
  • trunk/Source/WebCore/bindings/v8/custom/V8NotificationCustom.cpp

    r115943 r117730  
    4040
    4141    bool succeeded = false;
    42     RefPtr<V8NotificationPermissionCallback> callback = createFunctionOnlyCallback<V8NotificationPermissionCallback>(args[0], succeeded);
     42    RefPtr<V8NotificationPermissionCallback> callback = createFunctionOnlyCallback<V8NotificationPermissionCallback>(args[0], succeeded, args.GetIsolate());
    4343    if (!succeeded)
    4444        return v8::Undefined();
Note: See TracChangeset for help on using the changeset viewer.