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

Delta Between Two Patch Sets: src/engine/main.cpp

Issue 10894013: Pass developmentBuild info to libadblockplus (Closed)
Left Patch Set: Created June 5, 2013, 9:40 a.m.
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « AdblockPlusEngine.vcxproj ('k') | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 173 #ifdef ADBLOCK_PLUS_TEST_MODE
174 appInfo.developmentBuild = true; 174 appInfo.developmentBuild = true;
Wladimir Palant 2013/06/05 09:54:05 Please add #else and set it to false explicitly in
Felix Dahlke 2013/06/05 10:12:36 Fair enough, wouldn't hurt.
175 #else
176 appInfo.developmentBuild = false;
175 #endif 177 #endif
176 178
177 AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::New(appInfo); 179 AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::New(appInfo);
178 std::string dataPath = ToUtf8String(GetAppDataPath()); 180 std::string dataPath = ToUtf8String(GetAppDataPath());
179 dynamic_cast<AdblockPlus::DefaultFileSystem*>(jsEngine->GetFileSystem().get()) ->SetBasePath(dataPath); 181 dynamic_cast<AdblockPlus::DefaultFileSystem*>(jsEngine->GetFileSystem().get()) ->SetBasePath(dataPath);
180 std::auto_ptr<AdblockPlus::FilterEngine> filterEngine(new AdblockPlus::FilterE ngine(jsEngine)); 182 std::auto_ptr<AdblockPlus::FilterEngine> filterEngine(new AdblockPlus::FilterE ngine(jsEngine));
181 return filterEngine; 183 return filterEngine;
182 } 184 }
183 185
184 int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) 186 int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
(...skipping 30 matching lines...) Expand all
215 } 217 }
216 catch (std::runtime_error e) 218 catch (std::runtime_error e)
217 { 219 {
218 DebugException(e); 220 DebugException(e);
219 return 1; 221 return 1;
220 } 222 }
221 } 223 }
222 224
223 return 0; 225 return 0;
224 } 226 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld