| Summary: | Always clear ConsoleClient when Page/WindowShell is destroyed | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> | ||||
| Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | commit-queue, ggaren, joepeck, mark.lam, timothy | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | 528+ (Nightly build) | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Attachments: |
|
||||||
|
Description
Joseph Pecoraro
2014-08-04 12:16:32 PDT
Created attachment 235979 [details]
[PATCH] Proposed Fix
I spent a bit of time trying to create a test for this. I have a manual test case, but it has two setTimeouts of 100ms, which I can't seem to reduce by much. Is that worth adding?
Comment on attachment 235979 [details]
[PATCH] Proposed Fix
r=me
Usually, it is the client's responsibility to clear this pointer, usually in the client object's destructor. Would that approach work here? (I think this patch is fine too, but it would be a bit cleaner for the client to clear its own pointer.) (In reply to comment #3) > Usually, it is the client's responsibility to clear this pointer, usually in the client object's destructor. Would that approach work here? > > (I think this patch is fine too, but it would be a bit cleaner for the client to clear its own pointer.) This is a little more complicated than that. During the lifetime of a page, it seems there may be the potential for multiple DOMWindow objects / JSGlobalObjects. As these come and go (page navigation) we want to make sure we configure the ConsoleClient in each of these to be the PageConsole. Currently this happens in WindowShell initialization and clearing in ScriptController. With one other place in ScriptCachedFrameData::restore when a page is created from the page cache. Here we are fixing an overlooked case in destruction (which doesn't go through the normal clearing path). I agree, this is messy and should be made clearer somehow. Comment on attachment 235979 [details] [PATCH] Proposed Fix Clearing flags on attachment: 235979 Committed r172006: <http://trac.webkit.org/changeset/172006> All reviewed patches have been landed. Closing bug. |