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

Issue 10580043: Run a single FilterEngine instance in a separate process (Closed)

Created:
May 16, 2013, 4:42 a.m. by Felix Dahlke
Modified:
Nov. 12, 2013, 10:10 a.m.
Visibility:
Public.

Description

These are all the changes we made in the ipc branch. Note that there are several TODOs yet unaddressed. I think it's best to review and merge the branch now, so that we don't diverge further. All the new code not marked with TODO should be clean and robust. Note that while this fixes blocking and hiding, it breaks the settings page. @Oleksandr: I added you as a reviewer as well because I refactored quite a bit before uploading the review.

Patch Set 1 : #

Total comments: 63

Patch Set 2 : Addressed all issues #

Total comments: 9

Patch Set 3 : Addressed review issues #

Unified diffs Side-by-side diffs Delta from patch set Stats (+689 lines, -47 lines) Patch
M .hgignore View 1 1 chunk +4 lines, -0 lines 0 comments Download
M AdBlocker/AdBlocker.vcxproj View 2 chunks +2 lines, -2 lines 0 comments Download
M AdPlugin.sln View 1 2 chunks +38 lines, -1 line 0 comments Download
A AdblockPlusEngine/AdblockPlusEngine.vcxproj View 1 1 chunk +98 lines, -0 lines 0 comments Download
A AdblockPlusEngine/AdblockPlusEngine.vcxproj.filters View 1 chunk +22 lines, -0 lines 0 comments Download
A AdblockPlusEngine/main.cpp View 1 2 1 chunk +268 lines, -0 lines 0 comments Download
M Shared/AdblockPlusClient.h View 2 chunks +7 lines, -2 lines 0 comments Download
M Shared/AdblockPlusClient.cpp View 1 2 3 chunks +237 lines, -24 lines 0 comments Download
M Shared/PluginFilter.cpp View 2 chunks +1 line, -2 lines 0 comments Download
M Shared/PluginSettings.cpp View 8 chunks +10 lines, -15 lines 0 comments Download
M Shared/PluginStdAfx.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Shared/PluginTabBase.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 11
Felix Dahlke
http://codereview.adblockplus.org/10580043/diff/6001/AdBlocker/AdBlocker.vcxproj File AdBlocker/AdBlocker.vcxproj (right): http://codereview.adblockplus.org/10580043/diff/6001/AdBlocker/AdBlocker.vcxproj#newcode454 AdBlocker/AdBlocker.vcxproj:454: <AdditionalLibraryDirectories>$(SolutionDir)..\libadblockplus\build\ia32\build\Debug\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> This change is unrelated to IPC, was necessary ...
May 16, 2013, 5:30 a.m. (2013-05-16 05:30:53 UTC) #1
Wladimir Palant
http://codereview.adblockplus.org/10580043/diff/6001/.hgignore File .hgignore (right): http://codereview.adblockplus.org/10580043/diff/6001/.hgignore#newcode30 .hgignore:30: Debug Production I hope this will be addressed while ...
May 16, 2013, 11:52 a.m. (2013-05-16 11:52:16 UTC) #2
Oleksandr
Agree with Wladimir's comments everywhere else. http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/AdblockPlusEngine.vcxproj File AdblockPlusEngine/AdblockPlusEngine.vcxproj (right): http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/AdblockPlusEngine.vcxproj#newcode15 AdblockPlusEngine/AdblockPlusEngine.vcxproj:15: </ProjectConfiguration> Not necessary. ...
May 16, 2013, 1:23 p.m. (2013-05-16 13:23:22 UTC) #3
Wladimir Palant
http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/AdblockPlusEngine.vcxproj File AdblockPlusEngine/AdblockPlusEngine.vcxproj (right): http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/AdblockPlusEngine.vcxproj#newcode15 AdblockPlusEngine/AdblockPlusEngine.vcxproj:15: </ProjectConfiguration> On 2013/05/16 13:23:22, Oleksandr wrote: > Not necessary. ...
May 17, 2013, 5:23 a.m. (2013-05-17 05:23:51 UTC) #4
Felix Dahlke
Some comments below. I'll address all the other issues. http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/main.cpp File AdblockPlusEngine/main.cpp (right): http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/main.cpp#newcode7 AdblockPlusEngine/main.cpp:7: ...
May 17, 2013, 9:11 a.m. (2013-05-17 09:11:36 UTC) #5
Wladimir Palant
http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/main.cpp File AdblockPlusEngine/main.cpp (right): http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/main.cpp#newcode171 AdblockPlusEngine/main.cpp:171: wcscpy_s(appDataPath, dataPath); Then maybe get rid of that assumption? ...
May 17, 2013, 10:35 a.m. (2013-05-17 10:35:02 UTC) #6
Felix Dahlke
Uploaded a new patch set addressing all issues. http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/AdblockPlusEngine.vcxproj File AdblockPlusEngine/AdblockPlusEngine.vcxproj (right): http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/AdblockPlusEngine.vcxproj#newcode15 AdblockPlusEngine/AdblockPlusEngine.vcxproj:15: </ProjectConfiguration> ...
May 23, 2013, 12:31 p.m. (2013-05-23 12:31:20 UTC) #7
Oleksandr
http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/main.cpp File AdblockPlusEngine/main.cpp (right): http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/main.cpp#newcode169 AdblockPlusEngine/main.cpp:169: if (FAILED(SHGetKnownFolderPath(FOLDERID_LocalAppDataLow, 0, 0, &dataPath))) We are not statically ...
May 23, 2013, 12:38 p.m. (2013-05-23 12:38:11 UTC) #8
Wladimir Palant
http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/main.cpp File AdblockPlusEngine/main.cpp (right): http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/main.cpp#newcode87 AdblockPlusEngine/main.cpp:87: std::string string(converted); No real objections but the function name ...
May 23, 2013, 2:25 p.m. (2013-05-23 14:25:01 UTC) #9
Felix Dahlke
Uploaded a new patch set addressing all issues, except those discussed below. http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/main.cpp File AdblockPlusEngine/main.cpp ...
May 23, 2013, 7:10 p.m. (2013-05-23 19:10:43 UTC) #10
Wladimir Palant
May 23, 2013, 8:10 p.m. (2013-05-23 20:10:15 UTC) #11
LGTM but please add a TODO comment on creating the pipe earlier.

http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/main.cpp
File AdblockPlusEngine/main.cpp (right):

http://codereview.adblockplus.org/10580043/diff/6001/AdblockPlusEngine/main.c...
AdblockPlusEngine/main.cpp:225: int WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR,
int)
Yes, that's something I thought about as well. This should still make sure there
aren't any race conditions.

http://codereview.adblockplus.org/10580043/diff/18001/AdblockPlusEngine/main.cpp
File AdblockPlusEngine/main.cpp (right):

http://codereview.adblockplus.org/10580043/diff/18001/AdblockPlusEngine/main....
AdblockPlusEngine/main.cpp:11: const std::wstring pipeName =
L"\\\\.\\pipe\\adblockplusengine";
Not sure whether the user name can be changed but definitely not when the user
is logged in - so not an issue.

http://codereview.adblockplus.org/10580043/diff/18001/AdblockPlusEngine/main....
AdblockPlusEngine/main.cpp:82: int size = WideCharToMultiByte(CP_UTF8, 0,
value.c_str(), value.length(), 0, 0, 0, 0);
We should actually crash early here. While I cannot imagine what can cause a
conversion to UTF8 to fail, I am certain that I don't want to program to try
continue working after it - it might cause unexplainable issues further on.

The second return value is ignored because WideCharToMultiByte supposedly
checked the string on first call - it shouldn't detect any new issues on next
round.

Powered by Google App Engine
This is Rietveld