RESOLVED FIXED 132522
Clean up ProcessThrottler
https://bugs.webkit.org/show_bug.cgi?id=132522
Summary Clean up ProcessThrottler
Gavin Barraclough
Reported 2014-05-02 23:24:21 PDT
Piggybacking on the setViewState reply to synchronize is a little hacky, and we'll want a to inform the process that it will suspend in cases other than visibility change. Add an explicit handshake for this purpose.
Attachments
Fix (25.54 KB, patch)
2014-05-02 23:50 PDT, Gavin Barraclough
ggaren: review+
Gavin Barraclough
Comment 1 2014-05-02 23:50:06 PDT
WebKit Commit Bot
Comment 2 2014-05-02 23:51:44 PDT
Attachment 230749 [details] did not pass style-queue: ERROR: Source/WebKit2/UIProcess/ios/ProcessThrottler.h:60: The parameter name "process" adds no information, so it should be removed. [readability/parameter_name] [5] Total errors found: 1 in 15 files If any of these errors are false positives, please file a bug against check-webkit-style.
Geoffrey Garen
Comment 3 2014-05-03 12:42:15 PDT
Comment on attachment 230749 [details] Fix View in context: https://bugs.webkit.org/attachment.cgi?id=230749&action=review r=me, but I might have found a bug. > Source/WebKit2/ChangeLog:21 > + longer needs request a reply from SetViewState, and WebPageProxy can lose all the 'hiding' "needs to" > Source/WebKit2/UIProcess/WebPageProxy.cpp:1101 > + else if (!m_activityToken) > + m_activityToken = std::make_unique<ProcessThrottler::ForegroundActivityToken>(m_process->throttler()); If I already have an activity token, but it is Background instead of Foreground, won't this !m_activityToken check prevent me from entering the Foreground state when I should? Seems like you should check !m_activityToken || m_activityToken->isBackgroundActivityToken() or something.
Gavin Barraclough
Comment 4 2014-05-05 10:37:08 PDT
(In reply to comment #3) > (From update of attachment 230749 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=230749&action=review > > r=me, but I might have found a bug. > > > Source/WebKit2/ChangeLog:21 > > + longer needs request a reply from SetViewState, and WebPageProxy can lose all the 'hiding' > > "needs to" > > > Source/WebKit2/UIProcess/WebPageProxy.cpp:1101 > > + else if (!m_activityToken) > > + m_activityToken = std::make_unique<ProcessThrottler::ForegroundActivityToken>(m_process->throttler()); > > If I already have an activity token, but it is Background instead of Foreground, won't this !m_activityToken check prevent me from entering the Foreground state when I should? > > Seems like you should check !m_activityToken || m_activityToken->isBackgroundActivityToken() or something. No – the WebPageProxy no longer has to know about keeping the page running the background state – that is now all invisible to it. WebPageProxy simply takes a ForegroundActivityToken when the page is visible, and releases it when the page is hidden. The ProcessThrottler is now responsible for transitioning from Foreground to Suspended via a Background state.
Gavin Barraclough
Comment 5 2014-05-05 13:14:49 PDT
Transmitting file data ............... Committed revision 168312.
Note You need to log in before you can comment on or make changes to this bug.