OLD | NEW |
1 /* | 1 /* |
2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 Eyeo GmbH |
4 * | 4 * |
5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
8 * | 8 * |
9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include <atomic> | 27 #include <atomic> |
28 | 28 |
29 class CPluginTab | 29 class CPluginTab |
30 { | 30 { |
31 CComAutoCriticalSection m_criticalSection; | 31 CComAutoCriticalSection m_criticalSection; |
32 CriticalSection m_csInject; | 32 CriticalSection m_csInject; |
33 | 33 |
34 std::wstring m_documentDomain; | 34 std::wstring m_documentDomain; |
35 std::wstring m_documentUrl; | 35 std::wstring m_documentUrl; |
36 CPluginUserSettings m_pluginUserSettings; | 36 CPluginUserSettings m_pluginUserSettings; |
37 bool m_isActivated; | |
38 | |
39 std::thread m_thread; | |
40 std::atomic<bool> m_continueThreadRunning; | |
41 CPluginDomTraverser* m_traverser; | 37 CPluginDomTraverser* m_traverser; |
42 public: | 38 public: |
43 CPluginFilter m_filter; | 39 CPluginFilter m_filter; |
44 private: | 40 private: |
45 void ThreadProc(); | |
46 CComAutoCriticalSection m_criticalSectionCache; | 41 CComAutoCriticalSection m_criticalSectionCache; |
47 std::set<std::wstring> m_cacheFrames; | 42 std::set<std::wstring> m_cacheFrames; |
48 std::wstring m_cacheDomain; | 43 std::wstring m_cacheDomain; |
49 void InjectABP(IWebBrowser2* browser); | 44 void InjectABP(IWebBrowser2* browser); |
50 public: | 45 public: |
51 | 46 |
52 CPluginTab(); | 47 CPluginTab(); |
53 ~CPluginTab(); | 48 ~CPluginTab(); |
54 | 49 |
55 std::wstring GetDocumentDomain(); | 50 std::wstring GetDocumentDomain(); |
56 void SetDocumentUrl(const std::wstring& url); | 51 void SetDocumentUrl(const std::wstring& url); |
57 std::wstring GetDocumentUrl(); | 52 std::wstring GetDocumentUrl(); |
58 virtual void OnActivate(); | |
59 virtual void OnUpdate(); | |
60 virtual void OnNavigate(const std::wstring& url); | 53 virtual void OnNavigate(const std::wstring& url); |
61 virtual void OnDownloadComplete(IWebBrowser2* browser); | 54 virtual void OnDownloadComplete(IWebBrowser2* browser); |
62 virtual void OnDocumentComplete(IWebBrowser2* browser, const std::wstring& url
, bool isDocumentBrowser); | 55 virtual void OnDocumentComplete(IWebBrowser2* browser, const std::wstring& url
, bool isDocumentBrowser); |
63 static DWORD WINAPI TabThreadProc(LPVOID pParam); | |
64 void CacheFrame(const std::wstring& url); | 56 void CacheFrame(const std::wstring& url); |
65 bool IsFrameCached(const std::wstring& url); | 57 bool IsFrameCached(const std::wstring& url); |
66 void ClearFrameCache(const std::wstring& domain=L""); | 58 void ClearFrameCache(const std::wstring& domain=L""); |
67 /** | 59 /** |
68 * Is it possible to disable the current content of the present tab on a per-s
ite basis? | 60 * Is it possible to disable the current content of the present tab on a per-s
ite basis? |
69 */ | 61 */ |
70 bool IsPossibleToDisableOnSite(); | 62 bool IsPossibleToDisableOnSite(); |
71 }; | 63 }; |
72 | 64 |
73 #endif // _PLUGIN_TAB_BASE_H_ | 65 #endif // _PLUGIN_TAB_BASE_H_ |
OLD | NEW |