WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
82238
Use PassRefPtr in V8DOMWrapper interface to avoid explicit ref() calls
https://bugs.webkit.org/show_bug.cgi?id=82238
Summary
Use PassRefPtr in V8DOMWrapper interface to avoid explicit ref() calls
Adam Klein
Reported
2012-03-26 13:26:08 PDT
Use PassRefPtr in V8DOMWrapper interface to avoid explicit ref() calls
Attachments
Patch
(14.07 KB, patch)
2012-03-26 13:34 PDT
,
Adam Klein
no flags
Details
Formatted Diff
Diff
Patch for landing
(14.33 KB, patch)
2012-03-26 14:45 PDT
,
Adam Klein
no flags
Details
Formatted Diff
Diff
Patch
(14.55 KB, patch)
2012-04-04 16:16 PDT
,
Adam Klein
no flags
Details
Formatted Diff
Diff
Patch
(14.52 KB, patch)
2012-04-04 17:29 PDT
,
Adam Klein
no flags
Details
Formatted Diff
Diff
Show Obsolete
(3)
View All
Add attachment
proposed patch, testcase, etc.
Adam Klein
Comment 1
2012-03-26 13:34:02 PDT
Created
attachment 133878
[details]
Patch
Adam Barth
Comment 2
2012-03-26 14:37:56 PDT
Comment on
attachment 133878
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=133878&action=review
In the words of dglazkov, the old version of this code was awesome.
> Source/WebCore/bindings/v8/V8DOMWindowShell.cpp:417 > - V8DOMWrapper::setJSWrapperForDOMObject(window, v8::Persistent<v8::Object>::New(jsWindow)); > + V8DOMWrapper::setJSWrapperForDOMObject(PassRefPtr<DOMWindow>(window), v8::Persistent<v8::Object>::New(jsWindow));
I don't think you need to call the constructor explicitly. The call should be generated implicitly.
> Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp:113 > // Add object to the wrapper map.
Mayvbe remove this useless comment?
> Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp:68 > // Add object to the wrapper map.
Ditto.
Adam Klein
Comment 3
2012-03-26 14:45:17 PDT
Comment on
attachment 133878
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=133878&action=review
>> Source/WebCore/bindings/v8/V8DOMWindowShell.cpp:417 >> + V8DOMWrapper::setJSWrapperForDOMObject(PassRefPtr<DOMWindow>(window), v8::Persistent<v8::Object>::New(jsWindow)); > > I don't think you need to call the constructor explicitly. The call should be generated implicitly.
I thought so too, but it won't compile without. Seems like the compiler can't figure out that DOMWindow* is implicitly convertible to PassRefPtr<DOMWindow> when it's doing template specialization.
>> Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp:113 >> // Add object to the wrapper map. > > Mayvbe remove this useless comment?
Removed (and the one above).
>> Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp:68 >> // Add object to the wrapper map. > > Ditto.
Removed.
Adam Klein
Comment 4
2012-03-26 14:45:40 PDT
Created
attachment 133895
[details]
Patch for landing
WebKit Review Bot
Comment 5
2012-03-26 15:57:40 PDT
Comment on
attachment 133895
[details]
Patch for landing Clearing flags on attachment: 133895 Committed
r112163
: <
http://trac.webkit.org/changeset/112163
>
WebKit Review Bot
Comment 6
2012-03-26 15:57:45 PDT
All reviewed patches have been landed. Closing bug.
Adam Klein
Comment 7
2012-04-04 16:16:34 PDT
Reopening to attach new patch.
Adam Klein
Comment 8
2012-04-04 16:16:36 PDT
Created
attachment 135708
[details]
Patch
Adam Barth
Comment 9
2012-04-04 17:20:45 PDT
> Reopening to attach new patch.
What's changed in the new patch?
Adam Klein
Comment 10
2012-04-04 17:25:29 PDT
(In reply to
comment #9
)
> > Reopening to attach new patch. > > What's changed in the new patch?
I put this in the ChangeLog: Relanding
r112163
without modification, as it still seems valid. Will watch Chrome Canaries closely for any memory issues. I tried renaming the method to ensure I'd caught all callers and I had. So I suspect there's nothing wrong with this patch. Note that the OOM failures I've gotten complaints about had both this and the "always use setJSWrapper*" patch (
r112318
). So my plan is to leave this patch alone on trunk for awhile to shake out any problems.
Adam Klein
Comment 11
2012-04-04 17:29:46 PDT
Created
attachment 135728
[details]
Patch
Adam Barth
Comment 12
2012-04-04 17:30:26 PDT
Comment on
attachment 135728
[details]
Patch Ok. I missed that part of the ChangeLog.
WebKit Review Bot
Comment 13
2012-04-04 18:38:44 PDT
Comment on
attachment 135728
[details]
Patch Clearing flags on attachment: 135728 Committed
r113272
: <
http://trac.webkit.org/changeset/113272
>
WebKit Review Bot
Comment 14
2012-04-04 18:38:49 PDT
All reviewed patches have been landed. Closing bug.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug