Changeset 118129 in webkit


Ignore:
Timestamp:
May 22, 2012 11:36:10 PM (12 years ago)
Author:
haraken@chromium.org
Message:

[V8] Pass Isolate to v8::Null() in CodeGeneratorV8.pm
https://bugs.webkit.org/show_bug.cgi?id=87202

Reviewed by Adam Barth.

The objective is to pass Isolate around in V8 bindings.
This patch passes Isolate to v8::Null() in CodeGeneratorV8.pm.

No tests. No change in behavior.

  • bindings/scripts/CodeGeneratorV8.pm:

(GenerateNormalAttrGetter):
(GenerateFunctionCallback):
(NativeToJSValue):

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

(WebCore::TestObjV8Internal::contentDocumentAttrGetter):
(WebCore::TestObjV8Internal::getSVGDocumentCallback):

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

(WebCore::TestSerializedScriptValueInterfaceV8Internal::valueAttrGetter):
(WebCore::TestSerializedScriptValueInterfaceV8Internal::readonlyValueAttrGetter):
(WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedValueAttrGetter):
(WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedReadonlyValueAttrGetter):

Location:
trunk/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r118128 r118129  
     12012-05-22  Kentaro Hara  <haraken@chromium.org>
     2
     3        [V8] Pass Isolate to v8::Null() in CodeGeneratorV8.pm
     4        https://bugs.webkit.org/show_bug.cgi?id=87202
     5
     6        Reviewed by Adam Barth.
     7
     8        The objective is to pass Isolate around in V8 bindings.
     9        This patch passes Isolate to v8::Null() in CodeGeneratorV8.pm.
     10
     11        No tests. No change in behavior.
     12
     13        * bindings/scripts/CodeGeneratorV8.pm:
     14        (GenerateNormalAttrGetter):
     15        (GenerateFunctionCallback):
     16        (NativeToJSValue):
     17        * bindings/scripts/test/V8/V8TestObj.cpp:
     18        (WebCore::TestObjV8Internal::contentDocumentAttrGetter):
     19        (WebCore::TestObjV8Internal::getSVGDocumentCallback):
     20        * bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp:
     21        (WebCore::TestSerializedScriptValueInterfaceV8Internal::valueAttrGetter):
     22        (WebCore::TestSerializedScriptValueInterfaceV8Internal::readonlyValueAttrGetter):
     23        (WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedValueAttrGetter):
     24        (WebCore::TestSerializedScriptValueInterfaceV8Internal::cachedReadonlyValueAttrGetter):
     25
    1262012-05-22  Andreas Kling  <kling@webkit.org>
    227
  • trunk/Source/WebCore/bindings/scripts/CodeGeneratorV8.pm

    r118120 r118129  
    843843    # Generate security checks if necessary
    844844    if ($attribute->signature->extendedAttributes->{"CheckSecurityForNode"}) {
    845         push(@implContentDecls, "    if (!V8BindingSecurity::shouldAllowAccessToNode(V8BindingState::Only(), imp->" . $attribute->signature->name . "()))\n        return v8::Handle<v8::Value>(v8::Null());\n\n");
     845        push(@implContentDecls, "    if (!V8BindingSecurity::shouldAllowAccessToNode(V8BindingState::Only(), imp->" . $attribute->signature->name . "()))\n        return v8::Handle<v8::Value>(v8::Null(info.GetIsolate()));\n\n");
    846846    }
    847847
     
    10051005            push(@implContentDecls, <<END);
    10061006    SerializedScriptValue* serialized = imp->${getterFunc}();
    1007     value = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8::Null());
     1007    value = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()));
    10081008    info.Holder()->SetHiddenValue(propertyName, value);
    10091009    return value;
     
    14381438    if ($function->signature->extendedAttributes->{"CheckSecurityForNode"}) {
    14391439        push(@implContentDecls, "    if (!V8BindingSecurity::shouldAllowAccessToNode(V8BindingState::Only(), imp->" . $function->signature->name . "(ec)))\n");
    1440         push(@implContentDecls, "        return v8::Handle<v8::Value>(v8::Null());\n");
     1440        push(@implContentDecls, "        return v8::Handle<v8::Value>(v8::Null(args.GetIsolate()));\n");
    14411441END
    14421442    }
     
    38603860    if ($type eq "EventListener") {
    38613861        AddToImplIncludes("V8AbstractEventListener.h");
    3862         return "${value} ? v8::Handle<v8::Value>(static_cast<V8AbstractEventListener*>(${value})->getListenerObject(imp->scriptExecutionContext())) : v8::Handle<v8::Value>(v8::Null())";
     3862        return "${value} ? v8::Handle<v8::Value>(static_cast<V8AbstractEventListener*>(${value})->getListenerObject(imp->scriptExecutionContext())) : v8::Handle<v8::Value>(v8::Null($getIsolate))";
    38633863    }
    38643864
    38653865    if ($type eq "SerializedScriptValue") {
    38663866        AddToImplIncludes("$type.h");
    3867         return "$value ? $value->deserialize() : v8::Handle<v8::Value>(v8::Null())";
     3867        return "$value ? $value->deserialize() : v8::Handle<v8::Value>(v8::Null($getIsolate))";
    38683868    }
    38693869
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestObj.cpp

    r118075 r118129  
    11351135    TestObj* imp = V8TestObj::toNative(info.Holder());
    11361136    if (!V8BindingSecurity::shouldAllowAccessToNode(V8BindingState::Only(), imp->contentDocument()))
    1137         return v8::Handle<v8::Value>(v8::Null());
     1137        return v8::Handle<v8::Value>(v8::Null(info.GetIsolate()));
    11381138
    11391139    return toV8(imp->contentDocument(), info.GetIsolate());
     
    19051905    {
    19061906    if (!V8BindingSecurity::shouldAllowAccessToNode(V8BindingState::Only(), imp->getSVGDocument(ec)))
    1907         return v8::Handle<v8::Value>(v8::Null());
     1907        return v8::Handle<v8::Value>(v8::Null(args.GetIsolate()));
    19081908    RefPtr<SVGDocument> result = imp->getSVGDocument(ec);
    19091909    if (UNLIKELY(ec))
  • trunk/Source/WebCore/bindings/scripts/test/V8/V8TestSerializedScriptValueInterface.cpp

    r117925 r118129  
    5151    INC_STATS("DOM.TestSerializedScriptValueInterface.value._get");
    5252    TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(info.Holder());
    53     return imp->value() ? imp->value()->deserialize() : v8::Handle<v8::Value>(v8::Null());
     53    return imp->value() ? imp->value()->deserialize() : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()));
    5454}
    5555
     
    6767    INC_STATS("DOM.TestSerializedScriptValueInterface.readonlyValue._get");
    6868    TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(info.Holder());
    69     return imp->readonlyValue() ? imp->readonlyValue()->deserialize() : v8::Handle<v8::Value>(v8::Null());
     69    return imp->readonlyValue() ? imp->readonlyValue()->deserialize() : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()));
    7070}
    7171
     
    7979    TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(info.Holder());
    8080    SerializedScriptValue* serialized = imp->cachedValue();
    81     value = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8::Null());
     81    value = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()));
    8282    info.Holder()->SetHiddenValue(propertyName, value);
    8383    return value;
     
    117117    TestSerializedScriptValueInterface* imp = V8TestSerializedScriptValueInterface::toNative(info.Holder());
    118118    SerializedScriptValue* serialized = imp->cachedReadonlyValue();
    119     value = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8::Null());
     119    value = serialized ? serialized->deserialize() : v8::Handle<v8::Value>(v8::Null(info.GetIsolate()));
    120120    info.Holder()->SetHiddenValue(propertyName, value);
    121121    return value;
Note: See TracChangeset for help on using the changeset viewer.