DescriptionIssue #2230, #3391 - Load filters on "download begin" event
Add event handler for "download begin" event in 'CPluginClass', which acts
as a facade for a parallel handler in 'CPluginTab'. Move the loading of
filters from the "before navigate" event to the "download begin" event.
"Download begin" is called for both ordinary page load as well as for
refresh, while "before navigate" is called only on ordinary page load. This
fixes #2230, because the root of that issue is that filters were not
(re)loaded on refresh.
Change the life cycle of 'CPluginFilter', whose initialization was the
opposite of encapsulated. (For example, see the now-removed member variable
'hideFiltersLoadedEvent', which was manipulated only outside of
'CPluginFilter'.) Derive 'CPluginTab' from 'DetachedInitializer', allowing
all threading and initialization to the be responsibility of
'CPluginFilter'. Perform the loading of filters in the thread spawned at
construction. Add a "domain" argument to the constructor, since it was the
only ultimate data dependency. Change the filter member of 'CPluginTab' to a
'unique_ptr' that's non-null only for its duration of use.
Refactored 'DetachedInitializer' to work for both static and member
initializations. Renamed existing class to
'DetachedInitializerStaticFunction', as it's a special case of the
now-more-general version.
--------
This review depends on others:
Issue #2230 - Refactor filter life cycle and use
https://codereview.adblockplus.org/29334386/
Issue #3391 - Add detached initialization class
https://codereview.adblockplus.org/29332660/
Patch Set 1 #
Total comments: 28
Patch Set 2 : address comments #
MessagesTotal messages: 8
|