Bug 150776

Summary: Move the ResourceUsageOverlay out of the way by default.
Product: WebKit Reporter: Andreas Kling <kling>
Component: WebCore Misc.Assignee: Andreas Kling <kling>
Status: RESOLVED FIXED    
Severity: Normal CC: kling
Priority: P2    
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch darin: review+

Description Andreas Kling 2015-11-01 11:17:46 PST
It's annoying that it starts out in the top left corner of the viewport. You have to drag it away every time.
Comment 1 Andreas Kling 2015-11-01 11:18:22 PST
Created attachment 264523 [details]
Patch
Comment 2 Darin Adler 2015-11-01 12:45:03 PST
Comment on attachment 264523 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=264523&action=review

> Source/WebCore/page/ResourceUsageOverlay.cpp:60
> +    FrameView& frameView = *m_page.mainFrame().view();

What guarantees the view is non-null?
Comment 3 Andreas Kling 2015-11-01 13:45:45 PST
(In reply to comment #2)
> Comment on attachment 264523 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=264523&action=review
> 
> > Source/WebCore/page/ResourceUsageOverlay.cpp:60
> > +    FrameView& frameView = *m_page.mainFrame().view();
> 
> What guarantees the view is non-null?

Through the magic of the initial empty document load, which happens by way of WebKit calling into Frame::init() on the MainFrame during WebPage bringup, we end up constructing a FrameView when transitioning to committed state.

This all happens before the ResourceUsageOverlay is constructed (when the setting is flipped to true, either during WebPage::updatePreferences(), or at any time later through WebCore::Settings API.)

Of course, none of this is remotely obvious from looking at the pointer dereference in context, so I'll just put in a null check. :)
Comment 4 Andreas Kling 2015-11-01 14:00:41 PST
Committed r191861: <http://trac.webkit.org/changeset/191861>