Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: include/AdblockPlus/FilterEngine.h

Issue 29417605: Issue 5034 - Part 3: Create plain JsValue instead of JsValuePtr (Closed) Base URL: https://hg.adblockplus.org/libadblockplus/
Patch Set: Pass JsEngine by ref Created April 20, 2017, 1:01 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/AdblockPlus/JsEngine.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/AdblockPlus/FilterEngine.h
===================================================================
--- a/include/AdblockPlus/FilterEngine.h
+++ b/include/AdblockPlus/FilterEngine.h
@@ -206,17 +206,17 @@
* for the full list).
* The second parameter is the filter/subscription object affected, if any.
*/
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;
+ typedef std::map<std::string, AdblockPlus::JsValue> Prefs;
/**
* Callback type invoked when a new notification should be shown.
* The parameter is the Notification object to be shown.
*/
typedef std::function<void(const NotificationPtr&)> ShowNotificationCallback;
/**
@@ -423,24 +423,24 @@
*/
std::vector<std::string> GetElementHidingSelectors(const std::string& domain) const;
/**
* Retrieves a preference value.
* @param pref Preference name.
* @return Preference value, or `null` if it doesn't exist.
*/
- JsValuePtr GetPref(const std::string& pref) const;
+ JsValue 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, const JsValuePtr& value);
+ void SetPref(const std::string& pref, const JsValue& 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;
@@ -529,22 +529,22 @@
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(const UpdateAvailableCallback& callback, const JsConstValueList& params) const;
+ void UpdateAvailable(const UpdateAvailableCallback& callback, const JsValueList& params) const;
void UpdateCheckDone(const std::string& eventName,
- const UpdateCheckDoneCallback& callback, const JsConstValueList& params);
- void FilterChanged(const FilterChangeCallback& callback, const JsConstValueList& params) const;
+ const UpdateCheckDoneCallback& callback, const JsValueList& params);
+ void FilterChanged(const FilterChangeCallback& callback, const JsValueList& params) const;
void ShowNotification(const ShowNotificationCallback& callback,
- const JsConstValueList& param) const;
+ const JsValueList& param) 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;
};
}
« no previous file with comments | « no previous file | include/AdblockPlus/JsEngine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld