Title: [142310] trunk/Source
Revision
142310
Author
[email protected]
Date
2013-02-08 12:23:50 -0800 (Fri, 08 Feb 2013)

Log Message

Do not register autostart for plugins from file:// (or nowhere)
https://bugs.webkit.org/show_bug.cgi?id=108271

Reviewed by Tim Horton.

Source/WebCore:

If the page url origin is treated as a local URL, don't attempt
to add it to the auto-start list.

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::userDidClickSnapshot):

Source/WebKit2:

If the pageOrigin is the empty string don't add
it to the auto-start origin list for snapshotting.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::addPlugInAutoStartOrigin):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (142309 => 142310)


--- trunk/Source/WebCore/ChangeLog	2013-02-08 20:18:32 UTC (rev 142309)
+++ trunk/Source/WebCore/ChangeLog	2013-02-08 20:23:50 UTC (rev 142310)
@@ -1,3 +1,16 @@
+2013-02-08  Dean Jackson  <[email protected]>
+
+        Do not register autostart for plugins from file:// (or nowhere)
+        https://bugs.webkit.org/show_bug.cgi?id=108271
+
+        Reviewed by Tim Horton.
+
+        If the page url origin is treated as a local URL, don't attempt
+        to add it to the auto-start list.
+
+        * html/HTMLPlugInImageElement.cpp:
+        (WebCore::HTMLPlugInImageElement::userDidClickSnapshot):
+
 2013-02-08  Adam Barth  <[email protected]>
 
         Use WeakPtrs to communicate between the HTMLDocumentParser and the BackgroundHTMLParser

Modified: trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp (142309 => 142310)


--- trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp	2013-02-08 20:18:32 UTC (rev 142309)
+++ trunk/Source/WebCore/html/HTMLPlugInImageElement.cpp	2013-02-08 20:23:50 UTC (rev 142310)
@@ -38,6 +38,7 @@
 #include "RenderEmbeddedObject.h"
 #include "RenderImage.h"
 #include "RenderSnapshottedPlugIn.h"
+#include "SchemeRegistry.h"
 #include "SecurityOrigin.h"
 #include "Settings.h"
 #include "StyleResolver.h"
@@ -267,7 +268,7 @@
 void HTMLPlugInImageElement::userDidClickSnapshot(PassRefPtr<MouseEvent> event)
 {
     m_pendingClickEventFromSnapshot = event;
-    if (document()->page())
+    if (document()->page() && !SchemeRegistry::shouldTreatURLSchemeAsLocal(document()->page()->mainFrame()->document()->baseURL().protocol()))
         document()->page()->plugInClient()->addAutoStartOrigin(document()->page()->mainFrame()->document()->baseURL().host(), m_plugInOriginHash);
 }
 

Modified: trunk/Source/WebKit2/ChangeLog (142309 => 142310)


--- trunk/Source/WebKit2/ChangeLog	2013-02-08 20:18:32 UTC (rev 142309)
+++ trunk/Source/WebKit2/ChangeLog	2013-02-08 20:23:50 UTC (rev 142310)
@@ -1,3 +1,16 @@
+2013-02-08  Dean Jackson  <[email protected]>
+
+        Do not register autostart for plugins from file:// (or nowhere)
+        https://bugs.webkit.org/show_bug.cgi?id=108271
+
+        Reviewed by Tim Horton.
+
+        If the pageOrigin is the empty string don't add
+        it to the auto-start origin list for snapshotting.
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::addPlugInAutoStartOrigin):
+
 2013-02-07  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r142212.

Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (142309 => 142310)


--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp	2013-02-08 20:18:32 UTC (rev 142309)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp	2013-02-08 20:23:50 UTC (rev 142310)
@@ -770,6 +770,11 @@
 
 void WebProcess::addPlugInAutoStartOrigin(const String& pageOrigin, unsigned plugInOriginHash)
 {
+    if (pageOrigin.isEmpty()) {
+        LOG(Plugins, "Not adding empty page origin");
+        return;
+    }
+
     if (isPlugInAutoStartOrigin(plugInOriginHash)) {
         LOG(Plugins, "Hash %x already exists as auto-start origin (request for %s)", plugInOriginHash, pageOrigin.utf8().data());
         return;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to