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

Unified Diff: src/plugin/AdblockPlusClient.h

Issue 10845030: Marshal all libadblockplus calls to the engine process (Closed)
Patch Set: Created May 31, 2013, 2:20 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
Index: src/plugin/AdblockPlusClient.h
===================================================================
--- a/src/plugin/AdblockPlusClient.h
+++ b/src/plugin/AdblockPlusClient.h
@@ -1,28 +1,32 @@
#ifndef _SIMPLE_ADBLOCK_CLIENT_H_
#define _SIMPLE_ADBLOCK_CLIENT_H_
#include "PluginTypedef.h"
#include "PluginClientBase.h"
-#include "AdblockPlus.h"
-using namespace AdblockPlus;
-
class CPluginFilter;
+struct SubscriptionDescription
+{
+ std::string url;
+ std::string title;
+ std::string specialization;
+ bool listed;
+};
+
class CAdblockPlusClient : public CPluginClientBase
{
private:
std::auto_ptr<CPluginFilter> m_filter;
- std::auto_ptr<AdblockPlus::FilterEngine> filterEngine;
CComAutoCriticalSection m_criticalSectionFilter;
CComAutoCriticalSection m_criticalSectionCache;
std::map<CString,bool> m_cacheBlockedSources;
// Private constructor used by the singleton pattern
@@ -42,16 +46,17 @@ public:
bool IsElementHidden(const CString& tag, IHTMLElement* pEl, const CString& domain, const CString& indent, CPluginFilter* filter);
bool IsUrlWhiteListed(const CString& url);
int GetIEVersion();
bool Matches(const std::string& url, const std::string& contentType, const std::string& domain);
std::vector<std::string> GetElementHidingSelectors(const std::string& domain);
- std::vector<AdblockPlus::SubscriptionPtr> FetchAvailableSubscriptions();
- std::vector<AdblockPlus::FilterPtr> GetListedFilters();
- AdblockPlus::FilterPtr GetFilter(std::string text);
- std::vector<AdblockPlus::SubscriptionPtr> GetListedSubscriptions();
- AdblockPlus::SubscriptionPtr GetSubscription(std::string url);
+ std::vector<SubscriptionDescription> FetchAvailableSubscriptions();
+ std::vector<SubscriptionDescription> GetListedSubscriptions();
+ void SetSubscription(std::string url);
+ void UpdateAllSubscriptions();
+ std::vector<std::string> GetExceptionDomains();
+ void AddFilter(const std::string& text);
};
#endif // _SIMPLE_ADBLOCK_CLIENT_H_
« src/engine/main.cpp ('K') | « src/engine/main.cpp ('k') | src/plugin/AdblockPlusClient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld