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

Issue 10897028: Create a shared dictionary class for plugin and engine (Closed)

Created:
June 7, 2013, 12:42 p.m. by Wladimir Palant
Modified:
Nov. 8, 2013, 6:16 a.m.
Visibility:
Public.

Description

This also moves the locales into the application install directory as well as switches to a better format (no separate files for the settings page strings, per-language dictionaries so unused languages don`t need to be read in and sections for better grouping of the strings).

Patch Set 1 #

Total comments: 24
Unified diffs Side-by-side diffs Delta from patch set Stats (+479 lines, -489 lines) Patch
M AdblockPlusEngine.vcxproj View 1 chunk +5 lines, -9 lines 0 comments Download
M AdblockPlusPlugin.vcxproj View 12 chunks +20 lines, -26 lines 0 comments Download
M WixInstaller/adblockplusie.wxs View 3 chunks +16 lines, -4 lines 1 comment Download
M adblockplus.gyp View 1 chunk +4 lines, -1 line 0 comments Download
R files/dictionary_w.ini View Binary file 0 comments Download
R files/settings_page_w.ini View Binary file 0 comments Download
A locales/en.ini View 1 chunk +39 lines, -0 lines 0 comments Download
A locales/ru.ini View 1 chunk +14 lines, -0 lines 0 comments Download
M src/engine/Updater.cpp View 4 chunks +22 lines, -6 lines 0 comments Download
M src/engine/engine.rc View 1 chunk +4 lines, -4 lines 0 comments Download
M src/engine/main.cpp View 2 chunks +3 lines, -1 line 0 comments Download
M src/plugin/AdblockPlusClient.cpp View 1 chunk +5 lines, -5 lines 3 comments Download
M src/plugin/Plugin.cpp View 2 chunks +3 lines, -4 lines 1 comment Download
M src/plugin/PluginClass.cpp View 5 chunks +49 lines, -43 lines 2 comments Download
M src/plugin/PluginClassThread.cpp View 2 chunks +0 lines, -3 lines 0 comments Download
M src/plugin/PluginClientBase.cpp View 2 chunks +0 lines, -4 lines 0 comments Download
R src/plugin/PluginDictionary.h View 1 chunk +0 lines, -41 lines 0 comments Download
R src/plugin/PluginDictionary.cpp View 1 chunk +0 lines, -296 lines 0 comments Download
M src/plugin/PluginSettings.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M src/plugin/PluginTabBase.cpp View 2 chunks +1 line, -5 lines 0 comments Download
M src/plugin/PluginUserSettings.cpp View 1 chunk +0 lines, -1 line 0 comments Download
M src/plugin/PluginUtil.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/plugin/PluginUtil.cpp View 2 chunks +2 lines, -31 lines 0 comments Download
A src/shared/Dictionary.h View 1 chunk +28 lines, -0 lines 0 comments Download
A src/shared/Dictionary.cpp View 1 chunk +90 lines, -0 lines 17 comments Download
M src/shared/Utils.h View 1 chunk +17 lines, -1 line 0 comments Download
M src/shared/Utils.cpp View 1 chunk +50 lines, -2 lines 0 comments Download
A test/DictionaryTest.cpp View 1 chunk +107 lines, -0 lines 0 comments Download

Messages

Total messages: 14
Wladimir Palant
June 7, 2013, 12:42 p.m. (2013-06-07 12:42:25 UTC) #1
Eric
Comment on installer issues. http://codereview.adblockplus.org/10897028/diff/1/WixInstaller/adblockplusie.wxs File WixInstaller/adblockplusie.wxs (left): http://codereview.adblockplus.org/10897028/diff/1/WixInstaller/adblockplusie.wxs#oldcode58 WixInstaller/adblockplusie.wxs:58: --> These installer changes are ...
June 7, 2013, 2:06 p.m. (2013-06-07 14:06:23 UTC) #2
Wladimir Palant
http://codereview.adblockplus.org/10897028/diff/1/src/plugin/Plugin.cpp File src/plugin/Plugin.cpp (right): http://codereview.adblockplus.org/10897028/diff/1/src/plugin/Plugin.cpp#newcode142 src/plugin/Plugin.cpp:142: Dictionary::Create(locale); I realized that this isn't the right place ...
June 10, 2013, 8:45 a.m. (2013-06-10 08:45:06 UTC) #3
Felix Dahlke
http://codereview.adblockplus.org/10897028/diff/1/src/plugin/AdblockPlusClient.cpp File src/plugin/AdblockPlusClient.cpp (right): http://codereview.adblockplus.org/10897028/diff/1/src/plugin/AdblockPlusClient.cpp#newcode21 src/plugin/AdblockPlusClient.cpp:21: CString params = L"AdblockPlusEngine.exe " + CPluginSystem::GetInstance()->GetBrowserLanguage(); From the ...
June 11, 2013, 12:31 p.m. (2013-06-11 12:31:14 UTC) #4
Wladimir Palant
http://codereview.adblockplus.org/10897028/diff/1/src/plugin/AdblockPlusClient.cpp File src/plugin/AdblockPlusClient.cpp (right): http://codereview.adblockplus.org/10897028/diff/1/src/plugin/AdblockPlusClient.cpp#newcode21 src/plugin/AdblockPlusClient.cpp:21: CString params = L"AdblockPlusEngine.exe " + CPluginSystem::GetInstance()->GetBrowserLanguage(); On 2013/06/11 ...
June 12, 2013, 1:46 p.m. (2013-06-12 13:46:07 UTC) #5
Felix Dahlke
http://codereview.adblockplus.org/10897028/diff/1/src/plugin/AdblockPlusClient.cpp File src/plugin/AdblockPlusClient.cpp (right): http://codereview.adblockplus.org/10897028/diff/1/src/plugin/AdblockPlusClient.cpp#newcode21 src/plugin/AdblockPlusClient.cpp:21: CString params = L"AdblockPlusEngine.exe " + CPluginSystem::GetInstance()->GetBrowserLanguage(); On 2013/06/12 ...
June 13, 2013, 6:07 p.m. (2013-06-13 18:07:36 UTC) #6
Oleksandr
LGTM in general. Just 2 comments. http://codereview.adblockplus.org/10897028/diff/1/src/plugin/PluginClass.cpp File src/plugin/PluginClass.cpp (left): http://codereview.adblockplus.org/10897028/diff/1/src/plugin/PluginClass.cpp#oldcode1527 src/plugin/PluginClass.cpp:1527: This is a ...
June 18, 2013, 7:41 a.m. (2013-06-18 07:41:09 UTC) #7
Wladimir Palant
http://codereview.adblockplus.org/10897028/diff/1/src/plugin/PluginClass.cpp File src/plugin/PluginClass.cpp (left): http://codereview.adblockplus.org/10897028/diff/1/src/plugin/PluginClass.cpp#oldcode1527 src/plugin/PluginClass.cpp:1527: On 2013/06/18 07:41:09, Oleksandr wrote: > This is a ...
June 18, 2013, 8:17 a.m. (2013-06-18 08:17:48 UTC) #8
Wladimir Palant
http://codereview.adblockplus.org/10897028/diff/1/src/shared/Dictionary.cpp File src/shared/Dictionary.cpp (right): http://codereview.adblockplus.org/10897028/diff/1/src/shared/Dictionary.cpp#newcode45 src/shared/Dictionary.cpp:45: std::ifstream stream(basePath + locale + L".ini"); On 2013/06/18 07:41:09, ...
Nov. 5, 2013, 11:30 a.m. (2013-11-05 11:30:25 UTC) #9
Eric
http://codereview.adblockplus.org/10897028/diff/1/src/shared/Dictionary.cpp File src/shared/Dictionary.cpp (right): http://codereview.adblockplus.org/10897028/diff/1/src/shared/Dictionary.cpp#newcode45 src/shared/Dictionary.cpp:45: std::ifstream stream(basePath + locale + L".ini"); On 2013/11/05 11:30:25, ...
Nov. 5, 2013, 1:56 p.m. (2013-11-05 13:56:05 UTC) #10
Wladimir Palant
http://codereview.adblockplus.org/10897028/diff/1/src/shared/Dictionary.cpp File src/shared/Dictionary.cpp (right): http://codereview.adblockplus.org/10897028/diff/1/src/shared/Dictionary.cpp#newcode45 src/shared/Dictionary.cpp:45: std::ifstream stream(basePath + locale + L".ini"); On 2013/11/05 13:56:06, ...
Nov. 6, 2013, 8:51 a.m. (2013-11-06 08:51:46 UTC) #11
Eric
http://codereview.adblockplus.org/10897028/diff/1/src/shared/Dictionary.cpp File src/shared/Dictionary.cpp (right): http://codereview.adblockplus.org/10897028/diff/1/src/shared/Dictionary.cpp#newcode45 src/shared/Dictionary.cpp:45: std::ifstream stream(basePath + locale + L".ini"); After realizing that ...
Nov. 6, 2013, 5:49 p.m. (2013-11-06 17:49:53 UTC) #12
Felix Dahlke
http://codereview.adblockplus.org/10897028/diff/1/src/shared/Dictionary.cpp File src/shared/Dictionary.cpp (right): http://codereview.adblockplus.org/10897028/diff/1/src/shared/Dictionary.cpp#newcode45 src/shared/Dictionary.cpp:45: std::ifstream stream(basePath + locale + L".ini"); On 2013/11/06 17:49:53, ...
Nov. 6, 2013, 11:09 p.m. (2013-11-06 23:09:50 UTC) #13
Wladimir Palant
Nov. 7, 2013, 6:53 a.m. (2013-11-07 06:53:57 UTC) #14
http://codereview.adblockplus.org/10897028/diff/1/src/shared/Dictionary.cpp
File src/shared/Dictionary.cpp (right):

http://codereview.adblockplus.org/10897028/diff/1/src/shared/Dictionary.cpp#n...
src/shared/Dictionary.cpp:45: std::ifstream stream(basePath + locale + L".ini");
According to http://msdn.microsoft.com/en-us/library/vstudio/zek0beca.aspx
std::ifstream constructor also has a Microsoft-specific _Prot parameter
defaulting to ios_base::_Openprot. Looking inside xiosbase header where it is
defined I see the following:

#define _OPENPROT     _SH_DENYNO

Apparently, we could simply pass in some sharing flag from Share.h here.
However, the default is already the most permissive sharing mode which is
exactly what we need (the dictionary files are only being modified by the
installer and the application isn't running there). I guess I can close that
review then, we don't have to do anything.

Powered by Google App Engine
This is Rietveld