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

Issue 9987009: Interface for the libadblockplus API (Closed)

Created:
March 26, 2013, 11:45 a.m. by Felix Dahlke
Modified:
Nov. 12, 2013, 10 a.m.
Reviewers:
Oleksandr
CC:
Wladimir Palant
Visibility:
Public.

Description

Here's the interface I came up with. This is just to get us started, a couple of things are missing, like managing custom filters. Having a single, ambigiously named class as the API is not brilliant, but I think it'll do for now. Passing the JsEngine instance in is also something I think we'll only have temporarily. I would like to make JsEngine invisible to the client at some point. We'll also want to add something like Doxygen in the future, but I figured we better wait until we're happy with the API.

Patch Set 1 #

Total comments: 2

Patch Set 2 : Rename to FilterEngine, add a dummy implementation #

Total comments: 2

Patch Set 3 : Some changes to the API, implemented stubs #

Patch Set 4 : Renamed match method, added tests for the stubs #

Patch Set 5 : Use new API in the shell #

Patch Set 6 : Reduce redundant redundancy #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+248 lines, -50 lines) Patch
M include/AdblockPlus.h View 1 1 chunk +1 line, -0 lines 0 comments Download
A include/AdblockPlus/FilterEngine.h View 1 2 3 4 5 1 chunk +34 lines, -0 lines 0 comments Download
M libadblockplus.gyp View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M shell/src/Command.h View 1 2 3 4 2 chunks +4 lines, -0 lines 1 comment Download
M shell/src/Command.cpp View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M shell/src/Main.cpp View 1 2 3 4 1 chunk +18 lines, -19 lines 1 comment Download
M shell/src/MatchesCommand.h View 1 2 3 4 1 chunk +6 lines, -1 line 0 comments Download
M shell/src/MatchesCommand.cpp View 1 2 3 4 5 2 chunks +21 lines, -2 lines 0 comments Download
M shell/src/SubscriptionsCommand.h View 1 2 3 4 1 chunk +4 lines, -3 lines 0 comments Download
M shell/src/SubscriptionsCommand.cpp View 1 2 3 4 3 chunks +58 lines, -25 lines 0 comments Download
A src/FilterEngine.cpp View 1 2 3 4 5 1 chunk +70 lines, -0 lines 0 comments Download
A test/FilterEngineStubs.cpp View 1 2 3 4 5 1 chunk +25 lines, -0 lines 0 comments Download

Messages

Total messages: 5
Felix Dahlke
March 26, 2013, 12:03 p.m. (2013-03-26 12:03:49 UTC) #1
Felix Dahlke
Added some comments. http://codereview.adblockplus.org/9987009/diff/7002/shell/src/Command.h File shell/src/Command.h (right): http://codereview.adblockplus.org/9987009/diff/7002/shell/src/Command.h#newcode1 shell/src/Command.h:1: Gosh, missed that. Removed it :) ...
March 27, 2013, 8:18 a.m. (2013-03-27 08:18:26 UTC) #2
Oleksandr
http://codereview.adblockplus.org/9987009/diff/1/include/AdblockPlus.h File include/AdblockPlus.h (right): http://codereview.adblockplus.org/9987009/diff/1/include/AdblockPlus.h#newcode1 include/AdblockPlus.h:1: #ifndef ADBLOCKPLUS_H Do you think we could rename this ...
March 27, 2013, 8:37 a.m. (2013-03-27 08:37:01 UTC) #3
Felix Dahlke
http://codereview.adblockplus.org/9987009/diff/1/include/AdblockPlus.h File include/AdblockPlus.h (right): http://codereview.adblockplus.org/9987009/diff/1/include/AdblockPlus.h#newcode1 include/AdblockPlus.h:1: #ifndef ADBLOCKPLUS_H On 2013/03/27 08:37:01, Oleksandr wrote: > Do ...
March 27, 2013, 8:59 a.m. (2013-03-27 08:59:17 UTC) #4
Oleksandr
March 27, 2013, 9:04 a.m. (2013-03-27 09:04:38 UTC) #5
ok, well. LGTM. Let's roll!
On 2013/03/27 08:59:17, Felix H. Dahlke wrote:
> http://codereview.adblockplus.org/9987009/diff/1/include/AdblockPlus.h
> File include/AdblockPlus.h (right):
> 
>
http://codereview.adblockplus.org/9987009/diff/1/include/AdblockPlus.h#newcode1
> include/AdblockPlus.h:1: #ifndef ADBLOCKPLUS_H
> On 2013/03/27 08:37:01, Oleksandr wrote:
> > Do you think we could rename this file? To abpv8.h or something like that.
We
> > already have one AdblockPlus.h in IE and I'm sure we have one in each of our
> > other projects..
> 
> That shouldn't cause any trouble if we don't put include/AdblockPlus in the
> include path, but only include. Then we'd have #include
> <AdblockPlus/AdblockPlus.h>. Should actually work regardless with
> <AdblockPlus.h> I think.
> 
> What could cause an issue is the include guard though. I'll prefix them all,
but
> in a separate review.
> 
> http://codereview.adblockplus.org/9987009/diff/3001/src/FilterEngine.cpp
> File src/FilterEngine.cpp (right):
> 
>
http://codereview.adblockplus.org/9987009/diff/3001/src/FilterEngine.cpp#newc...
> src/FilterEngine.cpp:33: {
> On 2013/03/27 08:37:01, Oleksandr wrote:
> > I guess it probably won't be an issue on Linux, but on Windows I always try
to
> > use std:wstring instead. Especially here, where there is almost guaranteed
to
> be
> > special chars. Would you oppose to going wstring everywhere?
> 
> That's tricky actually... std::string works fine for UTF-8 on Linux, but not
on
> Windows. wstring on Linux on the other hand would store 4 bytes per char.
That's
> not acceptable for us, as we're dealing with lots of filters.
> 
> I'll investigate this. We can ignore it for now if we stick to ASCII URLs,
> subscription titles and filters.

Powered by Google App Engine
This is Rietveld