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

Unified Diff: src/plugin/AdblockPlusClient.cpp

Issue 10783032: Pass browser locale to the JS code (Closed)
Patch Set: Fixed review comments Created June 4, 2013, 11:25 a.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
« no previous file with comments | « src/engine/main.cpp ('k') | src/plugin/BuildVariant.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/AdblockPlusClient.cpp
===================================================================
--- a/src/plugin/AdblockPlusClient.cpp
+++ b/src/plugin/AdblockPlusClient.cpp
@@ -15,26 +15,28 @@
#include "../shared/AutoHandle.h"
#include "../shared/Communication.h"
namespace
{
void SpawnAdblockPlusEngine()
{
std::wstring engineExecutablePath = DllDir() + L"AdblockPlusEngine.exe";
+ CString browserLanguage = CPluginSystem::GetInstance()->GetBrowserLanguage();
STARTUPINFO startupInfo = {};
PROCESS_INFORMATION processInformation = {};
HANDLE token;
OpenProcessToken(GetCurrentProcess(), TOKEN_DUPLICATE | TOKEN_ADJUST_DEFAULT | TOKEN_QUERY | TOKEN_ASSIGN_PRIMARY, &token);
HANDLE newToken;
DuplicateTokenEx(token, 0, 0, SecurityImpersonation, TokenPrimary, &newToken);
- if (!CreateProcessAsUser(newToken, 0, const_cast<wchar_t*>(engineExecutablePath.c_str()), 0, 0, 0, 0, 0, 0,
- &startupInfo, &processInformation))
+ if (!CreateProcessAsUserW(newToken, engineExecutablePath.c_str(),
+ browserLanguage.GetBuffer(browserLanguage.GetLength() + 1),
+ 0, 0, 0, 0, 0, 0, &startupInfo, &processInformation))
{
DWORD error = GetLastError();
throw std::runtime_error("Failed to start Adblock Plus Engine");
}
CloseHandle(processInformation.hProcess);
CloseHandle(processInformation.hThread);
}
« no previous file with comments | « src/engine/main.cpp ('k') | src/plugin/BuildVariant.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld