Title: [152866] trunk/Source/WebKit2
Revision
152866
Author
[email protected]
Date
2013-07-18 14:58:17 -0700 (Thu, 18 Jul 2013)

Log Message

[wk2] Ensure that the plugin layer is removed completely when the PluginProcess crashes
https://bugs.webkit.org/show_bug.cgi?id=118862

Reviewed by Anders Carlsson.

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::PluginView):
Add m_pluginProcessHasCrashed.

(WebKit::PluginView::platformLayer):
Don't return the plugin's layer if it has crashed.

(WebKit::PluginView::pluginProcessCrashed):
Set m_pluginProcessHasCrashed.
Cause a style recalc so that we rebuild the layer tree; our layer won't be included.

* WebProcess/Plugins/PluginView.h:
Add m_pluginProcessHasCrashed.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (152865 => 152866)


--- trunk/Source/WebKit2/ChangeLog	2013-07-18 21:47:20 UTC (rev 152865)
+++ trunk/Source/WebKit2/ChangeLog	2013-07-18 21:58:17 UTC (rev 152866)
@@ -1,3 +1,24 @@
+2013-07-18  Tim Horton  <[email protected]>
+
+        [wk2] Ensure that the plugin layer is removed completely when the PluginProcess crashes
+        https://bugs.webkit.org/show_bug.cgi?id=118862
+
+        Reviewed by Anders Carlsson.
+
+        * WebProcess/Plugins/PluginView.cpp:
+        (WebKit::PluginView::PluginView):
+        Add m_pluginProcessHasCrashed.
+
+        (WebKit::PluginView::platformLayer):
+        Don't return the plugin's layer if it has crashed.
+
+        (WebKit::PluginView::pluginProcessCrashed):
+        Set m_pluginProcessHasCrashed.
+        Cause a style recalc so that we rebuild the layer tree; our layer won't be included.
+
+        * WebProcess/Plugins/PluginView.h:
+        Add m_pluginProcessHasCrashed.
+
 2013-07-18  Alexey Proskuryakov  <[email protected]>
 
         <rdar://problem/13886443> Assertion failures in NetworkProcess in SandboxExtension::revoke when aborting SyncNetworkResourceLoader

Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (152865 => 152866)


--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2013-07-18 21:47:20 UTC (rev 152865)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp	2013-07-18 21:58:17 UTC (rev 152866)
@@ -276,6 +276,7 @@
     , m_isWaitingForSynchronousInitialization(false)
     , m_isWaitingUntilMediaCanStart(false)
     , m_isBeingDestroyed(false)
+    , m_pluginProcessHasCrashed(false)
     , m_pendingURLRequestsTimer(RunLoop::main(), this, &PluginView::pendingURLRequestsTimerFired)
 #if ENABLE(NETSCAPE_PLUGIN_API)
     , m_npRuntimeObjectMap(this)
@@ -620,7 +621,7 @@
 PlatformLayer* PluginView::platformLayer() const
 {
     // The plug-in can be null here if it failed to initialize.
-    if (!m_isInitialized || !m_plugin)
+    if (!m_isInitialized || !m_plugin || m_pluginProcessHasCrashed)
         return 0;
         
     return m_plugin->pluginLayer();
@@ -1249,7 +1250,7 @@
     RenderBoxModelObject* renderer = toRenderBoxModelObject(m_pluginElement->renderer());
     if (!renderer)
         return;
-    
+
     IntRect contentRect(dirtyRect);
     contentRect.move(renderer->borderLeft() + renderer->paddingLeft(), renderer->borderTop() + renderer->paddingTop());
     renderer->repaintRectangle(contentRect);
@@ -1413,13 +1414,17 @@
 
 void PluginView::pluginProcessCrashed()
 {
+    m_pluginProcessHasCrashed = true;
+
     if (!m_pluginElement->renderer())
         return;
 
     // FIXME: The renderer could also be a RenderApplet, we should handle that.
     if (!m_pluginElement->renderer()->isEmbeddedObject())
         return;
-        
+
+    m_pluginElement->setNeedsStyleRecalc(SyntheticStyleChange);
+
     RenderEmbeddedObject* renderer = toRenderEmbeddedObject(m_pluginElement->renderer());
     renderer->setPluginUnavailabilityReason(RenderEmbeddedObject::PluginCrashed);
     

Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h (152865 => 152866)


--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h	2013-07-18 21:47:20 UTC (rev 152865)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h	2013-07-18 21:58:17 UTC (rev 152866)
@@ -231,6 +231,7 @@
     bool m_isWaitingForSynchronousInitialization;
     bool m_isWaitingUntilMediaCanStart;
     bool m_isBeingDestroyed;
+    bool m_pluginProcessHasCrashed;
 
     // Pending URLRequests that the plug-in has made.
     Deque<RefPtr<URLRequest>> m_pendingURLRequests;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to