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

Delta Between Two Patch Sets: src/plugin/PluginClass.h

Issue 29333107: Issue #1652, #3456 - Replace 's_asyncWebBrowser2' with thread-safe facilities
Left Patch Set: Created Dec. 29, 2015, 5:54 p.m.
Right Patch Set: rebase only Created July 27, 2016, 10:26 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/plugin/Instances.h ('k') | src/plugin/PluginClass.cpp » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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-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
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details. 12 * GNU General Public License for more details.
13 * 13 *
(...skipping 19 matching lines...) Expand all
33 #include "NotificationMessage.h" 33 #include "NotificationMessage.h"
34 34
35 #define ICON_PLUGIN_DISABLED 0 35 #define ICON_PLUGIN_DISABLED 0
36 #define ICON_PLUGIN_ENABLED 1 36 #define ICON_PLUGIN_ENABLED 1
37 #define ICON_PLUGIN_DEACTIVATED 2 37 #define ICON_PLUGIN_DEACTIVATED 2
38 #define ICON_MAX 3 38 #define ICON_MAX 3
39 39
40 #define WM_LAUNCH_INFO (WM_APP + 10) 40 #define WM_LAUNCH_INFO (WM_APP + 10)
41 41
42 class CPluginMimeFilterClient; 42 class CPluginMimeFilterClient;
43
44 43
45 class ATL_NO_VTABLE CPluginClass : 44 class ATL_NO_VTABLE CPluginClass :
46 public ATL::CComObjectRootEx<ATL::CComMultiThreadModel>, 45 public ATL::CComObjectRootEx<ATL::CComMultiThreadModel>,
47 public ATL::CComCoClass<CPluginClass, &CLSID_PluginClass>, 46 public ATL::CComCoClass<CPluginClass, &CLSID_PluginClass>,
48 public ATL::IObjectWithSiteImpl<CPluginClass>, 47 public ATL::IObjectWithSiteImpl<CPluginClass>,
49 public IOleCommandTarget, 48 public IOleCommandTarget,
50 public ATL::IDispEventImpl<1, CPluginClass, &DIID_DWebBrowserEvents2, &LIBID_S HDocVw, 1, 1> 49 public ATL::IDispEventImpl<1, CPluginClass, &DIID_DWebBrowserEvents2, &LIBID_S HDocVw, 1, 1>
51 { 50 {
52 51
53 friend class CPluginTab; 52 friend class CPluginTab;
(...skipping 27 matching lines...) Expand all
81 ~CPluginClass(); 80 ~CPluginClass();
82 81
83 // IObjectWithSite 82 // IObjectWithSite
84 STDMETHOD(SetSite)(IUnknown *pUnkSite); 83 STDMETHOD(SetSite)(IUnknown *pUnkSite);
85 84
86 // IOleCommandTarget 85 // IOleCommandTarget
87 STDMETHOD(QueryStatus)(const GUID* pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT* pCmdText); 86 STDMETHOD(QueryStatus)(const GUID* pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[ ], OLECMDTEXT* pCmdText);
88 STDMETHOD(Exec)(const GUID*, DWORD nCmdID, DWORD, VARIANTARG*, VARIANTARG* pva Out); 87 STDMETHOD(Exec)(const GUID*, DWORD nCmdID, DWORD, VARIANTARG*, VARIANTARG* pva Out);
89 88
90 89
91 static CPluginTab* GetTab(DWORD dwThreadId); 90 static CPluginTab* GetTabForCurrentThread();
92 CPluginTab* GetTab(); 91 CPluginTab* GetTab();
93 92
94 void UpdateStatusBar(); 93 void UpdateStatusBar();
95 94
96 private: 95 private:
97 96
98 bool SetMenuBar(HMENU hMenu, const std::wstring& url); 97 bool SetMenuBar(HMENU hMenu, const std::wstring& url);
99 HMENU CreatePluginMenu(const std::wstring& url); 98 HMENU CreatePluginMenu(const std::wstring& url);
100 99
101 void DisplayPluginMenu(HMENU hMenu, int nToolbarCmdID, POINT pt, UINT nMenuFla gs); 100 void DisplayPluginMenu(HMENU hMenu, int nToolbarCmdID, POINT pt, UINT nMenuFla gs);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 136
138 void ShowStatusBar(); 137 void ShowStatusBar();
139 138
140 /** 139 /**
141 * A browser interface pointer to our site object 140 * A browser interface pointer to our site object
142 * 141 *
143 * It's values are set and reset solely in SetSite(). 142 * It's values are set and reset solely in SetSite().
144 */ 143 */
145 CComPtr<IWebBrowser2> m_webBrowser2; 144 CComPtr<IWebBrowser2> m_webBrowser2;
146 /** 145 /**
147 * Synchronizes SetSite() with references to our site pointer. 146 * Synchronizes SetSite() with references to our site pointer.
sergei 2016/01/04 15:34:31 I would like to have here a little bit extended co
Eric 2016/01/04 17:49:20 There's nothing I could add here that's not fully
148 */ 147 */
149 std::mutex siteGuard; 148 std::mutex siteGuard;
150 149
151 HWND m_hBrowserWnd; 150 HWND m_hBrowserWnd;
152 HWND m_hTabWnd; 151 HWND m_hTabWnd;
153 HWND m_hStatusBarWnd; 152 HWND m_hStatusBarWnd;
154 HWND m_hPaneWnd; 153 HWND m_hPaneWnd;
155 154
156 WNDPROC m_pWndProcStatus; 155 WNDPROC m_pWndProcStatus;
157 int m_nPaneWidth; 156 int m_nPaneWidth;
(...skipping 15 matching lines...) Expand all
173 static HICON s_hIcons[ICON_MAX]; 172 static HICON s_hIcons[ICON_MAX];
174 static DWORD s_hIconTypes[ICON_MAX]; 173 static DWORD s_hIconTypes[ICON_MAX];
175 174
176 static HICON GetIcon(int type); 175 static HICON GetIcon(int type);
177 176
178 // Main thread 177 // Main thread
179 static HANDLE s_hMainThread; 178 static HANDLE s_hMainThread;
180 static bool s_isMainThreadDone; 179 static bool s_isMainThreadDone;
181 180
182 static HINSTANCE s_hUxtheme; 181 static HINSTANCE s_hUxtheme;
183 static std::map<DWORD,CPluginClass*> s_threadInstances;
184 static CComAutoCriticalSection s_criticalSectionLocal; 182 static CComAutoCriticalSection s_criticalSectionLocal;
185 static CComAutoCriticalSection s_criticalSectionWindow; 183 static CComAutoCriticalSection s_criticalSectionWindow;
186 }; 184 };
187 185
188 OBJECT_ENTRY_AUTO(__uuidof(PluginClass), CPluginClass) 186 OBJECT_ENTRY_AUTO(__uuidof(PluginClass), CPluginClass)
189 187
190
191 #endif // _PLUGIN_CLASS_H_ 188 #endif // _PLUGIN_CLASS_H_
LEFTRIGHT

Powered by Google App Engine
This is Rietveld