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

Unified Diff: src/plugin/PluginClass.h

Issue 29333107: Issue #1652, #3456 - Replace 's_asyncWebBrowser2' with thread-safe facilities
Patch Set: Created Dec. 29, 2015, 5:54 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
Index: src/plugin/PluginClass.h
===================================================================
--- a/src/plugin/PluginClass.h
+++ b/src/plugin/PluginClass.h
@@ -28,7 +28,7 @@
#define _CRTDBG_MAP_ALLOC
#include <stdlib.h>
#include <crtdbg.h>
-#include <set>
+#include <mutex>
#include "NotificationMessage.h"
@@ -51,6 +51,7 @@
{
friend class CPluginTab;
+ friend class AnyCurrentSiteBrowser;
private:
@@ -103,7 +104,6 @@
public:
HWND GetBrowserHWND() const;
bool IsRootBrowser(IWebBrowser2*);
-
static CPluginMimeFilterClient* s_mimeFilter;
private:
@@ -136,7 +136,6 @@
void Unadvise();
void ShowStatusBar();
- bool IsStatusBarEnabled();
/**
* A browser interface pointer to our site object
@@ -144,6 +143,11 @@
* It's values are set and reset solely in SetSite().
*/
CComPtr<IWebBrowser2> m_webBrowser2;
+ /**
+ * 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
+ */
+ std::mutex siteGuard;
+
HWND m_hBrowserWnd;
HWND m_hTabWnd;
HWND m_hStatusBarWnd;
@@ -176,14 +180,9 @@
static bool s_isMainThreadDone;
static HINSTANCE s_hUxtheme;
- static std::set<CPluginClass*> s_instances;
static std::map<DWORD,CPluginClass*> s_threadInstances;
static CComAutoCriticalSection s_criticalSectionLocal;
static CComAutoCriticalSection s_criticalSectionWindow;
-
- // Async browser
- static CComQIPtr<IWebBrowser2> s_asyncWebBrowser2;
- static CComQIPtr<IWebBrowser2> GetAsyncBrowser();
};
OBJECT_ENTRY_AUTO(__uuidof(PluginClass), CPluginClass)

Powered by Google App Engine
This is Rietveld