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

Side by Side Diff: src/engine/main.cpp

Issue 10894013: Pass developmentBuild info to libadblockplus (Closed)
Patch Set: Created June 5, 2013, 10:10 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 | « AdblockPlusEngine.vcxproj ('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 "stdafx.h" 1 #include "stdafx.h"
2 2
3 #include "../shared/AutoHandle.h" 3 #include "../shared/AutoHandle.h"
4 #include "../shared/Communication.h" 4 #include "../shared/Communication.h"
5 #include "../shared/Utils.h" 5 #include "../shared/Utils.h"
6 #include "../shared/Version.h" 6 #include "../shared/Version.h"
7 #include "Debug.h" 7 #include "Debug.h"
8 8
9 namespace 9 namespace
10 { 10 {
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 163 }
164 } 164 }
165 165
166 std::auto_ptr<AdblockPlus::FilterEngine> CreateFilterEngine(const std::wstring& locale) 166 std::auto_ptr<AdblockPlus::FilterEngine> CreateFilterEngine(const std::wstring& locale)
167 { 167 {
168 AdblockPlus::AppInfo appInfo; 168 AdblockPlus::AppInfo appInfo;
169 appInfo.version = ToUtf8String(IEPLUGIN_VERSION); 169 appInfo.version = ToUtf8String(IEPLUGIN_VERSION);
170 appInfo.name = "adblockplusie"; 170 appInfo.name = "adblockplusie";
171 appInfo.platform = "msie"; 171 appInfo.platform = "msie";
172 appInfo.locale = ToUtf8String(locale); 172 appInfo.locale = ToUtf8String(locale);
173 #ifdef ADBLOCK_PLUS_TEST_MODE
174 appInfo.developmentBuild = true;
175 #else
176 appInfo.developmentBuild = false;
177 #endif
173 178
174 AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::New(appInfo); 179 AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::New(appInfo);
175 std::string dataPath = ToUtf8String(GetAppDataPath()); 180 std::string dataPath = ToUtf8String(GetAppDataPath());
176 dynamic_cast<AdblockPlus::DefaultFileSystem*>(jsEngine->GetFileSystem().get()) ->SetBasePath(dataPath); 181 dynamic_cast<AdblockPlus::DefaultFileSystem*>(jsEngine->GetFileSystem().get()) ->SetBasePath(dataPath);
177 std::auto_ptr<AdblockPlus::FilterEngine> filterEngine(new AdblockPlus::FilterE ngine(jsEngine)); 182 std::auto_ptr<AdblockPlus::FilterEngine> filterEngine(new AdblockPlus::FilterE ngine(jsEngine));
178 return filterEngine; 183 return filterEngine;
179 } 184 }
180 185
181 int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 186 int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
182 { 187 {
(...skipping 29 matching lines...) Expand all
212 } 217 }
213 catch (std::runtime_error e) 218 catch (std::runtime_error e)
214 { 219 {
215 DebugException(e); 220 DebugException(e);
216 return 1; 221 return 1;
217 } 222 }
218 } 223 }
219 224
220 return 0; 225 return 0;
221 } 226 }
OLDNEW
« no previous file with comments | « AdblockPlusEngine.vcxproj ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld