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

Side by Side Diff: src/plugin/PluginClass.cpp

Issue 5032147387678720: NoIssue - Refactor HTTP and HTTPS namespaces registration
Patch Set: Rename CPluginMimeFilterClient to CPluginAppNamespaceClient Created April 13, 2015, 3:24 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/plugin/PluginClass.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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-2015 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 *
14 * You should have received a copy of the GNU General Public License 14 * You should have received a copy of the GNU General Public License
15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. 15 * along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>.
16 */ 16 */
17 17
18 #include "PluginStdAfx.h" 18 #include "PluginStdAfx.h"
19 19
20 #include "PluginClass.h" 20 #include "PluginClass.h"
21 #include "PluginSettings.h" 21 #include "PluginSettings.h"
22 #include "PluginSystem.h" 22 #include "PluginSystem.h"
23 #include "PluginFilter.h" 23 #include "PluginFilter.h"
24 #include "PluginMimeFilterClient.h" 24 #include "PluginAppNamespaceClient.h"
25 #include "PluginClient.h" 25 #include "PluginClient.h"
26 #include "PluginMutex.h" 26 #include "PluginMutex.h"
27 #include "sddl.h" 27 #include "sddl.h"
28 #include "PluginUtil.h" 28 #include "PluginUtil.h"
29 #include "PluginUserSettings.h" 29 #include "PluginUserSettings.h"
30 #include "../shared/Utils.h" 30 #include "../shared/Utils.h"
31 #include "../shared/Dictionary.h" 31 #include "../shared/Dictionary.h"
32 #include "../shared/IE_version.h" 32 #include "../shared/IE_version.h"
33 #include <thread> 33 #include <thread>
34 #include <array> 34 #include <array>
35 35
36 #ifdef DEBUG_HIDE_EL 36 #ifdef DEBUG_HIDE_EL
37 DWORD profileTime = 0; 37 DWORD profileTime = 0;
38 #endif 38 #endif
39 39
40 typedef HANDLE (WINAPI *OPENTHEMEDATA)(HWND, LPCWSTR); 40 typedef HANDLE (WINAPI *OPENTHEMEDATA)(HWND, LPCWSTR);
41 typedef HRESULT (WINAPI *DRAWTHEMEBACKGROUND)(HANDLE, HDC, INT, INT, LPRECT, LPR ECT); 41 typedef HRESULT (WINAPI *DRAWTHEMEBACKGROUND)(HANDLE, HDC, INT, INT, LPRECT, LPR ECT);
42 typedef HRESULT (WINAPI *CLOSETHEMEDATA)(HANDLE); 42 typedef HRESULT (WINAPI *CLOSETHEMEDATA)(HANDLE);
43 43
44 HICON CPluginClass::s_hIcons[ICON_MAX] = { NULL, NULL, NULL }; 44 HICON CPluginClass::s_hIcons[ICON_MAX] = { NULL, NULL, NULL };
45 DWORD CPluginClass::s_hIconTypes[ICON_MAX] = { IDI_ICON_DISABLED, IDI_ICON_ENABL ED, IDI_ICON_DEACTIVATED }; 45 DWORD CPluginClass::s_hIconTypes[ICON_MAX] = { IDI_ICON_DISABLED, IDI_ICON_ENABL ED, IDI_ICON_DEACTIVATED };
46 uint32_t iconHeight = 32; 46 uint32_t iconHeight = 32;
47 uint32_t iconWidth = 32; 47 uint32_t iconWidth = 32;
48 48
49 std::shared_ptr<CPluginMimeFilterClient> CPluginClass::s_mimeFilter = NULL; 49 std::shared_ptr<CPluginAppNamespaceClient> CPluginClass::s_mimeFilter = NULL;
50 50
51 CLOSETHEMEDATA pfnClose = NULL; 51 CLOSETHEMEDATA pfnClose = NULL;
52 DRAWTHEMEBACKGROUND pfnDrawThemeBackground = NULL; 52 DRAWTHEMEBACKGROUND pfnDrawThemeBackground = NULL;
53 OPENTHEMEDATA pfnOpenThemeData = NULL; 53 OPENTHEMEDATA pfnOpenThemeData = NULL;
54 54
55 ATOM CPluginClass::s_atomPaneClass = NULL; 55 ATOM CPluginClass::s_atomPaneClass = NULL;
56 HINSTANCE CPluginClass::s_hUxtheme = NULL; 56 HINSTANCE CPluginClass::s_hUxtheme = NULL;
57 std::set<CPluginClass*> CPluginClass::s_instances; 57 std::set<CPluginClass*> CPluginClass::s_instances;
58 std::map<DWORD, CPluginClass*> CPluginClass::s_threadInstances; 58 std::map<DWORD, CPluginClass*> CPluginClass::s_threadInstances;
59 59
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 241
242 //register the mimefilter 242 //register the mimefilter
243 //and only mimefilter 243 //and only mimefilter
244 //on some few computers the mimefilter does not get properly registered wh en it is done on another thread 244 //on some few computers the mimefilter does not get properly registered wh en it is done on another thread
245 245
246 s_criticalSectionLocal.Lock(); 246 s_criticalSectionLocal.Lock();
247 { 247 {
248 // Always register on startup, then check if we need to unregister in a separate thread 248 // Always register on startup, then check if we need to unregister in a separate thread
249 if (!s_mimeFilter) 249 if (!s_mimeFilter)
250 { 250 {
251 s_mimeFilter.reset(new CPluginMimeFilterClient()); 251 s_mimeFilter.reset(new CPluginAppNamespaceClient());
Oleksandr 2015/04/13 03:34:51 It doesn't look like CPluginAppNammespaceClient()
Eric 2015/05/16 21:00:02 It can throw. This constructor calls 'CMetaFactory
252 } 252 }
253 s_asyncWebBrowser2 = unknownSite; 253 s_asyncWebBrowser2 = unknownSite;
254 s_instances.insert(this); 254 s_instances.insert(this);
255 } 255 }
256 s_criticalSectionLocal.Unlock(); 256 s_criticalSectionLocal.Unlock();
257 257
258 try 258 try
259 { 259 {
260 auto webBrowser = GetBrowser(); 260 auto webBrowser = GetBrowser();
261 if (webBrowser) 261 if (webBrowser)
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
1079 { 1079 {
1080 CPluginSettings* settings = CPluginSettings::GetInstance(); 1080 CPluginSettings* settings = CPluginSettings::GetInstance();
1081 1081
1082 settings->TogglePluginEnabled(); 1082 settings->TogglePluginEnabled();
1083 1083
1084 // Enable / disable mime filter 1084 // Enable / disable mime filter
1085 s_criticalSectionLocal.Lock(); 1085 s_criticalSectionLocal.Lock();
1086 { 1086 {
1087 if (settings->GetPluginEnabled()) 1087 if (settings->GetPluginEnabled())
1088 { 1088 {
1089 s_mimeFilter.reset(new CPluginMimeFilterClient()); 1089 s_mimeFilter.reset(new CPluginAppNamespaceClient());
1090 } 1090 }
1091 else 1091 else
1092 { 1092 {
1093 s_mimeFilter.reset(); 1093 s_mimeFilter.reset();
1094 } 1094 }
1095 } 1095 }
1096 s_criticalSectionLocal.Unlock(); 1096 s_criticalSectionLocal.Unlock();
1097 } 1097 }
1098 break; 1098 break;
1099 case ID_MENU_SETTINGS: 1099 case ID_MENU_SETTINGS:
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
1731 s_criticalSectionLocal.Unlock(); 1731 s_criticalSectionLocal.Unlock();
1732 1732
1733 } 1733 }
1734 } 1734 }
1735 } 1735 }
1736 1736
1737 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 1737 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
1738 } 1738 }
1739 return hTabWnd; 1739 return hTabWnd;
1740 } 1740 }
OLDNEW
« no previous file with comments | « src/plugin/PluginClass.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld