RESOLVED FIXED 126330
Refactor NSActivity handling code from ChildProcess to UserActivity
https://bugs.webkit.org/show_bug.cgi?id=126330
Summary Refactor NSActivity handling code from ChildProcess to UserActivity
Gavin Barraclough
Reported 2013-12-30 22:32:35 PST
UserActivity is a mechanism to express to the operating system (where appropriate) that a user initiated activity is taking place, and as such that resources should be made available to the process accordingly. Currently we hold a single NSActivity, at the WebKit layer. This refactoring allows us to hold different activity tokens for different user actions (which simplifies the handling, and aides debugging since the token can more accurately express the activity taking place), and also will allow us to avoid the layering difficulty of calling back up the stack to WebKit to register that an activity is taking place.
Attachments
Fix (22.74 KB, patch)
2013-12-31 21:27 PST, Gavin Barraclough
sam: review-
eflews.bot: commit-queue-
GTK fix (22.77 KB, patch)
2013-12-31 23:08 PST, Gavin Barraclough
no flags
Fix (26.53 KB, patch)
2014-01-02 22:52 PST, Gavin Barraclough
eflews.bot: commit-queue-
gtk fix (26.56 KB, patch)
2014-01-03 00:12 PST, Gavin Barraclough
sam: review+
eflews.bot: commit-queue-
Gavin Barraclough
Comment 1 2013-12-31 21:27:03 PST
EFL EWS Bot
Comment 2 2013-12-31 21:32:39 PST
Sam Weinig
Comment 3 2013-12-31 22:02:02 PST
Comment on attachment 220175 [details] Fix View in context: https://bugs.webkit.org/attachment.cgi?id=220175&action=review > Source/WTF/ChangeLog:16 > + UserActivity is a mechanism to express to the operating system (where appropriate) > + that a user initiated activity is taking place, and as such that resources should be > + made available to the process accordingly. > + > + Currently we hold a single NSActivity, at the WebKit layer. This refactoring allows us > + to hold different activity tokens for different user actions (which simplifies the > + handling, and aides debugging since the token can more accurately express the activity > + taking place), and also will allow us to avoid the layering difficulty of calling back > + up the stack to WebKit to register that an activity is taking place. Why is WTF the right layer for this? Will JSC want to use this? If not, it might make more sense to put this in WebCore/platform. > Source/WTF/wtf/UserActivity.h:34 > +class UserActivity { I think this is an abstract enough concept that this could use a comment explaining what this about. > Source/WTF/wtf/UserActivity.h:46 > +#if PLATFORM(MAC) && !PLATFORM(IOS) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 Instead of this complicated #ifdef here, I would rather there be a single HAVE(NS_ACTIVITY) or something like that. > Source/WTF/wtf/UserActivity.h:50 > + RetainPtr<id> m_description; Can this be a WTF::String or at least a RetainPtr<NSString>. > Source/WTF/wtf/mac/UserActivityMac.mm:66 > + syslog(LOG_ERR, "beginActivity(%s) -> %d", [m_description.get() UTF8String], (int)m_count); Why syslog and not one of the normal logging means? > Source/WTF/wtf/mac/UserActivityMac.mm:93 > +// ASSERT(isValid()); This looks bogus. > Source/WebKit2/Shared/ChildProcess.h:125 > + UserActivity m_processSuppressionDisabled; > + UserActivity m_activeTasks; Since we have cross platform type now, can we move these out of PLATFORM(MAC)?
Gavin Barraclough
Comment 4 2013-12-31 23:08:05 PST
Gavin Barraclough
Comment 5 2014-01-01 22:03:09 PST
> > Source/WTF/wtf/mac/UserActivityMac.mm:66 > > + syslog(LOG_ERR, "beginActivity(%s) -> %d", [m_description.get() UTF8String], (int)m_count); > > Why syslog and not one of the normal logging means? Ooops, debug code I was using to test, meant to delete. :-| Will clean up & fix a couple of the other review comments, then put up a new patch. Clearing r? for now.
Gavin Barraclough
Comment 6 2014-01-02 22:52:47 PST
EFL EWS Bot
Comment 7 2014-01-02 23:25:48 PST
Gavin Barraclough
Comment 8 2014-01-03 00:12:47 PST
EFL EWS Bot
Comment 9 2014-01-03 00:43:53 PST
Gavin Barraclough
Comment 10 2014-01-03 11:02:35 PST
Committed revision 161271.
Note You need to log in before you can comment on or make changes to this bug.