After all of this Windows JumpList work is merged and riding the rails to release I think it may be interesting to have a bit of a recap on all the pieces of work you did during all these episodes. Doesn’t have to necessarily take up a full episode but maybe it could? 🤷♂️
I think this is a great idea. This whole project has taken about a year at this point, more or less (we’ve come and go from the project a bit). I think a recap would be really useful.
WindowsJumpLists! Let’s keep going!
TODO
Rename nsIJumpListBuilder to nsILegacyJumpListBuilder
Add createLegacyJumpListBuilder to nsIWinTaskBar to use the old mechanism
Update WindowsJumpList to use the legacy interface
Create a new nsIJumpListBuilder
Document NativeJumpListBackend
Populate nsIJumpListBuilder using the code we developed in the previous iteration
Have createJumpListBuilder in nsIWinTaskBar use that
Figure out why the JumpListBuilder isn’t returning the URLs of the previous
It’s working! It’s just that you have to remember to actually remove the item for it to show up in the list.
Update WindowsJumpLists to choose the right builder based on the pref and treat them correctly based on that pref.
Why aren’t the favicons working?
It was always this way - there’s a moment in time, right after the page visits, where the favicon hasn’t yet been written to disk, but after it has been, the favicon becomes present. Usually the update immediately after.
Investigate shutdown crashes by adding MOZ_ASSERT(mThread == PR_GetCurrentThread()); basically everywhere. Especially at shutdown.
I KNOW WHAT”S HAPPENING. The JumpListBuilder is created on the main thread. That class creates a LazyIdleThread (mIOThread) which is responsible for instantiating the JumpListBackend (aka the NativeJumpListBackend). BUT GUESS WHAT: A LazyIdleThread will shut itself down after a period of inactivity - that’s part of how it works! That means that when it comes time to shutting everything down, we’re asking a LazyIdleThread to destroy the JumpListBackend which might not be the same thread that created it, thus hitting our assertion! What we might need to do is to either, 1: destroy the JumpListBackend anytime the LazyIdleThread is shut down. 2: move the JumpListBackend destruction responsibility to the main thread.
Nika suggests using NS_INLINE_DECL_REFCOUNTING_ONEVENTTARGET
After doing a removal, I saw a NSERRORUNEXPECTED, and then an NSERRORFAILURE for each subsequent update. Why is that?
We need to ask Windows for the set of URLs to remove before we query Places and populate with the new list. That means adding a new function.
Write a gtest for the JumpListBuilder
Write a front-end test that registers a fake nsIWinTaskbar or otherwise produces a fake nsIJumpListBuilder to make sure it gets passed the right things.
Make a note to migrate the new jump list builder off of the dedicated lazy thread and use the IO thread pool instead.