Bug 126356

Summary: Propagate WindowServer modifications state to WebProcess
Product: WebKit Reporter: Gavin Barraclough <barraclough>
Component: WebKit2Assignee: Gavin Barraclough <barraclough>
Status: RESOLVED FIXED    
Severity: Normal CC: eflews.bot, gyuyoung.kim, rego+ews, xan.lopez
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Fix
eflews.bot: commit-queue-
GTK fix
sam: review-
WIP
none
Fix sam: review+

Gavin Barraclough
Reported 2013-12-31 22:47:14 PST
This will be necessary to move control of process suppression to the WebProcess.
Attachments
Fix (8.63 KB, patch)
2013-12-31 23:06 PST, Gavin Barraclough
eflews.bot: commit-queue-
GTK fix (8.71 KB, patch)
2013-12-31 23:45 PST, Gavin Barraclough
sam: review-
WIP (27.33 KB, patch)
2014-01-02 17:22 PST, Gavin Barraclough
no flags
Fix (30.94 KB, patch)
2014-01-02 17:53 PST, Gavin Barraclough
sam: review+
Gavin Barraclough
Comment 1 2013-12-31 23:06:02 PST
EFL EWS Bot
Comment 2 2013-12-31 23:10:53 PST
Gavin Barraclough
Comment 3 2013-12-31 23:45:10 PST
Sam Weinig
Comment 4 2014-01-01 13:58:20 PST
Comment on attachment 220182 [details] GTK fix View in context: https://bugs.webkit.org/attachment.cgi?id=220182&action=review > Source/WebKit2/UIProcess/WebContext.h:304 > +#if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 > + void windowModificationsStateChanged(); > + static WindowModificationsState windowModificationsState(); > +#else > + static WindowModificationsState windowModificationsState() { return WindowModificationsStarted; } > +#endif I don't get why something called WindowModificationsState would be on the WebContext (or static). "Window" level concepts should really a PageClient thing if possible. > Source/WebKit2/UIProcess/mac/WebContextMac.mm:137 > + for (auto *context : contexts) { * on the wrong side. > Source/WebKit2/UIProcess/mac/WebProcessProxyMac.mm:85 > +void WebProcessProxy::windowModificationsStateChanged() Even though this isn't currently used by other platforms, there isn't anything really mac specific about it. Can this just go in WebProcessProxy.cpp? > Source/WebKit2/UIProcess/mac/WebProcessProxyMac.mm:88 > + for (WebPageProxyMap::iterator it = m_pageMap.begin(), end = m_pageMap.end(); it != end; ++it) > + it->value->viewStateDidChange(ViewState::IsModifying); This can be written as: for (const auto& page : m_pageMap.values()) page->viewStateDidChange(ViewState::IsModifying);
Gavin Barraclough
Comment 5 2014-01-01 21:59:42 PST
(In reply to comment #4) > (From update of attachment 220182 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=220182&action=review > > > Source/WebKit2/UIProcess/WebContext.h:304 > > +#if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 > > + void windowModificationsStateChanged(); > > + static WindowModificationsState windowModificationsState(); > > +#else > > + static WindowModificationsState windowModificationsState() { return WindowModificationsStarted; } > > +#endif > > I don't get why something called WindowModificationsState would be on the WebContext (or static). "Window" level concepts should really a PageClient thing if possible. The WindowModifications state is not per window, as you might expect from the name – it is per WindowServer connection (i.e. process wide). The code registers a single handler, and then broadcasts the message out to all WebPageProxies. The alternative would be to redundantly register multiple handlers which would all be receiving exactly the same message, which seemed inefficient. It looked like the best way to find all WebPageProxies in existence was from the WebContext – the WebContext statically know all WebContexts in existence, which in turn can find all WebPageProxies, which in turn can find all WebPageProxies. Did I miss a more direct route? > * on the wrong side. > > Even though this isn't currently used by other platforms, there isn't anything really mac specific about it. Can this just go in WebProcessProxy.cpp? > > This can be written as: Yep, yep, yep - will fix.
Gavin Barraclough
Comment 6 2014-01-02 17:22:37 PST
Gavin Barraclough
Comment 7 2014-01-02 17:53:05 PST
Gavin Barraclough
Comment 8 2014-01-02 18:05:45 PST
Committed revision 161246.
Geoffrey Garen
Comment 9 2014-01-03 12:05:44 PST
Comment on attachment 220275 [details] Fix View in context: https://bugs.webkit.org/attachment.cgi?id=220275&action=review > Source/WebKit2/ChangeLog:11 > + WindowServer connection basis, and as such may produce (safe) false positives. Did you mean "safe false negatives"? I don't think it's ever safe to falsely say that something is not visible to the user when in reality it is.
Gavin Barraclough
Comment 10 2014-01-03 23:41:40 PST
(In reply to comment #9) > (From update of attachment 220275 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=220275&action=review > > > Source/WebKit2/ChangeLog:11 > > + WindowServer connection basis, and as such may produce (safe) false positives. > > Did you mean "safe false negatives"? I don't think it's ever safe to falsely say that something is not visible to the user when in reality it is. Ugh, yes you're right, this is now "safe false negatives" – the comment reflects the initial implementation. The flag was inverted – in the former version of the patch the value was called "IsModifying", which meant !IsVisuallyIdle – and as such we would sometimes produce safe false positives.
Note You need to log in before you can comment on or make changes to this bug.