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

Unified Diff: include/AdblockPlus/FilterEngine.h

Issue 10800079: Implemented update checking functionality (Closed)
Patch Set: Created June 5, 2013, 1:40 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 | lib/api.js » ('j') | lib/updater.js » ('J')
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
@@ -62,33 +62,38 @@ namespace AdblockPlus
};
typedef std::tr1::shared_ptr<Filter> FilterPtr;
typedef std::tr1::shared_ptr<Subscription> SubscriptionPtr;
class FilterEngine
{
public:
+ typedef void(*UpdaterCallback)(const std::string& error);
+
explicit FilterEngine(JsEnginePtr jsEngine);
JsEnginePtr GetJsEngine() const { return jsEngine; }
bool IsFirstRun() const;
FilterPtr GetFilter(const std::string& text);
SubscriptionPtr GetSubscription(const std::string& url);
std::vector<FilterPtr> GetListedFilters() const;
std::vector<SubscriptionPtr> GetListedSubscriptions() const;
std::vector<SubscriptionPtr> FetchAvailableSubscriptions() const;
FilterPtr Matches(const std::string& url,
const std::string& contentType,
const std::string& documentUrl) const;
std::vector<std::string> GetElementHidingSelectors(const std::string& domain) const;
JsValuePtr GetPref(const std::string& pref) const;
void SetPref(const std::string& pref, JsValuePtr value);
+ void ForceUpdateCheck(UpdaterCallback callback = 0);
Felix Dahlke 2013/06/05 15:47:36 I suppose you considered using an std::function he
Wladimir Palant 2013/06/05 18:58:21 No, I somehow forgot about that option. Works fine
private:
JsEnginePtr jsEngine;
bool initialized;
bool firstRun;
+ int updateCheckId;
void InitDone(JsValueList& params);
+ void UpdateCheckDone(std::string eventName, UpdaterCallback callback, JsValueList& params);
Felix Dahlke 2013/06/05 15:47:36 Any reason why eventName is not a const string ref
Wladimir Palant 2013/06/05 18:58:21 I had concerns where that reference would point to
};
}
#endif
« no previous file with comments | « no previous file | lib/api.js » ('j') | lib/updater.js » ('J')

Powered by Google App Engine
This is Rietveld