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

Unified Diff: include/AdblockPlus/FilterEngine.h

Issue 11018003: Filter changed callback (Closed)
Patch Set: Created June 18, 2013, 11:42 a.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
Index: include/AdblockPlus/FilterEngine.h
===================================================================
--- a/include/AdblockPlus/FilterEngine.h
+++ b/include/AdblockPlus/FilterEngine.h
@@ -69,6 +69,7 @@
{
public:
typedef std::tr1::function<void(const std::string&)> UpdaterCallback;
+ typedef std::tr1::function<void(const std::string&, const std::string&, const int64_t)> FilterChangeCallback;
Wladimir Palant 2013/06/18 15:02:15 int64_t doesn't need to be const.
Felix Dahlke 2013/06/19 10:28:38 It's a matter of taste here. I like to const every
Wladimir Palant 2013/06/19 11:27:09 This essentially disallows the callback to change
Felix Dahlke 2013/06/19 11:35:34 That's the trouble with const parameters, have to
explicit FilterEngine(JsEnginePtr jsEngine);
JsEnginePtr GetJsEngine() const { return jsEngine; }
@@ -85,6 +86,7 @@
JsValuePtr GetPref(const std::string& pref) const;
void SetPref(const std::string& pref, JsValuePtr value);
void ForceUpdateCheck(UpdaterCallback callback = 0);
+ void SetFilterChangeCallback(FilterChangeCallback callback = 0);
Wladimir Palant 2013/06/18 15:02:15 Having a default for the callback makes no sense -
private:
JsEnginePtr jsEngine;
@@ -94,6 +96,7 @@
void InitDone(JsValueList& params);
void UpdateCheckDone(const std::string& eventName, UpdaterCallback callback, JsValueList& params);
+ void FilterChanged(const std::string& eventName, FilterChangeCallback callback, JsValueList& params);
};
}

Powered by Google App Engine
This is Rietveld