Bug 24977 - Web Inspector: InspectorController is difficult to get to on the Page
Summary: Web Inspector: InspectorController is difficult to get to on the Page
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2009-03-31 18:21 PDT by James Robinson
Modified: 2015-11-20 13:33 PST (History)
6 users (show)

See Also:


Attachments
Adds an inspectorController() const getter on Frame to clean up callsites (6.36 KB, patch)
2009-03-31 18:25 PDT, James Robinson
eric: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Robinson 2009-03-31 18:21:59 PDT
The InspectorController object is accessed through the Page object, which is not trivial to get to from all places that want to since they sometimes have to walk through a number of objects just to get up that high.  Here's an example from ContextMenu.cpp:

    Node* node = m_hitTestResult.innerNonSharedNode();
    if (!node)
        return;

    Frame* frame = node->document()->frame();
    if (!frame)
        return;

    Page* page = frame->page();
    if (!page)
        return;

    if (!page->inspectorController())
        return;
Comment 1 James Robinson 2009-03-31 18:25:02 PDT
Created attachment 29150 [details]
Adds an inspectorController() const getter on Frame to clean up callsites

This patch adds Frame::inspectorController() const, which simply reaches up to the m_page for the InspectorController*.
Comment 2 Eric Seidel (no email) 2009-04-22 11:17:46 PDT
Comment on attachment 29150 [details]
Adds an inspectorController() const getter on Frame to clean up callsites

This looks fine.  I assume that Page::inspectorController() can never be null?

Also, you should consider adding a comment to Frame::inspectorController() in the header, noting that it can return 0.

Otherwise looks good.  r+.  If you don't have commit bit, please upload a new patch if you act on the above comments (or need to make other changes).
Comment 3 Eric Seidel (no email) 2009-04-29 14:43:52 PDT
Comment on attachment 29150 [details]
Adds an inspectorController() const getter on Frame to clean up callsites

Since I don't think James has commit bit, I shouldn't really have marked this r+.
Comment 4 Alexey Proskuryakov 2010-06-12 14:55:33 PDT
James, do you intend to follow up on this?
Comment 5 Radar WebKit Bug Importer 2014-01-12 15:51:42 PST
<rdar://problem/15801448>