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

Unified Diff: src/plugin/PluginClass.h

Issue 29323561: Issue #3383 - Rewrite and simplify browser-site handling in CPluginClass (Closed)
Patch Set: address comments Created Nov. 30, 2015, 4:30 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/plugin/PluginClass.cpp » ('j') | src/plugin/PluginClass.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginClass.h
===================================================================
--- a/src/plugin/PluginClass.h
+++ b/src/plugin/PluginClass.h
@@ -79,15 +79,10 @@
CPluginClass();
~CPluginClass();
- HRESULT FinalConstruct();
- void FinalRelease();
-
// IObjectWithSite
-
STDMETHOD(SetSite)(IUnknown *pUnkSite);
// IOleCommandTarget
-
STDMETHOD(QueryStatus)(const GUID* pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT* pCmdText);
STDMETHOD(Exec)(const GUID*, DWORD nCmdID, DWORD, VARIANTARG*, VARIANTARG* pvaOut);
@@ -96,7 +91,6 @@
CPluginTab* GetTab();
void UpdateStatusBar();
- static DWORD WINAPI MainThreadProc(LPVOID pParam);
private:
@@ -108,9 +102,7 @@
public:
HWND GetBrowserHWND() const;
- HWND GetTabHWND() const;
- CComQIPtr<IWebBrowser2> GetBrowser() const;
-
+ bool IsRootBrowser(IWebBrowser2*);
static CPluginMimeFilterClient* s_mimeFilter;
@@ -146,9 +138,15 @@
void ShowStatusBar();
bool IsStatusBarEnabled();
-public:
- CComQIPtr<IWebBrowser2> m_webBrowser2;
-private:
+ /**
+ * Our site object as a browser.
+ *
+ * It's values are set and reset solely in SetSite().
+ * The declaration as CComPtr is defensive programming;
+ * it ensures that the site keeps this interface alive for us in the
+ * unlikely case that the site is different from a browser.
+ */
+ CComPtr<IWebBrowser2> m_webBrowser2;
HWND m_hBrowserWnd;
HWND m_hTabWnd;
HWND m_hStatusBarWnd;
@@ -180,14 +178,10 @@
static HANDLE s_hMainThread;
static bool s_isMainThreadDone;
- static HANDLE GetMainThreadHandle();
- static bool IsMainThreadDone(HANDLE mainThread);
-
static HINSTANCE s_hUxtheme;
static std::set<CPluginClass*> s_instances;
static std::map<DWORD,CPluginClass*> s_threadInstances;
static CComAutoCriticalSection s_criticalSectionLocal;
- static CComAutoCriticalSection s_criticalSectionBrowser;
static CComAutoCriticalSection s_criticalSectionWindow;
// Async browser
« no previous file with comments | « no previous file | src/plugin/PluginClass.cpp » ('j') | src/plugin/PluginClass.cpp » ('J')

Powered by Google App Engine
This is Rietveld