| Index: Source/WebCore/bindings/scripts/CodeGeneratorV8.pm
|
| ===================================================================
|
| --- Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (revision 112582)
|
| +++ Source/WebCore/bindings/scripts/CodeGeneratorV8.pm (working copy)
|
| @@ -434,11 +434,12 @@
|
| END
|
| }
|
|
|
| + my $wrapSlowArgumentType = GetPassRefPtrType($nativeType);
|
| push(@headerContent, <<END);
|
| static v8::Handle<v8::Object> existingWrapper(${nativeType}*);
|
|
|
| private:
|
| - static v8::Handle<v8::Object> wrapSlow(${nativeType}*);
|
| + static v8::Handle<v8::Object> wrapSlow(${wrapSlowArgumentType});
|
| };
|
|
|
| END
|
| @@ -3041,10 +3042,11 @@
|
| my $domMapFunction = GetDomMapFunction($dataNode, $interfaceName);
|
| my $forceNewObjectInput = IsDOMNodeType($interfaceName) ? ", bool forceNewObject" : "";
|
| my $forceNewObjectCall = IsDOMNodeType($interfaceName) ? ", forceNewObject" : "";
|
| + my $wrapSlowArgumentType = GetPassRefPtrType($nativeType);
|
|
|
| push(@implContent, <<END);
|
|
|
| -v8::Handle<v8::Object> ${className}::wrapSlow(${nativeType}* impl)
|
| +v8::Handle<v8::Object> ${className}::wrapSlow(${wrapSlowArgumentType} impl)
|
| {
|
| v8::Handle<v8::Object> wrapper;
|
| V8Proxy* proxy = 0;
|
| @@ -3054,10 +3056,10 @@
|
| push(@implContent, <<END);
|
| if (impl->document()) {
|
| proxy = V8Proxy::retrieve(impl->document()->frame());
|
| - if (proxy && static_cast<Node*>(impl->document()) == static_cast<Node*>(impl)) {
|
| + if (proxy && static_cast<Node*>(impl->document()) == static_cast<Node*>(impl.get())) {
|
| if (proxy->windowShell()->context().IsEmpty() && proxy->windowShell()->initContextIfNeeded()) {
|
| // initContextIfNeeded may have created a wrapper for the object, retry from the start.
|
| - return ${className}::wrap(impl);
|
| + return ${className}::wrap(impl.get());
|
| }
|
| }
|
| }
|
| @@ -3092,7 +3094,7 @@
|
| }
|
|
|
| push(@implContent, <<END);
|
| - wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl);
|
| + wrapper = V8DOMWrapper::instantiateV8Object(proxy, &info, impl.get());
|
| END
|
| if (IsNodeSubType($dataNode) || IsVisibleAcrossOrigins($dataNode)) {
|
| push(@implContent, <<END);
|
| @@ -3106,8 +3108,6 @@
|
| if (wrapper.IsEmpty())
|
| return wrapper;
|
| END
|
| - push(@implContent, "\n impl->ref();\n") if IsRefPtrType($interfaceName);
|
| -
|
| if ($serializedAttribute) {
|
| GenerateEagerDeserialization($serializedAttribute);
|
| }
|
| @@ -3122,12 +3122,9 @@
|
| push(@implContent, <<END);
|
| wrapperHandle.SetWrapperClassId(v8DOMSubtreeClassId);
|
| END
|
| - }
|
| + }
|
| push(@implContent, <<END);
|
| - ${domMapFunction}.set(impl, wrapperHandle);
|
| -END
|
| -
|
| - push(@implContent, <<END);
|
| + ${domMapFunction}.set(impl.leakRef(), wrapperHandle);
|
| return wrapper;
|
| }
|
| END
|
| @@ -3898,6 +3895,14 @@
|
| return "RuntimeEnabledFeatures::" . $codeGenerator->WK_lcfirst($signature->name) . "Enabled";
|
| }
|
|
|
| +sub GetPassRefPtrType
|
| +{
|
| + my $className = shift;
|
| +
|
| + my $angleBracketSpace = $className =~ />$/ ? " " : "";
|
| + return "PassRefPtr<${className}${angleBracketSpace}>";
|
| +}
|
| +
|
| sub DebugPrint
|
| {
|
| my $output = shift;
|
|
|