[Webkit-unassigned] [Bug 33096] [Qt] DRT: Support evaluateInWebInspector(), setTimerProfilingEnabled() and display().

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 26 12:21:19 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=33096





--- Comment #42 from Robert Hogan <robert at roberthogan.net>  2010-01-26 12:21:17 PST ---
(In reply to comment #41)
> 
> Ahhh, I see!
> 
> Then it might be even better not to recreate the page each time.
> What do you think about fixing it this way instead?

That decision is made by WebCore in show() and close() so seems difficult to
work around:

void InspectorController::show()
{
<..>
    if (!m_page) {
        if (m_frontend)
            return;  // We are using custom frontend - no need to create page.

        m_page = m_client->createPage();
        if (!m_page)
            return;
        m_page->setParentInspectorController(this);

        // showWindow() will be called after the page loads in
scriptObjectReady()
        return;
    }

    showWindow();
}


and

void InspectorController::close()
{
<..>
    closeWindow();
<..>
    if (m_page) {
        if (!m_page->mainFrame() || !m_page->mainFrame()->loader() ||
!m_page->mainFrame()->loader()->isLoading()) {
            m_page->setParentInspectorController(0);
            m_page = 0;
        }
    }
}

I think the best thing to do might be:

Page* InspectorClientQt::createPage()
{
    QWebView* inspectorView = new QWebView;
    InspectorClientWebPage* inspectorPage = new
InspectorClientWebPage(inspectorView);
    inspectorView->setPage(inspectorPage);

    // QWebInspector::frontEnd is a copy of inspectorView which will be left
dangling
    // by m_inspectorView.set(inspectorView) if we do not clear it here. This
can
    // happen when the inspector is managed through repeated calls to
    // inspectorController()->show() and inspectorController()->close()
    // on the same QWebPage such as by the Qt DRT.
    m_inspectedWebPage->d->getOrCreateInspector()->d->setFrontend(0);
    m_inspectorView.set(inspectorView);
    <..>
}

After all, if we're going to delete an object, best to ensure that all other
references to it are cleared first!

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list