| Summary: | Track pages preventing suppression in WebProcessProxy using RefCounter (instead of HashSet) | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Gavin Barraclough <barraclough> | ||||||
| Component: | WebKit2 | Assignee: | Gavin Barraclough <barraclough> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | ||||||||
| Priority: | P2 | ||||||||
| Version: | 528+ (Nightly build) | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Bug Depends on: | 139106 | ||||||||
| Bug Blocks: | |||||||||
| Attachments: |
|
||||||||
|
Description
Gavin Barraclough
2014-11-29 23:47:01 PST
Created attachment 242289 [details]
Fix
Created attachment 243151 [details]
Fix
Comment on attachment 243151 [details] Fix View in context: https://bugs.webkit.org/attachment.cgi?id=243151&action=review We should consider removing all the #ifdefs. The concepts seems useful for other platforms. Something I don't see: shouldn't there be code updating the counter when the settings change? > Source/WebKit2/UIProcess/WebPageProxy.cpp:391 > + updateProccessSuppressionState(); Why not make updateProccessSuppressionState() a step of updateActivityToken()? (and maybe rename updateActivityToken) > Source/WebKit2/UIProcess/WebPageProxy.cpp:1283 > + m_preventProcessSuppression.clear(); m_preventProcessSuppression = nullptr? > Source/WebKit2/UIProcess/WebPageProxy.cpp:4567 > + m_preventProcessSuppression.clear(); m_preventProcessSuppression = nullptr? > Source/WebKit2/UIProcess/WebProcessProxy.h:123 > + PassRefPtr<RefCounter::Count> preventProcessSuppressionForPage() The function name is an action, that is no good for a getter. Not sure what would be a better name. Maybe processSuppressionCounter()? > Source/WebKit2/UIProcess/WebProcessProxy.h:234 > + RefCounter m_pagesPreventingSuppression; m_pagesPreventingSuppression -> m_pagesPreventingSuppressionCount/m_pagesPreventingSuppressionCounter/m_processSupressionCounter? (In reply to comment #3) > Comment on attachment 243151 [details] > Fix > > View in context: > https://bugs.webkit.org/attachment.cgi?id=243151&action=review > > We should consider removing all the #ifdefs. The concepts seems useful for > other platforms. Yep, that seems reasonable. > Something I don't see: shouldn't there be code updating the counter when the > settings change? That happens from WebPageProxy::preferencesDidChange(). (though this can probably go away after in the next patch). > > Source/WebKit2/UIProcess/WebPageProxy.cpp:391 > > + updateProccessSuppressionState(); > > Why not make updateProccessSuppressionState() a step of > updateActivityToken()? (and maybe rename updateActivityToken) Yeah, the repeated separate calls aren't great. :-( This should probably be merged out to a separate subclass, similar to PageThrotter in WebCore. I'm gonna leave them separate for now. > > Source/WebKit2/UIProcess/WebPageProxy.cpp:1283 > > + m_preventProcessSuppression.clear(); > > m_preventProcessSuppression = nullptr? > > > Source/WebKit2/UIProcess/WebPageProxy.cpp:4567 > > + m_preventProcessSuppression.clear(); > > m_preventProcessSuppression = nullptr? Done. > > Source/WebKit2/UIProcess/WebProcessProxy.h:123 > > + PassRefPtr<RefCounter::Count> preventProcessSuppressionForPage() > > The function name is an action, that is no good for a getter. > > Not sure what would be a better name. Maybe processSuppressionCounter()? Done. > > Source/WebKit2/UIProcess/WebProcessProxy.h:234 > > + RefCounter m_pagesPreventingSuppression; > > m_pagesPreventingSuppression -> > m_pagesPreventingSuppressionCount/m_pagesPreventingSuppressionCounter/ > m_processSupressionCounter? Done. https://trac.webkit.org/changeset/177209 |