Bug 106348

Summary: Plug-ins shouldn’t be added to list to autostart if you start a plugin in private browsing
Product: WebKit Reporter: Brian Weinstein <bweinstein>
Component: Plug-insAssignee: Brian Weinstein <bweinstein>
Status: RESOLVED WONTFIX    
Severity: Normal CC: andersca, beidson, jonlee, ojan.autocc, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 106367    
Bug Blocks:    
Attachments:
Description Flags
Fix andersca: review+

Description Brian Weinstein 2013-01-08 10:54:27 PST
Plug-ins shouldn’t be added to list to autostart if you start a plugin in private browsing

<rdar://problem/12968442>
Comment 1 Brian Weinstein 2013-01-08 10:58:40 PST
Created attachment 181709 [details]
Fix
Comment 2 Anders Carlsson 2013-01-08 12:17:28 PST
Comment on attachment 181709 [details]
Fix

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

> Source/WebCore/html/HTMLPlugInImageElement.cpp:271
> -    if (document()->page())
> +    if (document()->page() && document()->settings() && !document()->settings()->privateBrowsingEnabled())
>          document()->page()->plugInClient()->addAutoStartOrigin(document()->page()->mainFrame()->document()->baseURL().host(), m_plugInOriginHash);

I don't think you need to null check document()->settings() here since settings can only be null if page is null. I think this'd read better as

if (Page* page = document->page()) {
    if (!settings->privateBrowsingEnabled())
      page->plugInClient()-> etc etc
}
Comment 3 Brian Weinstein 2013-01-08 12:47:24 PST
Landed in http://trac.webkit.org/changeset/139096.
Comment 4 WebKit Review Bot 2013-01-08 12:58:09 PST
Re-opened since this is blocked by bug 106367