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

Unified Diff: src/plugin/PluginClass.h

Issue 29332665: Issue #3391 - Initialize themed drawing variables using DetachedInitializer
Patch Set: Created Dec. 14, 2015, 6:06 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
@@ -29,8 +29,8 @@
#include <stdlib.h>
#include <crtdbg.h>
#include <set>
-
#include "NotificationMessage.h"
+#include "DetachedInitialization.h"
#define ICON_PLUGIN_DISABLED 0
#define ICON_PLUGIN_ENABLED 1
@@ -112,7 +112,6 @@
static DWORD WINAPI StartInitObject(LPVOID thisPtr);
bool InitObject();
- void CloseTheme();
void UpdateTheme();
static HICON GetStatusBarIcon(const std::wstring& url);
@@ -137,6 +136,11 @@
void ShowStatusBar();
bool IsStatusBarEnabled();
+
+ static void Initializer();
+ typedef DetachedInitializer<Initializer> DetachedInitializerType;
+ static DetachedInitializerType di;
+ inline static void EnsureInitialized() { di.EnsureInitialized(); }
/**
* A browser interface pointer to our site object
@@ -175,7 +179,6 @@
static HANDLE s_hMainThread;
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;
« 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