Title: [149682] trunk/Source/WebKit2
Revision
149682
Author
grao...@apple.com
Date
2013-05-07 11:12:48 -0700 (Tue, 07 May 2013)

Log Message

Re-establish autostart timeout extension on user interaction
https://bugs.webkit.org/show_bug.cgi?id=113232

Change WebProcess::pluginDidReceiveUserInteraction to use a tuple of
(pluginOrigin, pageOrigin, mimeType) arguments like the other similar
WebProcess methods and gather these arguments from the PlugInView's
plug-in element.

Reviewed by Dean Jackson.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::pluginDidReceiveUserInteraction):
Cast the m_pluginElement to a HTMLPlugInImageElement so we can obtain the
tuple of (pluginOrigin, pageOrigin, mimeType) to pass to pluginDidReceiveUserInteraction().

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::plugInDidReceiveUserInteraction):
* WebProcess/WebProcess.h:
(WebProcess):
Update method signature to a tuple of (pluginOrigin, pageOrigin, mimeType)
and obtain the plug-in origin hash from that.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (149681 => 149682)


--- trunk/Source/WebKit2/ChangeLog	2013-05-07 17:58:45 UTC (rev 149681)
+++ trunk/Source/WebKit2/ChangeLog	2013-05-07 18:12:48 UTC (rev 149682)
@@ -1,3 +1,27 @@
+2013-05-07  Antoine Quint  <grao...@apple.com>
+
+        Re-establish autostart timeout extension on user interaction
+        https://bugs.webkit.org/show_bug.cgi?id=113232
+
+        Change WebProcess::pluginDidReceiveUserInteraction to use a tuple of
+        (pluginOrigin, pageOrigin, mimeType) arguments like the other similar
+        WebProcess methods and gather these arguments from the PlugInView's
+        plug-in element.
+
+        Reviewed by Dean Jackson.
+
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::pluginDidReceiveUserInteraction):
+        Cast the m_pluginElement to a HTMLPlugInImageElement so we can obtain the
+        tuple of (pluginOrigin, pageOrigin, mimeType) to pass to pluginDidReceiveUserInteraction().
+
+        * WebProcess/WebProcess.cpp:
+        (WebKit::WebProcess::plugInDidReceiveUserInteraction):
+        * WebProcess/WebProcess.h:
+        (WebProcess):
+        Update method signature to a tuple of (pluginOrigin, pageOrigin, mimeType)
+        and obtain the plug-in origin hash from that.
+
 2013-05-07  Anders Carlsson  <ander...@apple.com>
 
         Each local storage database should know its origin

Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (149681 => 149682)


--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2013-05-07 17:58:45 UTC (rev 149681)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2013-05-07 18:12:48 UTC (rev 149682)
@@ -49,6 +49,7 @@
 #include <WebCore/FrameView.h>
 #include <WebCore/GraphicsContext.h>
 #include <WebCore/HTMLPlugInElement.h>
+#include <WebCore/HTMLPlugInImageElement.h>
 #include <WebCore/HostWindow.h>
 #include <WebCore/MIMETypeRegistry.h>
 #include <WebCore/MouseEvent.h>
@@ -1660,9 +1661,6 @@
 
 void PluginView::pluginDidReceiveUserInteraction()
 {
-    // FIXME: Extend autostart timeout when this codepath is hit.
-    // http://webkit.org/b/113232
-
     if (frame() && !frame()->settings()->plugInSnapshottingEnabled())
         return;
 
@@ -1670,6 +1668,13 @@
         return;
 
     m_didReceiveUserInteraction = true;
+
+    WebCore::HTMLPlugInImageElement* plugInImageElement = toHTMLPlugInImageElement(m_pluginElement.get());
+    String pageOrigin = plugInImageElement->document()->page()->mainFrame()->document()->baseURL().host();
+    String pluginOrigin = plugInImageElement->loadedUrl().host();
+    String mimeType = plugInImageElement->loadedMimeType();
+
+    WebProcess::shared().plugInDidReceiveUserInteraction(pageOrigin, pluginOrigin, mimeType);
 }
 
 bool PluginView::shouldCreateTransientPaintingSnapshot() const

Modified: trunk/Source/WebKit2/WebProcess/WebProcess.cpp (149681 => 149682)


--- trunk/Source/WebKit2/WebProcess/WebProcess.cpp	2013-05-07 17:58:45 UTC (rev 149681)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.cpp	2013-05-07 18:12:48 UTC (rev 149682)
@@ -865,8 +865,12 @@
     m_plugInAutoStartOriginHashes.swap(const_cast<HashMap<unsigned, double>&>(hashes));
 }
 
-void WebProcess::plugInDidReceiveUserInteraction(unsigned plugInOriginHash)
+void WebProcess::plugInDidReceiveUserInteraction(const String& pageOrigin, const String& pluginOrigin, const String& mimeType)
 {
+    if (pageOrigin.isEmpty())
+        return;
+
+    unsigned plugInOriginHash = hashForPlugInOrigin(pageOrigin, pluginOrigin, mimeType);
     if (!plugInOriginHash)
         return;
 

Modified: trunk/Source/WebKit2/WebProcess/WebProcess.h (149681 => 149682)


--- trunk/Source/WebKit2/WebProcess/WebProcess.h	2013-05-07 17:58:45 UTC (rev 149681)
+++ trunk/Source/WebKit2/WebProcess/WebProcess.h	2013-05-07 18:12:48 UTC (rev 149682)
@@ -129,7 +129,7 @@
 
     bool shouldPlugInAutoStartFromOrigin(const WebPage*, const String& pageOrigin, const String& pluginOrigin, const String& mimeType);
     void plugInDidStartFromOrigin(const String& pageOrigin, const String& pluginOrigin, const String& mimeType);
-    void plugInDidReceiveUserInteraction(unsigned plugInOriginHash);
+    void plugInDidReceiveUserInteraction(const String& pageOrigin, const String& pluginOrigin, const String& mimeType);
 
     bool fullKeyboardAccessEnabled() const { return m_fullKeyboardAccessEnabled; }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to