Title: [175473] trunk/Source/WebKit2
Revision
175473
Author
[email protected]
Date
2014-11-03 10:36:57 -0800 (Mon, 03 Nov 2014)

Log Message

Persist the page's muted state across web process crashes.
https://bugs.webkit.org/show_bug.cgi?id=138195

Reviewed by Anders Carlsson.

Store the Page's muted state in WebPageCreationParameters so that state can be properly
restored after recovering from a crash in the web process.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
Initialize m_muted.
(WebKit::WebPageProxy::setMuted):
Update m_muted.
(WebKit::WebPageProxy::creationParameters):
Set the muted data member in WebPageCreationParameters.
* UIProcess/WebPageProxy.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
Initialize the page's muted state with the muted value from WebPageCreationParameters.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (175472 => 175473)


--- trunk/Source/WebKit2/ChangeLog	2014-11-03 18:01:06 UTC (rev 175472)
+++ trunk/Source/WebKit2/ChangeLog	2014-11-03 18:36:57 UTC (rev 175473)
@@ -1,3 +1,29 @@
+2014-11-03  Ada Chan  <[email protected]>
+
+        Persist the page's muted state across web process crashes.
+        https://bugs.webkit.org/show_bug.cgi?id=138195
+
+        Reviewed by Anders Carlsson.
+
+        Store the Page's muted state in WebPageCreationParameters so that state can be properly
+        restored after recovering from a crash in the web process.
+
+        * Shared/WebPageCreationParameters.cpp:
+        (WebKit::WebPageCreationParameters::encode):
+        (WebKit::WebPageCreationParameters::decode):
+        * Shared/WebPageCreationParameters.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        Initialize m_muted.
+        (WebKit::WebPageProxy::setMuted):
+        Update m_muted.
+        (WebKit::WebPageProxy::creationParameters):
+        Set the muted data member in WebPageCreationParameters.
+        * UIProcess/WebPageProxy.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        Initialize the page's muted state with the muted value from WebPageCreationParameters.
+
 2014-11-03  Ryuan Choi  <[email protected]>
 
         [EFL] Remove dependency of PageViewportController from PageViewportControllerClient

Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp (175472 => 175473)


--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp	2014-11-03 18:01:06 UTC (rev 175472)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.cpp	2014-11-03 18:36:57 UTC (rev 175473)
@@ -58,6 +58,7 @@
     encoder << deviceScaleFactor;
     encoder << topContentInset;
     encoder << mediaVolume;
+    encoder << muted;
     encoder << mayStartMediaWhenInWindow;
     encoder << minimumLayoutSize;
     encoder << autoSizingShouldExpandToViewHeight;
@@ -131,6 +132,8 @@
         return false;
     if (!decoder.decode(parameters.mediaVolume))
         return false;
+    if (!decoder.decode(parameters.muted))
+        return false;
     if (!decoder.decode(parameters.mayStartMediaWhenInWindow))
         return false;
     if (!decoder.decode(parameters.minimumLayoutSize))

Modified: trunk/Source/WebKit2/Shared/WebPageCreationParameters.h (175472 => 175473)


--- trunk/Source/WebKit2/Shared/WebPageCreationParameters.h	2014-11-03 18:01:06 UTC (rev 175472)
+++ trunk/Source/WebKit2/Shared/WebPageCreationParameters.h	2014-11-03 18:36:57 UTC (rev 175473)
@@ -95,6 +95,7 @@
     float topContentInset;
     
     float mediaVolume;
+    bool muted;
     bool mayStartMediaWhenInWindow;
 
     WebCore::IntSize minimumLayoutSize;

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (175472 => 175473)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2014-11-03 18:01:06 UTC (rev 175472)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2014-11-03 18:36:57 UTC (rev 175473)
@@ -363,6 +363,7 @@
     , m_suppressVisibilityUpdates(false)
     , m_autoSizingShouldExpandToViewHeight(false)
     , m_mediaVolume(1)
+    , m_muted(false)
     , m_mayStartMediaWhenInWindow(true)
     , m_scrollPinningBehavior(DoNotPin)
     , m_navigationID(0)
@@ -3385,6 +3386,11 @@
 
 void WebPageProxy::setMuted(bool muted)
 {
+    if (m_muted == muted)
+        return;
+
+    m_muted = muted;
+
     if (!isValid())
         return;
 
@@ -4572,6 +4578,7 @@
     parameters.deviceScaleFactor = deviceScaleFactor();
     parameters.topContentInset = m_topContentInset;
     parameters.mediaVolume = m_mediaVolume;
+    parameters.muted = m_muted;
     parameters.mayStartMediaWhenInWindow = m_mayStartMediaWhenInWindow;
     parameters.minimumLayoutSize = m_minimumLayoutSize;
     parameters.autoSizingShouldExpandToViewHeight = m_autoSizingShouldExpandToViewHeight;

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (175472 => 175473)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2014-11-03 18:01:06 UTC (rev 175472)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2014-11-03 18:36:57 UTC (rev 175473)
@@ -1554,6 +1554,7 @@
     WebCore::IntSize m_minimumLayoutSize;
 
     float m_mediaVolume;
+    bool m_muted;
     bool m_mayStartMediaWhenInWindow;
 
     bool m_waitingForDidUpdateViewState;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (175472 => 175473)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-11-03 18:01:06 UTC (rev 175472)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-11-03 18:36:57 UTC (rev 175473)
@@ -446,6 +446,8 @@
     
     setMediaVolume(parameters.mediaVolume);
 
+    setMuted(parameters.muted);
+
     // We use the DidFirstVisuallyNonEmptyLayout milestone to determine when to unfreeze the layer tree.
     m_page->addLayoutMilestones(DidFirstLayout | DidFirstVisuallyNonEmptyLayout);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to