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

Side by Side Diff: Shared/AdblockPlusClient.h

Issue 10338036: Fix errors, pass AppInfo (Closed)
Patch Set: Created April 19, 2013, 3:11 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #ifndef _SIMPLE_ADBLOCK_CLIENT_H_ 1 #ifndef _SIMPLE_ADBLOCK_CLIENT_H_
2 #define _SIMPLE_ADBLOCK_CLIENT_H_ 2 #define _SIMPLE_ADBLOCK_CLIENT_H_
3 3
4 4
5 #include "PluginTypedef.h" 5 #include "PluginTypedef.h"
6 #include "PluginClientBase.h" 6 #include "PluginClientBase.h"
7 #include "AdblockPlus.h" 7 #include "AdblockPlus.h"
8 8
9 9
10 using namespace AdblockPlus; 10 using namespace AdblockPlus;
11 11
12 class CPluginFilter; 12 class CPluginFilter;
13 13
14 class CerrErrorCallback : public AdblockPlus::ErrorCallback
15 {
16 public:
17 void operator()(const std::string& message)
18 {
19 // std::cerr << "Error: " << message << std::endl;
20 }
21 };
22
23
24 class CAdblockPlusClient : public CPluginClientBase 14 class CAdblockPlusClient : public CPluginClientBase
25 { 15 {
26 16
27 private: 17 private:
28 18
29 std::auto_ptr<CPluginFilter> m_filter; 19 std::auto_ptr<CPluginFilter> m_filter;
30 std::auto_ptr<AdblockPlus::DefaultFileSystem> fileSystem;
31 std::auto_ptr<AdblockPlus::DefaultWebRequest> webRequest;
32 std::auto_ptr<CerrErrorCallback> errorCallback;
33 std::auto_ptr<AdblockPlus::JsEngine> jsEngine;
34 std::auto_ptr<AdblockPlus::FilterEngine> filterEngine; 20 std::auto_ptr<AdblockPlus::FilterEngine> filterEngine;
35 21
36 CComAutoCriticalSection m_criticalSectionFilter; 22 CComAutoCriticalSection m_criticalSectionFilter;
37 CComAutoCriticalSection m_criticalSectionCache; 23 CComAutoCriticalSection m_criticalSectionCache;
38 24
39 std::map<CString,bool> m_cacheBlockedSources; 25 std::map<CString,bool> m_cacheBlockedSources;
40 26
41 27
42 // Private constructor used by the singleton pattern 28 // Private constructor used by the singleton pattern
43 CAdblockPlusClient(); 29 CAdblockPlusClient();
(...skipping 13 matching lines...) Expand all
57 bool ShouldBlock(CString src, int contentType, const CString& domain, bool add Debug=false); 43 bool ShouldBlock(CString src, int contentType, const CString& domain, bool add Debug=false);
58 44
59 bool IsElementHidden(const CString& tag, IHTMLElement* pEl, const CString& dom ain, const CString& indent, CPluginFilter* filter); 45 bool IsElementHidden(const CString& tag, IHTMLElement* pEl, const CString& dom ain, const CString& indent, CPluginFilter* filter);
60 bool IsUrlWhiteListed(const CString& url); 46 bool IsUrlWhiteListed(const CString& url);
61 47
62 int GetIEVersion(); 48 int GetIEVersion();
63 49
64 }; 50 };
65 51
66 #endif // _SIMPLE_ADBLOCK_CLIENT_H_ 52 #endif // _SIMPLE_ADBLOCK_CLIENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld