Changeset 140624 in webkit


Ignore:
Timestamp:
Jan 23, 2013 6:11:18 PM (11 years ago)
Author:
haraken@chromium.org
Message:

[V8] Make an Isolate parameter mandatory in NativeToJS()
https://bugs.webkit.org/show_bug.cgi?id=107663

Reviewed by Adam Barth.

No tests. No change in behavior.

  • bindings/scripts/CodeGeneratorV8.pm:

(GenerateCallbackImplementation):
(NativeToJSValue):

  • bindings/scripts/test/V8/V8TestCallback.cpp:

(WebCore::V8TestCallback::callbackWithClass1Param):
(WebCore::V8TestCallback::callbackWithClass2Param):
(WebCore::V8TestCallback::callbackWithStringList):
(WebCore::V8TestCallback::callbackWithBoolean):
(WebCore::V8TestCallback::callbackRequiresThisToPass):

Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r140622 r140624  
     12013-01-23  Kentaro Hara  <haraken@chromium.org>
     2
     3        [V8] Make an Isolate parameter mandatory in NativeToJS()
     4        https://bugs.webkit.org/show_bug.cgi?id=107663
     5
     6        Reviewed by Adam Barth.
     7
     8        No tests. No change in behavior.
     9
     10        * bindings/scripts/CodeGeneratorV8.pm:
     11        (GenerateCallbackImplementation):
     12        (NativeToJSValue):
     13        * bindings/scripts/test/V8/V8TestCallback.cpp:
     14        (WebCore::V8TestCallback::callbackWithClass1Param):
     15        (WebCore::V8TestCallback::callbackWithClass2Param):
     16        (WebCore::V8TestCallback::callbackWithStringList):
     17        (WebCore::V8TestCallback::callbackWithBoolean):
     18        (WebCore::V8TestCallback::callbackRequiresThisToPass):
     19
    1202013-01-23  Benjamin Poulain  <bpoulain@apple.com>
    221
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r140616 r140624  
    33863386            foreach my $param (@params) {
    33873387                my $paramName = $param->name;
    3388                 push(@implContent, "    v8::Handle<v8::Value> ${paramName}Handle = " . NativeToJSValue($param, $paramName, "v8::Handle<v8::Object>()", "v8::Isolate::GetCurrent()") . ";\n");
     3388                push(@implContent, "    v8::Handle<v8::Value> ${paramName}Handle = " . NativeToJSValue($param, $paramName, "v8::Handle<v8::Object>()", "v8Context->GetIsolate()") . ";\n");
    33893389                push(@implContent, "    if (${paramName}Handle.IsEmpty()) {\n");
    33903390                push(@implContent, "        if (!isScriptControllerTerminating())\n");
     
    40184018    my $getCreationContext = shift;
    40194019    my $getIsolate = shift;
     4020    die "An Isolate is mandatory for native value => JS value conversion." unless $getIsolate;
    40204021    my $getHolderContainer = shift;
    40214022    my $getHolderContainerArg = $getHolderContainer ? ", $getHolderContainer" : "";
     
    40274028    my $type = $signature->type;
    40284029
    4029     return ($getIsolate ? "v8Boolean($value, $getIsolate)" : "v8Boolean($value)") if $type eq "boolean";
     4030    return "v8Boolean($value, $getIsolate)" if $type eq "boolean";
    40304031    return "v8Undefined()" if $type eq "void";     # equivalent to v8Undefined()
    40314032
     
    40584059            die "Unknown value for TreatReturnedNullStringAs extended attribute";
    40594060        }
    4060         return $getIsolate ? "v8String($value, $getIsolate$returnHandleTypeArg)" : "deprecatedV8String($value)";
     4061        return "v8String($value, $getIsolate$returnHandleTypeArg)";
    40614062    }
    40624063
     
    40884089    if ($type eq "EventListener") {
    40894090        AddToImplIncludes("V8AbstractEventListener.h");
    4090         return "${value} ? v8::Handle<v8::Value>(static_cast<V8AbstractEventListener*>(${value})->getListenerObject(imp->scriptExecutionContext())) : v8::Handle<v8::Value>(" . ($getIsolate ? "v8Null($getIsolate)" : "v8::Null()") . ")";
     4091        return "${value} ? v8::Handle<v8::Value>(static_cast<V8AbstractEventListener*>(${value})->getListenerObject(imp->scriptExecutionContext())) : v8::Handle<v8::Value>(v8Null($getIsolate))";
    40914092    }
    40924093
    40934094    if ($type eq "SerializedScriptValue") {
    40944095        AddToImplIncludes("$type.h");
    4095         return "$value ? $value->deserialize() : v8::Handle<v8::Value>(" . ($getIsolate ? "v8Null($getIsolate)" : "v8::Null()") . ")";
     4096        return "$value ? $value->deserialize() : v8::Handle<v8::Value>(v8Null($getIsolate))";
    40964097    }
    40974098
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestCallback.cpp

    r139599 r140624  
    8686    v8::Context::Scope scope(v8Context);
    8787
    88     v8::Handle<v8::Value> class1ParamHandle = toV8(class1Param, v8::Handle<v8::Object>(), v8::Isolate::GetCurrent());
     88    v8::Handle<v8::Value> class1ParamHandle = toV8(class1Param, v8::Handle<v8::Object>(), v8Context->GetIsolate());
    8989    if (class1ParamHandle.IsEmpty()) {
    9090        if (!isScriptControllerTerminating())
     
    114114    v8::Context::Scope scope(v8Context);
    115115
    116     v8::Handle<v8::Value> class2ParamHandle = toV8(class2Param, v8::Handle<v8::Object>(), v8::Isolate::GetCurrent());
     116    v8::Handle<v8::Value> class2ParamHandle = toV8(class2Param, v8::Handle<v8::Object>(), v8Context->GetIsolate());
    117117    if (class2ParamHandle.IsEmpty()) {
    118118        if (!isScriptControllerTerminating())
     
    120120        return true;
    121121    }
    122     v8::Handle<v8::Value> strArgHandle = v8String(strArg, v8::Isolate::GetCurrent());
     122    v8::Handle<v8::Value> strArgHandle = v8String(strArg, v8Context->GetIsolate());
    123123    if (strArgHandle.IsEmpty()) {
    124124        if (!isScriptControllerTerminating())
     
    149149    v8::Context::Scope scope(v8Context);
    150150
    151     v8::Handle<v8::Value> listParamHandle = toV8(listParam, v8::Handle<v8::Object>(), v8::Isolate::GetCurrent());
     151    v8::Handle<v8::Value> listParamHandle = toV8(listParam, v8::Handle<v8::Object>(), v8Context->GetIsolate());
    152152    if (listParamHandle.IsEmpty()) {
    153153        if (!isScriptControllerTerminating())
     
    177177    v8::Context::Scope scope(v8Context);
    178178
    179     v8::Handle<v8::Value> boolParamHandle = v8Boolean(boolParam, v8::Isolate::GetCurrent());
     179    v8::Handle<v8::Value> boolParamHandle = v8Boolean(boolParam, v8Context->GetIsolate());
    180180    if (boolParamHandle.IsEmpty()) {
    181181        if (!isScriptControllerTerminating())
     
    207207    v8::Context::Scope scope(v8Context);
    208208
    209     v8::Handle<v8::Value> class8ParamHandle = toV8(class8Param, v8::Handle<v8::Object>(), v8::Isolate::GetCurrent());
     209    v8::Handle<v8::Value> class8ParamHandle = toV8(class8Param, v8::Handle<v8::Object>(), v8Context->GetIsolate());
    210210    if (class8ParamHandle.IsEmpty()) {
    211211        if (!isScriptControllerTerminating())
     
    213213        return true;
    214214    }
    215     v8::Handle<v8::Value> thisClassParamHandle = toV8(thisClassParam, v8::Handle<v8::Object>(), v8::Isolate::GetCurrent());
     215    v8::Handle<v8::Value> thisClassParamHandle = toV8(thisClassParam, v8::Handle<v8::Object>(), v8Context->GetIsolate());
    216216    if (thisClassParamHandle.IsEmpty()) {
    217217        if (!isScriptControllerTerminating())
Note: See TracChangeset for help on using the changeset viewer.