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

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

Issue 29323611: Issue #1234, #2058 - Rewrite log facility, improving thread implementation
Patch Set: Created Aug. 19, 2015, 5: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
OLDNEW
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-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 27 matching lines...) Expand all
38 38
39 CComAutoCriticalSection m_criticalSection; 39 CComAutoCriticalSection m_criticalSection;
40 CriticalSection m_csInject; 40 CriticalSection m_csInject;
41 41
42 std::wstring m_documentDomain; 42 std::wstring m_documentDomain;
43 std::wstring m_documentUrl; 43 std::wstring m_documentUrl;
44 CPluginUserSettings m_pluginUserSettings; 44 CPluginUserSettings m_pluginUserSettings;
45 public: 45 public:
46 CPluginClass* m_plugin; 46 CPluginClass* m_plugin;
47 protected: 47 protected:
48 bool m_isActivated;
49
50 std::thread m_thread;
51 std::atomic<bool> m_continueThreadRunning;
52 CPluginDomTraverser* m_traverser; 48 CPluginDomTraverser* m_traverser;
53 public: 49 public:
54 std::auto_ptr<CPluginFilter> m_filter; 50 std::auto_ptr<CPluginFilter> m_filter;
55 private: 51 private:
56 void ThreadProc();
57 CComAutoCriticalSection m_criticalSectionCache; 52 CComAutoCriticalSection m_criticalSectionCache;
58 std::set<std::wstring> m_cacheFrames; 53 std::set<std::wstring> m_cacheFrames;
59 std::wstring m_cacheDomain; 54 std::wstring m_cacheDomain;
60 void SetDocumentUrl(const std::wstring& url); 55 void SetDocumentUrl(const std::wstring& url);
61 void InjectABP(IWebBrowser2* browser); 56 void InjectABP(IWebBrowser2* browser);
62 public: 57 public:
63 58
64 CPluginTabBase(CPluginClass* plugin); 59 CPluginTabBase(CPluginClass* plugin);
65 ~CPluginTabBase(); 60 ~CPluginTabBase();
66 61
67 std::wstring GetDocumentDomain(); 62 std::wstring GetDocumentDomain();
68 std::wstring GetDocumentUrl(); 63 std::wstring GetDocumentUrl();
69 virtual void OnActivate();
70 virtual void OnUpdate();
71 virtual void OnNavigate(const std::wstring& url); 64 virtual void OnNavigate(const std::wstring& url);
72 virtual void OnDownloadComplete(IWebBrowser2* browser); 65 virtual void OnDownloadComplete(IWebBrowser2* browser);
73 virtual void OnDocumentComplete(IWebBrowser2* browser, const std::wstring& url , bool isDocumentBrowser); 66 virtual void OnDocumentComplete(IWebBrowser2* browser, const std::wstring& url , bool isDocumentBrowser);
74 static DWORD WINAPI TabThreadProc(LPVOID pParam);
75 void CacheFrame(const std::wstring& url); 67 void CacheFrame(const std::wstring& url);
76 bool IsFrameCached(const std::wstring& url); 68 bool IsFrameCached(const std::wstring& url);
77 void ClearFrameCache(const std::wstring& domain=L""); 69 void ClearFrameCache(const std::wstring& domain=L"");
78 70
79 }; 71 };
80 72
81 /** 73 /**
82 * Temporary class used during refactoring. 74 * Temporary class used during refactoring.
83 * This is the definition previously in AdblockPlusTab.h 75 * This is the definition previously in AdblockPlusTab.h
84 * Defining this class during refactoring alleviates the need to rename CPluginT abBase in the first change set. 76 * Defining this class during refactoring alleviates the need to rename CPluginT abBase in the first change set.
85 */ 77 */
86 class CPluginTab : public CPluginTabBase 78 class CPluginTab : public CPluginTabBase
87 { 79 {
88 80
89 public: 81 public:
90 CPluginTab(CPluginClass* plugin) : CPluginTabBase(plugin) {}; 82 CPluginTab(CPluginClass* plugin) : CPluginTabBase(plugin) {};
91 ~CPluginTab() {}; 83 ~CPluginTab() {};
92 }; 84 };
93 85
94 86
95 87
96 #endif // _PLUGIN_TAB_BASE_H_ 88 #endif // _PLUGIN_TAB_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld