Bug 30376 - Web Inspector: Create and update frontend script objects only when web inspector is visible.
Summary: Web Inspector: Create and update frontend script objects only when web inspec...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (Deprecated) (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Pavel Feldman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-10-14 22:28 PDT by Pavel Feldman
Modified: 2009-10-15 02:16 PDT (History)
1 user (show)

See Also:


Attachments
patch (8.29 KB, patch)
2009-10-14 22:30 PDT, Pavel Feldman
timothy: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pavel Feldman 2009-10-14 22:28:00 PDT
All script objects should exist between populateScriptObjects and releaseScriptObjects (i.e. when web inspector window is visible). Replace a number of checks for m_frontend being defined with windowVisible. That actually fixes the following crash:

1. Open a page that has console output
2. Open and close web inspector for it
3. Refresh the page

Console objects were pushed into the web inspector behind the m_frontend check (that was not enough).

I actually think we should simplify the code and dispose the view (along with the m_frontend) when inspector window is closed. I don't like the state of InspectorController when m_frontend (along with the frontend scripts) exists while window is not visible. We are anyway not talking to frontend when it is not viisble.

The downside of disposing frontend is that inspector would loose its state when re-opened. We already maintain active tab state though, so it won't be too bad. What do you think?
Comment 1 Pavel Feldman 2009-10-14 22:30:08 PDT
Created attachment 41207 [details]
patch
Comment 2 Pavel Feldman 2009-10-15 02:16:11 PDT
Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/inspector/InspectorController.cpp
Committed r49614