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

Side by Side Diff: include/AdblockPlus/FilterEngine.h

Issue 10016005: Add API calls and stubs for filter matching and subscription management (Closed)
Patch Set: Created April 3, 2013, 12:42 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/AdblockPlus.h ('k') | libadblockplus.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #include <vector>
2 #include <string>
3
4 namespace AdblockPlus
5 {
6 class JsEngine;
7
8 struct Subscription
9 {
10 std::string url;
11 std::string title;
Wladimir Palant 2013/04/03 13:42:41 We'll need to expose many more subscription proper
Felix Dahlke 2013/04/04 05:10:52 Sure, sounds reasonable. My intention was to go wi
12
13 Subscription(const std::string& url, const std::string& title);
14 };
15
16 class FilterEngine
17 {
18 public:
19 explicit FilterEngine(JsEngine& jsEngine);
20 void AddSubscription(Subscription subscription);
21 void RemoveSubscription(const Subscription& subscription);
22 const Subscription* FindSubscription(const std::string& url) const;
Wladimir Palant 2013/04/03 13:42:41 This should be called GetSubscription() - ABP code
Felix Dahlke 2013/04/04 05:10:52 Oh, didn't notice. Sure :)
23 const std::vector<Subscription>& GetSubscriptions() const;
24 void UpdateSubscriptionFilters(const Subscription& subscription);
25 std::vector<Subscription> FetchAvailableSubscriptions();
Wladimir Palant 2013/04/03 13:42:41 This is usually an asynchronous action (via XMLHtt
Felix Dahlke 2013/04/04 05:10:52 Yeah, not sure why I didn't do that actually...
26 bool Matches(const std::string& url,
27 const std::string& contentType) const;
Wladimir Palant 2013/04/03 13:42:41 We need to pass documentUrl as well here at the ve
Felix Dahlke 2013/04/04 05:10:52 You're right, it's quite lacking. I had the idea t
28 std::vector<std::string> GetElementHidingRules() const;
29
30 private:
31 JsEngine& jsEngine;
32 std::vector<Subscription> subscriptions;
33 };
34 }
Wladimir Palant 2013/04/03 13:42:41 General note: maybe Subscription should be a class
Felix Dahlke 2013/04/04 05:10:52 Yes, that would be a nicer design. As I noted befo
OLDNEW
« no previous file with comments | « include/AdblockPlus.h ('k') | libadblockplus.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld