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

Issue 10783032: Pass browser locale to the JS code (Closed)

Created:
June 4, 2013, 8:57 a.m. by Wladimir Palant
Modified:
June 19, 2013, 5:24 p.m.
Reviewers:
Felix Dahlke, Oleksandr
Visibility:
Public.

Description

Pass browser locale to the JS code

Patch Set 1 #

Total comments: 5

Patch Set 2 : Fixed review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+23 lines, -10 lines) Patch
M src/engine/main.cpp View 1 2 chunks +15 lines, -4 lines 0 comments Download
M src/plugin/AdblockPlusClient.cpp View 1 chunk +4 lines, -2 lines 0 comments Download
M src/plugin/BuildVariant.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/plugin/PluginClass.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/plugin/PluginClassThread.cpp View 1 1 chunk +1 line, -1 line 0 comments Download
M src/shared/Version.h View 1 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 4
Wladimir Palant
June 4, 2013, 8:57 a.m. (2013-06-04 08:57:49 UTC) #1
Felix Dahlke
http://codereview.adblockplus.org/10783032/diff/1/src/engine/main.cpp File src/engine/main.cpp (right): http://codereview.adblockplus.org/10783032/diff/1/src/engine/main.cpp#newcode167 src/engine/main.cpp:167: AdblockPlus::AppInfo appInfo; The version's missing, would like to see ...
June 4, 2013, 9:46 a.m. (2013-06-04 09:46:09 UTC) #2
Wladimir Palant
I've made sure to set AppInfo.version as well now. This field doesn't need to be ...
June 4, 2013, 11:28 a.m. (2013-06-04 11:28:45 UTC) #3
Felix Dahlke
June 4, 2013, 11:34 a.m. (2013-06-04 11:34:20 UTC) #4
LGTM

http://codereview.adblockplus.org/10783032/diff/1/src/plugin/AdblockPlusClien...
File src/plugin/AdblockPlusClient.cpp (right):

http://codereview.adblockplus.org/10783032/diff/1/src/plugin/AdblockPlusClien...
src/plugin/AdblockPlusClient.cpp:33:
browserLanguage.GetBuffer(browserLanguage.GetLength() + 1),
On 2013/06/04 11:28:45, Wladimir Palant wrote:
> No, it doesn't do the same thing (besides, browserLanguage is a CString, not
> std::string).

Oh, tought it had c_str() or some equivalent. Well it appears it implements the
cast operator, so it can just be const_cast<LPWSTR>(browserLanguage).

According to the docs, CreateProcessAsUserW might write to the
> buffer passed in - GetBuffer() informs the CString class about that. Messing
> with the internal buffer without calling GetBuffer() isn't recommended.

Oh, you're right. From the docs: "The Unicode version of this function,
CreateProcessAsUserW, can modify the contents of this string."

Seems I missed that. GetBuffer is indeed better then.

Powered by Google App Engine
This is Rietveld