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

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

Issue 4912420225024000: Issue #1234 - Convert strings associated with URL's (Closed)
Patch Set: Rebased Created Oct. 21, 2014, 6:26 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 #ifndef _PLUGIN_TAB_BASE_H_ 1 #ifndef _PLUGIN_TAB_BASE_H_
2 #define _PLUGIN_TAB_BASE_H_ 2 #define _PLUGIN_TAB_BASE_H_
3 3
4 class CPluginDomTraverser; 4 class CPluginDomTraverser;
5 5
6 #include "PluginUserSettings.h" 6 #include "PluginUserSettings.h"
7 #include "PluginFilter.h" 7 #include "PluginFilter.h"
8 #include "../shared/CriticalSection.h" 8 #include "../shared/CriticalSection.h"
9 #include <thread> 9 #include <thread>
10 #include <atomic> 10 #include <atomic>
11 11
12 class CPluginClass; 12 class CPluginClass;
13 13
14 14
15 class CPluginTabBase 15 class CPluginTabBase
16 { 16 {
17 17
18 friend class CPluginClass; 18 friend class CPluginClass;
19 19
20 protected: 20 protected:
21 21
22 CComAutoCriticalSection m_criticalSection; 22 CComAutoCriticalSection m_criticalSection;
23 CriticalSection m_csInject; 23 CriticalSection m_csInject;
24 24
25 std::wstring m_documentDomain; 25 std::wstring m_documentDomain;
26 CString m_documentUrl; 26 std::wstring m_documentUrl;
27 CPluginUserSettings m_pluginUserSettings; 27 CPluginUserSettings m_pluginUserSettings;
28 public: 28 public:
29 CPluginClass* m_plugin; 29 CPluginClass* m_plugin;
30 protected: 30 protected:
31 bool m_isActivated; 31 bool m_isActivated;
32 32
33 std::thread m_thread; 33 std::thread m_thread;
34 std::atomic<bool> m_continueThreadRunning; 34 std::atomic<bool> m_continueThreadRunning;
35 CPluginDomTraverser* m_traverser; 35 CPluginDomTraverser* m_traverser;
36 static int s_dictionaryVersion; 36 static int s_dictionaryVersion;
37 static int s_settingsVersion; 37 static int s_settingsVersion;
38 static int s_filterVersion; 38 static int s_filterVersion;
39 public: 39 public:
40 std::auto_ptr<CPluginFilter> m_filter; 40 std::auto_ptr<CPluginFilter> m_filter;
41 private: 41 private:
42 static int s_whitelistVersion; 42 static int s_whitelistVersion;
43 43
44 void ThreadProc(); 44 void ThreadProc();
45 CComAutoCriticalSection m_criticalSectionCache; 45 CComAutoCriticalSection m_criticalSectionCache;
46 std::set<CString> m_cacheFrames; 46 std::set<std::wstring> m_cacheFrames;
47 std::wstring m_cacheDomain; 47 std::wstring m_cacheDomain;
48 void SetDocumentUrl(const CString& url); 48 void SetDocumentUrl(const std::wstring& url);
49 void InjectABP(IWebBrowser2* browser); 49 void InjectABP(IWebBrowser2* browser);
50 public: 50 public:
51 51
52 CPluginTabBase(CPluginClass* plugin); 52 CPluginTabBase(CPluginClass* plugin);
53 ~CPluginTabBase(); 53 ~CPluginTabBase();
54 54
55 std::wstring GetDocumentDomain(); 55 std::wstring GetDocumentDomain();
56 CString GetDocumentUrl(); 56 std::wstring GetDocumentUrl();
57 virtual void OnActivate(); 57 virtual void OnActivate();
58 virtual void OnUpdate(); 58 virtual void OnUpdate();
59 virtual void OnNavigate(const CString& url); 59 virtual void OnNavigate(const std::wstring& url);
60 virtual void OnDownloadComplete(IWebBrowser2* browser); 60 virtual void OnDownloadComplete(IWebBrowser2* browser);
61 virtual void OnDocumentComplete(IWebBrowser2* browser, const CString& url, boo l isDocumentBrowser); 61 virtual void OnDocumentComplete(IWebBrowser2* browser, const std::wstring& url , bool isDocumentBrowser);
62 static DWORD WINAPI TabThreadProc(LPVOID pParam); 62 static DWORD WINAPI TabThreadProc(LPVOID pParam);
63 void CacheFrame(const CString& url); 63 void CacheFrame(const std::wstring& url);
64 bool IsFrameCached(const CString& url); 64 bool IsFrameCached(const std::wstring& url);
65 void ClearFrameCache(const std::wstring& domain=L""); 65 void ClearFrameCache(const std::wstring& domain=L"");
66 66
67 }; 67 };
68 68
69 69
70 #endif // _PLUGIN_TAB_BASE_H_ 70 #endif // _PLUGIN_TAB_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld