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

Unified Diff: src/engine/main.cpp

Issue 10897028: Create a shared dictionary class for plugin and engine (Closed)
Patch Set: Created June 7, 2013, 12:42 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
Index: src/engine/main.cpp
===================================================================
--- a/src/engine/main.cpp
+++ b/src/engine/main.cpp
@@ -1,15 +1,16 @@
#include <AdblockPlus.h>
#include <functional>
#include <vector>
#include <Windows.h>
#include "../shared/AutoHandle.h"
#include "../shared/Communication.h"
+#include "../shared/Dictionary.h"
#include "../shared/Utils.h"
#include "../shared/Version.h"
#include "Debug.h"
#include "Updater.h"
namespace
{
std::auto_ptr<AdblockPlus::FilterEngine> filterEngine;
@@ -193,19 +194,20 @@ int WINAPI WinMain(HINSTANCE, HINSTANCE,
// fails. Since multiple instances of the engine could be running,
// this may need named mutices to avoid race conditions.
// Note that as soon as the pipe is created first, we can reduce the
// client timeout after CreateProcess(), but should increase the one
// in WaitNamedPipe().
int argc;
LPWSTR* argv = CommandLineToArgvW(GetCommandLineW(), &argc);
- std::wstring locale(argc >= 1 ? argv[0] : L"");
+ std::wstring locale(argc >= 2 ? argv[1] : L"");
LocalFree(argv);
+ Dictionary::Create(locale);
filterEngine = CreateFilterEngine(locale);
for (;;)
{
try
{
Communication::Pipe* pipe = new Communication::Pipe(Communication::pipeName,
Communication::Pipe::MODE_CREATE);

Powered by Google App Engine
This is Rietveld