| Index: include/AdblockPlus/FilterEngine.h |
| =================================================================== |
| --- a/include/AdblockPlus/FilterEngine.h |
| +++ b/include/AdblockPlus/FilterEngine.h |
| @@ -201,17 +201,17 @@ |
| /** |
| * Callback type invoked when the filters change. |
| * The first parameter is the action event code (see |
| * [FilterNotifier.triggerListeners](https://adblockplus.org/jsdoc/adblockpluscore/FilterNotifier.html#.triggerListeners) |
| * for the full list). |
| * The second parameter is the filter/subscription object affected, if any. |
| */ |
| - typedef std::function<void(const std::string&, const JsValuePtr)> FilterChangeCallback; |
| + typedef std::function<void(const std::string&, const JsValue&)> FilterChangeCallback; |
| /** |
| * Container of name-value pairs representing a set of preferences. |
| */ |
| typedef std::map<std::string, AdblockPlus::JsValuePtr> Prefs; |
| /** |
| * Callback type invoked when a new notification should be shown. |
| @@ -430,30 +430,30 @@ |
| */ |
| JsValuePtr GetPref(const std::string& pref) const; |
| /** |
| * Sets a preference value. |
| * @param pref Preference name. |
| * @param value New value of the preference. |
| */ |
| - void SetPref(const std::string& pref, JsValuePtr value); |
| + void SetPref(const std::string& pref, const JsValuePtr& value); |
| /** |
| * Extracts the host from a URL. |
| * @param url URL to extract the host from. |
| * @return Extracted host. |
| */ |
| std::string GetHostFromURL(const std::string& url) const; |
| /** |
| * Sets the callback invoked when an application update becomes available. |
| * @param callback Callback to invoke. |
| */ |
| - void SetUpdateAvailableCallback(UpdateAvailableCallback callback); |
| + void SetUpdateAvailableCallback(const UpdateAvailableCallback& callback); |
| /** |
| * Removes the callback invoked when an application update becomes |
| * available. |
| */ |
| void RemoveUpdateAvailableCallback(); |
| /** |
| @@ -469,17 +469,17 @@ |
| * `FilterEngine::SetUpdateAvailableCallback()`. |
| */ |
| void ForceUpdateCheck(const UpdateCheckDoneCallback& callback = UpdateCheckDoneCallback()); |
| /** |
| * Sets the callback invoked when the filters change. |
| * @param callback Callback to invoke. |
| */ |
| - void SetFilterChangeCallback(FilterChangeCallback callback); |
| + void SetFilterChangeCallback(const FilterChangeCallback& callback); |
| /** |
| * Removes the callback invoked when the filters change. |
| */ |
| void RemoveFilterChangeCallback(); |
| /** |
| * Stores the value indicating what connection types are allowed, it is |
| @@ -529,20 +529,20 @@ |
| int updateCheckId; |
| static const std::map<ContentType, std::string> contentTypes; |
| explicit FilterEngine(const JsEnginePtr& jsEngine); |
| FilterPtr CheckFilterMatch(const std::string& url, |
| ContentTypeMask contentTypeMask, |
| const std::string& documentUrl) const; |
| - void UpdateAvailable(UpdateAvailableCallback callback, JsValueList& params) const; |
| + void UpdateAvailable(const UpdateAvailableCallback& callback, const JsValueList& params) const; |
| void UpdateCheckDone(const std::string& eventName, |
| - UpdateCheckDoneCallback callback, JsValueList& params); |
| - void FilterChanged(FilterChangeCallback callback, JsValueList& params) const; |
| + const UpdateCheckDoneCallback& callback, const JsValueList& params); |
| + void FilterChanged(const FilterChangeCallback& callback, const JsValueList& params) const; |
| void ShowNotification(const ShowNotificationCallback& callback, |
| const JsValueList& params) const; |
| FilterPtr GetWhitelistingFilter(const std::string& url, |
| ContentTypeMask contentTypeMask, const std::string& documentUrl) const; |
| FilterPtr GetWhitelistingFilter(const std::string& url, |
| ContentTypeMask contentTypeMask, |
| const std::vector<std::string>& documentUrls) const; |
| }; |