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

Side by Side Diff: src/plugin/AdblockPlusClient.h

Issue 11430025: Shut down the engine when the last tab is closed (Closed)
Patch Set: Thread safety Created Aug. 8, 2013, 1:45 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 | « src/engine/Main.cpp ('k') | src/plugin/AdblockPlusClient.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #ifndef _ADBLOCK_PLUS_CLIENT_H_ 1 #ifndef _ADBLOCK_PLUS_CLIENT_H_
2 #define _ADBLOCK_PLUS_CLIENT_H_ 2 #define _ADBLOCK_PLUS_CLIENT_H_
3 3
4 4
5 #include "PluginTypedef.h" 5 #include "PluginTypedef.h"
6 #include "PluginClientBase.h" 6 #include "PluginClientBase.h"
7 #include "../shared/Communication.h" 7 #include "../shared/Communication.h"
8 #include "../shared/CriticalSection.h"
8 9
9 10
10 class CPluginFilter; 11 class CPluginFilter;
11 12
12 struct SubscriptionDescription 13 struct SubscriptionDescription
13 { 14 {
14 std::wstring url; 15 std::wstring url;
15 std::wstring title; 16 std::wstring title;
16 std::wstring specialization; 17 std::wstring specialization;
17 bool listed; 18 bool listed;
18 }; 19 };
19 20
20 class CAdblockPlusClient : public CPluginClientBase 21 class CAdblockPlusClient : public CPluginClientBase
21 { 22 {
22 23
23 private: 24 private:
24 25
25 std::auto_ptr<CPluginFilter> m_filter; 26 std::auto_ptr<CPluginFilter> m_filter;
26 27
27 CComAutoCriticalSection m_criticalSectionFilter; 28 CComAutoCriticalSection m_criticalSectionFilter;
28 CComAutoCriticalSection m_criticalSectionCache; 29 CComAutoCriticalSection m_criticalSectionCache;
29 30
30 std::map<CString,bool> m_cacheBlockedSources; 31 std::map<CString,bool> m_cacheBlockedSources;
31 32
33 std::shared_ptr<Communication::Pipe> enginePipe;
34 CriticalSection enginePipeLock;
35
32 36
33 // Private constructor used by the singleton pattern 37 // Private constructor used by the singleton pattern
34 CAdblockPlusClient(); 38 CAdblockPlusClient();
39
40 bool CallEngine(Communication::OutputBuffer& message, Communication::InputBuff er& inputBuffer = Communication::InputBuffer());
41 bool CallEngine(Communication::ProcType proc, Communication::InputBuffer& inpu tBuffer = Communication::InputBuffer());
35 public: 42 public:
36 43
37 static CAdblockPlusClient* s_instance; 44 static CAdblockPlusClient* s_instance;
38 45
39 ~CAdblockPlusClient(); 46 ~CAdblockPlusClient();
40 47
41 static CAdblockPlusClient* GetInstance(); 48 static CAdblockPlusClient* GetInstance();
42 49
43 // Removes the url from the list of whitelisted urls if present 50 // Removes the url from the list of whitelisted urls if present
44 // Only called from ui thread 51 // Only called from ui thread
(...skipping 21 matching lines...) Expand all
66 bool GetPref(const std::wstring& name, bool defaultValue = false); 73 bool GetPref(const std::wstring& name, bool defaultValue = false);
67 int64_t GetPref(const std::wstring& name, int64_t defaultValue = 0); 74 int64_t GetPref(const std::wstring& name, int64_t defaultValue = 0);
68 void CheckForUpdates(); 75 void CheckForUpdates();
69 std::wstring GetAppLocale(); 76 std::wstring GetAppLocale();
70 std::wstring GetDocumentationLink(); 77 std::wstring GetDocumentationLink();
71 78
72 bool IsFirstRun(); 79 bool IsFirstRun();
73 }; 80 };
74 81
75 #endif // _ADBLOCK_PLUS_CLIENT_H_ 82 #endif // _ADBLOCK_PLUS_CLIENT_H_
OLDNEW
« no previous file with comments | « src/engine/Main.cpp ('k') | src/plugin/AdblockPlusClient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld