Title: [177255] trunk/Source/WebKit2
- Revision
- 177255
- Author
- [email protected]
- Date
- 2014-12-12 17:44:27 -0800 (Fri, 12 Dec 2014)
Log Message
Split WebPageProxy::m_preventProcessSuppression to track pref/visibility separately
https://bugs.webkit.org/show_bug.cgi?id=139600
Reviewed by Geoff Garen.
Previously WebPageProxy::m_preventProcessSuppression would be set if either the page was visible
or its suppression was disabled by the pref. Instead track these separately. This will make the
user observability state applicable on iOS, too.
Add a new counter to WebContext, and split the counting in WebPageProxy.
::updateProccessSuppressionState continues to track the pref change (which matches its name),
tracking of user observability changes moved to updateActivityToken (which we should further
merge with; it already tracks observability to control process state for iOS).
* UIProcess/WebContext.cpp:
(WebKit::m_processSuppressionDisabledForPageCounter):
- added new RefCounter.
* UIProcess/WebContext.h:
(WebKit::WebContext::processSuppressionDisabledForPageCount):
- added new RefCounter.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):
- no longer needs to call updateProccessSuppressionState (pref has not changed; handled by the call to updateActivityToken).
(WebKit::WebPageProxy::dispatchViewStateChange):
- no longer needs to call updateProccessSuppressionState (pref has not changed; handled by the call to updateActivityToken).
(WebKit::WebPageProxy::updateActivityToken):
- this now also updated the user observability counter.
(WebKit::WebPageProxy::updateProccessSuppressionState):
- now only tracks whether this is disabled via the preference.
(WebKit::WebPageProxy::resetStateAfterProcessExited):
- clear the user observability counter; thsi will be reset on reattach.
* UIProcess/WebPageProxy.h:
- added new RefCounter::Count.
* UIProcess/mac/WebContextMac.mm:
(WebKit::WebContext::processSuppressionEnabled):
- processSuppressionEnabled is disabled if *neither*:
- there are user observable pages
- disabled by pref for any page.
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (177254 => 177255)
--- trunk/Source/WebKit2/ChangeLog 2014-12-13 01:40:44 UTC (rev 177254)
+++ trunk/Source/WebKit2/ChangeLog 2014-12-13 01:44:27 UTC (rev 177255)
@@ -1,3 +1,44 @@
+2014-12-12 Gavin Barraclough <[email protected]>
+
+ Split WebPageProxy::m_preventProcessSuppression to track pref/visibility separately
+ https://bugs.webkit.org/show_bug.cgi?id=139600
+
+ Reviewed by Geoff Garen.
+
+ Previously WebPageProxy::m_preventProcessSuppression would be set if either the page was visible
+ or its suppression was disabled by the pref. Instead track these separately. This will make the
+ user observability state applicable on iOS, too.
+
+ Add a new counter to WebContext, and split the counting in WebPageProxy.
+ ::updateProccessSuppressionState continues to track the pref change (which matches its name),
+ tracking of user observability changes moved to updateActivityToken (which we should further
+ merge with; it already tracks observability to control process state for iOS).
+
+ * UIProcess/WebContext.cpp:
+ (WebKit::m_processSuppressionDisabledForPageCounter):
+ - added new RefCounter.
+ * UIProcess/WebContext.h:
+ (WebKit::WebContext::processSuppressionDisabledForPageCount):
+ - added new RefCounter.
+ * UIProcess/WebPageProxy.cpp:
+ (WebKit::WebPageProxy::reattachToWebProcess):
+ - no longer needs to call updateProccessSuppressionState (pref has not changed; handled by the call to updateActivityToken).
+ (WebKit::WebPageProxy::dispatchViewStateChange):
+ - no longer needs to call updateProccessSuppressionState (pref has not changed; handled by the call to updateActivityToken).
+ (WebKit::WebPageProxy::updateActivityToken):
+ - this now also updated the user observability counter.
+ (WebKit::WebPageProxy::updateProccessSuppressionState):
+ - now only tracks whether this is disabled via the preference.
+ (WebKit::WebPageProxy::resetStateAfterProcessExited):
+ - clear the user observability counter; thsi will be reset on reattach.
+ * UIProcess/WebPageProxy.h:
+ - added new RefCounter::Count.
+ * UIProcess/mac/WebContextMac.mm:
+ (WebKit::WebContext::processSuppressionEnabled):
+ - processSuppressionEnabled is disabled if *neither*:
+ - there are user observable pages
+ - disabled by pref for any page.
+
2014-12-12 Beth Dakin <[email protected]>
Need a fake mouse move after hiding data detectors UI
Modified: trunk/Source/WebKit2/UIProcess/WebContext.cpp (177254 => 177255)
--- trunk/Source/WebKit2/UIProcess/WebContext.cpp 2014-12-13 01:40:44 UTC (rev 177254)
+++ trunk/Source/WebKit2/UIProcess/WebContext.cpp 2014-12-13 01:44:27 UTC (rev 177255)
@@ -195,6 +195,7 @@
#endif
, m_memoryCacheDisabled(false)
, m_userObservablePageCounter([this]() { updateProcessSuppressionState(); })
+ , m_processSuppressionDisabledForPageCounter([this]() { updateProcessSuppressionState(); })
{
platformInitialize();
Modified: trunk/Source/WebKit2/UIProcess/WebContext.h (177254 => 177255)
--- trunk/Source/WebKit2/UIProcess/WebContext.h 2014-12-13 01:40:44 UTC (rev 177254)
+++ trunk/Source/WebKit2/UIProcess/WebContext.h 2014-12-13 01:44:27 UTC (rev 177255)
@@ -361,6 +361,11 @@
return m_userObservablePageCounter.count();
}
+ PassRefPtr<RefCounter::Count> processSuppressionDisabledForPageCount()
+ {
+ return m_processSuppressionDisabledForPageCounter.count();
+ }
+
private:
void platformInitialize();
@@ -566,6 +571,7 @@
bool m_memoryCacheDisabled;
RefCounter m_userObservablePageCounter;
+ RefCounter m_processSuppressionDisabledForPageCounter;
#if PLATFORM(COCOA)
RetainPtr<NSMutableDictionary> m_bundleParameters;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (177254 => 177255)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2014-12-13 01:40:44 UTC (rev 177254)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp 2014-12-13 01:44:27 UTC (rev 177255)
@@ -577,7 +577,6 @@
updateViewState();
updateActivityToken();
- updateProccessSuppressionState();
#if ENABLE(INSPECTOR)
m_inspector = WebInspectorProxy::create(this);
@@ -1242,7 +1241,6 @@
// This must happen after the SetViewState message is sent, to ensure the page visibility event can fire.
updateActivityToken();
- updateProccessSuppressionState();
// If we've started the responsiveness timer as part of telling the web process to update the backing store
// state, it might not send back a reply (since it won't paint anything if the web page is hidden) so we
@@ -1268,6 +1266,11 @@
void WebPageProxy::updateActivityToken()
{
+ if (m_viewState & ViewState::IsVisuallyIdle)
+ m_pageIsUserObservableCount = nullptr;
+ else if (!m_pageIsUserObservableCount)
+ m_pageIsUserObservableCount = m_process->context().userObservablePageCount();
+
#if PLATFORM(IOS)
if (!isViewVisible())
m_activityToken = nullptr;
@@ -1278,12 +1281,10 @@
void WebPageProxy::updateProccessSuppressionState()
{
-#if PLATFORM(COCOA)
- if ((m_viewState & ViewState::IsVisuallyIdle) && m_preferences->pageVisibilityBasedProcessSuppressionEnabled())
- m_preventProcessSuppression = nullptr;
- else if (!m_preventProcessSuppression)
- m_preventProcessSuppression = m_process->context().userObservablePageCount();
-#endif
+ if (m_preferences->pageVisibilityBasedProcessSuppressionEnabled())
+ m_preventProcessSuppressionCount = nullptr;
+ else if (!m_preventProcessSuppressionCount)
+ m_preventProcessSuppressionCount = m_process->context().processSuppressionDisabledForPageCount();
}
void WebPageProxy::layerHostingModeDidChange()
@@ -4560,9 +4561,7 @@
#if PLATFORM(IOS)
m_activityToken = nullptr;
#endif
-#if PLATFORM(COCOA)
- m_preventProcessSuppression = nullptr;
-#endif
+ m_pageIsUserObservableCount = nullptr;
m_isValid = false;
m_isPageSuspended = false;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (177254 => 177255)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2014-12-13 01:40:44 UTC (rev 177254)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2014-12-13 01:44:27 UTC (rev 177255)
@@ -1581,8 +1581,9 @@
#if PLATFORM(COCOA)
HashMap<String, String> m_temporaryPDFFiles;
std::unique_ptr<WebCore::RunLoopObserver> m_viewStateChangeDispatcher;
- RefPtr<RefCounter::Count> m_preventProcessSuppression;
#endif
+ RefPtr<RefCounter::Count> m_pageIsUserObservableCount;
+ RefPtr<RefCounter::Count> m_preventProcessSuppressionCount;
WebCore::ScrollPinningBehavior m_scrollPinningBehavior;
Modified: trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm (177254 => 177255)
--- trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm 2014-12-13 01:40:44 UTC (rev 177254)
+++ trunk/Source/WebKit2/UIProcess/mac/WebContextMac.mm 2014-12-13 01:44:27 UTC (rev 177255)
@@ -512,7 +512,7 @@
bool WebContext::processSuppressionEnabled() const
{
- return !m_userObservablePageCounter.value();
+ return !m_userObservablePageCounter.value() && !m_processSuppressionDisabledForPageCounter.value();
}
bool WebContext::processSuppressionIsEnabledForAllContexts()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes