Bug 141977 - Regression(r164091): Pages using URL.createObjectURL() cannot enter the PageCache
Summary: Regression(r164091): Pages using URL.createObjectURL() cannot enter the PageC...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks: 128532
  Show dependency treegraph
 
Reported: 2015-02-24 10:37 PST by Chris Dumez
Modified: 2015-02-25 17:17 PST (History)
8 users (show)

See Also:


Attachments
Patch (7.80 KB, patch)
2015-02-24 21:23 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2015-02-24 10:37:16 PST
Make PublicURLManager suspendable. There is nothing preventing it from being suspended. It is used on baidu.com and prevents pages from going into the PageCache unnecessarily.

Radar: <rdar://problem/19923085>
Comment 1 Chris Dumez 2015-02-24 11:39:17 PST
This is a regression from <http://trac.webkit.org/changeset/164091>.
Comment 2 Chris Dumez 2015-02-24 11:45:31 PST
At first, I thought I would simply mark PublicURLManager as suspendable. However, I think the correct fix is for PublicURLManager to not be an ActiveDOMObject (because it never causes any JS to be executed).

The reference cycle from Bug 128532 can be likely fixed by clearing the URLRegistry from Document::prepareForDestruction() instead of from ~ScriptExecutionContext().
Comment 3 Byungseon(Sun) Shin 2015-02-24 18:07:30 PST
(In reply to comment #2)
> At first, I thought I would simply mark PublicURLManager as suspendable.
> However, I think the correct fix is for PublicURLManager to not be an
> ActiveDOMObject (because it never causes any JS to be executed).
> 
> The reference cycle from Bug 128532 can be likely fixed by clearing the
> URLRegistry from Document::prepareForDestruction() instead of from
> ~ScriptExecutionContext().

@Chris, thanks for sharing this issue.
I will check memory leakage issue by using "Document::prepareForDestruction()" and update here soon.
Comment 4 Chris Dumez 2015-02-24 18:55:12 PST
(In reply to comment #3)
> (In reply to comment #2)
> > At first, I thought I would simply mark PublicURLManager as suspendable.
> > However, I think the correct fix is for PublicURLManager to not be an
> > ActiveDOMObject (because it never causes any JS to be executed).
> > 
> > The reference cycle from Bug 128532 can be likely fixed by clearing the
> > URLRegistry from Document::prepareForDestruction() instead of from
> > ~ScriptExecutionContext().
> 
> @Chris, thanks for sharing this issue.
> I will check memory leakage issue by using
> "Document::prepareForDestruction()" and update here soon.

I am actually working on it already.
Comment 5 Chris Dumez 2015-02-24 18:56:08 PST
(In reply to comment #4)
> (In reply to comment #3)
> > (In reply to comment #2)
> > > At first, I thought I would simply mark PublicURLManager as suspendable.
> > > However, I think the correct fix is for PublicURLManager to not be an
> > > ActiveDOMObject (because it never causes any JS to be executed).
> > > 
> > > The reference cycle from Bug 128532 can be likely fixed by clearing the
> > > URLRegistry from Document::prepareForDestruction() instead of from
> > > ~ScriptExecutionContext().
> > 
> > @Chris, thanks for sharing this issue.
> > I will check memory leakage issue by using
> > "Document::prepareForDestruction()" and update here soon.
> 
> I am actually working on it already.

The reason I haven't uploaded a patch is because I am trying to figure out why MediaSource would ref the Document in the first place.
Comment 6 Byungseon(Sun) Shin 2015-02-24 20:28:44 PST
(In reply to comment #5)
> (In reply to comment #4)
> > (In reply to comment #3)
> > > (In reply to comment #2)
> > > > At first, I thought I would simply mark PublicURLManager as suspendable.
> > > > However, I think the correct fix is for PublicURLManager to not be an
> > > > ActiveDOMObject (because it never causes any JS to be executed).
> > > > 
> > > > The reference cycle from Bug 128532 can be likely fixed by clearing the
> > > > URLRegistry from Document::prepareForDestruction() instead of from
> > > > ~ScriptExecutionContext().
> > > 
> > > @Chris, thanks for sharing this issue.
> > > I will check memory leakage issue by using
> > > "Document::prepareForDestruction()" and update here soon.
> > 
> > I am actually working on it already.
> 
> The reason I haven't uploaded a patch is because I am trying to figure out
> why MediaSource would ref the Document in the first place.

I see. Thanks for the reply.
Comment 7 Chris Dumez 2015-02-24 21:23:28 PST
Created attachment 247310 [details]
Patch
Comment 8 Andreas Kling 2015-02-25 15:03:22 PST
Comment on attachment 247310 [details]
Patch

I suppose this is reasonable.
Comment 9 WebKit Commit Bot 2015-02-25 15:49:26 PST
Comment on attachment 247310 [details]
Patch

Clearing flags on attachment: 247310

Committed r180646: <http://trac.webkit.org/changeset/180646>
Comment 10 WebKit Commit Bot 2015-02-25 15:49:31 PST
All reviewed patches have been landed.  Closing bug.
Comment 11 Brent Fulgham 2015-02-25 17:13:40 PST
Did you check if eventSender.beginDragWithFiles(). is supported on Windows? The test bots say "NO".  :-|
Comment 12 Brent Fulgham 2015-02-25 17:17:10 PST
Windows marked as Skip in <https://trac.webkit.org/changeset/180650>