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

Side by Side Diff: Shared/AdblockPlusClient.cpp

Issue 10338036: Fix errors, pass AppInfo (Closed)
Patch Set: Created April 19, 2013, 3:11 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 | « Shared/AdblockPlusClient.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 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginSettings.h" 3 #include "PluginSettings.h"
4 #include "PluginSystem.h" 4 #include "PluginSystem.h"
5 #include "PluginFilter.h" 5 #include "PluginFilter.h"
6 #include "PluginClientFactory.h" 6 #include "PluginClientFactory.h"
7 #include "PluginDictionary.h" 7 #include "PluginDictionary.h"
8 #include "PluginHttpRequest.h" 8 #include "PluginHttpRequest.h"
9 #include "PluginMutex.h" 9 #include "PluginMutex.h"
10 #include "PluginClass.h" 10 #include "PluginClass.h"
11 11
12 #include "AdblockPlusClient.h" 12 #include "AdblockPlusClient.h"
13 13
14 14
15 CAdblockPlusClient* CAdblockPlusClient::s_instance = NULL; 15 CAdblockPlusClient* CAdblockPlusClient::s_instance = NULL;
16 16
17 17
18 CAdblockPlusClient::CAdblockPlusClient() : CPluginClientBase() 18 CAdblockPlusClient::CAdblockPlusClient() : CPluginClientBase()
19 { 19 {
20 m_filter = std::auto_ptr<CPluginFilter>(new CPluginFilter()); 20 m_filter = std::auto_ptr<CPluginFilter>(new CPluginFilter());
21 fileSystem = std::auto_ptr<AdblockPlus::DefaultFileSystem>(new AdblockPlus::De faultFileSystem()); 21 AdblockPlus::AppInfo appInfo;
22 webRequest = std::auto_ptr<AdblockPlus::DefaultWebRequest>(new AdblockPlus::De faultWebRequest()); 22 appInfo.name = "Adblock Plus for Internet Explorer";
Wladimir Palant 2013/04/19 06:35:59 This isn't a string displayed to the user - rather
23 errorCallback = std::auto_ptr<CerrErrorCallback>(new CerrErrorCallback()); 23 appInfo.version = CT2CA(_T(IEPLUGIN_VERSION), CP_UTF8);
24 jsEngine = std::auto_ptr<AdblockPlus::JsEngine>(new AdblockPlus::JsEngine(file System.get(), webRequest.get(), errorCallback.get())); 24 appInfo.platform = "Internet Explorer";
Wladimir Palant 2013/04/19 06:35:59 Same here, it's not a user-visible string - rather
25 filterEngine = std::auto_ptr<AdblockPlus::FilterEngine>(new AdblockPlus::Filte rEngine(*jsEngine)); 25 JsEnginePtr jsEngine(AdblockPlus::JsEngine::New(appInfo));
26 filterEngine = std::auto_ptr<AdblockPlus::FilterEngine>(new AdblockPlus::Filte rEngine(jsEngine));
26 } 27 }
27 CAdblockPlusClient::~CAdblockPlusClient() 28 CAdblockPlusClient::~CAdblockPlusClient()
28 { 29 {
29 s_instance = NULL; 30 s_instance = NULL;
30 } 31 }
31 32
32 33
33 CAdblockPlusClient* CAdblockPlusClient::GetInstance() 34 CAdblockPlusClient* CAdblockPlusClient::GetInstance()
34 { 35 {
35 CAdblockPlusClient* instance = NULL; 36 CAdblockPlusClient* instance = NULL;
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 BYTE version[50]; 144 BYTE version[50];
144 cbData = 50; 145 cbData = 50;
145 status = RegQueryValueEx(hKey, L"Version", NULL, &type, (BYTE*)version, &cbDat a); 146 status = RegQueryValueEx(hKey, L"Version", NULL, &type, (BYTE*)version, &cbDat a);
146 if (status != 0) 147 if (status != 0)
147 { 148 {
148 return 0; 149 return 0;
149 } 150 }
150 RegCloseKey(hKey); 151 RegCloseKey(hKey);
151 return (int)(version[0] - 48); 152 return (int)(version[0] - 48);
152 } 153 }
OLDNEW
« no previous file with comments | « Shared/AdblockPlusClient.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld