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

Issue 29556737: Issue 5141 - Convert filter match to C++ (Closed)

Created:
Sept. 26, 2017, 9:34 p.m. by hub
Modified:
Oct. 11, 2017, 9:55 a.m.
Base URL:
https://hg.adblockplus.org/adblockpluscore/
Visibility:
Public.

Description

Issue 5141 - Convert filter match to C++

Patch Set 1 #

Total comments: 14

Patch Set 2 : Cleanup. Fixed the bindings to export what we actually need. #

Patch Set 3 : Reworked the code, added test, they fail. #

Patch Set 4 : Some more cleanup #

Total comments: 91

Patch Set 5 : Addressed most of the comment. Fixed some issues. #

Total comments: 3

Patch Set 6 : Fixed many issues. One test left out. #

Total comments: 20
Unified diffs Side-by-side diffs Delta from patch set Stats (+829 lines, -449 lines) Patch
M compiled/String.h View 1 2 3 4 5 3 chunks +22 lines, -0 lines 2 comments Download
M compiled/StringMap.h View 1 2 3 4 5 2 chunks +22 lines, -9 lines 2 comments Download
M compiled/bindings/main.cpp View 1 2 3 4 5 2 chunks +24 lines, -0 lines 7 comments Download
A compiled/filter/Matcher.h View 1 2 3 4 5 1 chunk +153 lines, -0 lines 5 comments Download
A compiled/filter/Matcher.cpp View 1 2 3 4 5 1 chunk +295 lines, -0 lines 4 comments Download
M compiled/filter/RegExpFilter.cpp View 2 chunks +2 lines, -2 lines 0 comments Download
M compiled/library.h View 1 2 3 4 5 2 chunks +4 lines, -1 line 0 comments Download
M compiled/library.js View 1 2 3 4 2 chunks +27 lines, -2 lines 0 comments Download
M lib/matcher.js View 1 2 3 4 5 1 chunk +4 lines, -434 lines 0 comments Download
M lib/notification.js View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
A test/matcher.js View 1 2 3 4 5 1 chunk +275 lines, -0 lines 0 comments Download

Messages

Total messages: 15
hub
Sept. 26, 2017, 9:34 p.m. (2017-09-26 21:34:43 UTC) #1
hub
This is a rough conversion of the JavaScript code. I didn't change the logic including ...
Sept. 26, 2017, 9:49 p.m. (2017-09-26 21:49:00 UTC) #2
hub
Slightly updated the patch. https://codereview.adblockplus.org/29556737/diff/29556738/compiled/filter/Matcher.h File compiled/filter/Matcher.h (right): https://codereview.adblockplus.org/29556737/diff/29556738/compiled/filter/Matcher.h#newcode54 compiled/filter/Matcher.h:54: class Matcher : public MatcherBase ...
Sept. 27, 2017, 3:28 p.m. (2017-09-27 15:28:26 UTC) #3
hub
https://codereview.adblockplus.org/29556737/diff/29559667/compiled/bindings/main.cpp File compiled/bindings/main.cpp (right): https://codereview.adblockplus.org/29556737/diff/29559667/compiled/bindings/main.cpp#newcode145 compiled/bindings/main.cpp:145: .function("findKeyword", &CombinedMatcher::FindKeyword); the function bindings are mostly needed for ...
Sept. 29, 2017, 4:17 p.m. (2017-09-29 16:17:37 UTC) #4
sergei
https://codereview.adblockplus.org/29556737/diff/29556738/compiled/String.h File compiled/String.h (right): https://codereview.adblockplus.org/29556737/diff/29556738/compiled/String.h#newcode419 compiled/String.h:419: class ReMatchResults : public ref_counted On 2017/09/26 21:48:59, hub ...
Oct. 2, 2017, 12:02 p.m. (2017-10-02 12:02:38 UTC) #5
sergei
I have not checked the everything yet, only quickly run through the most essential parts. ...
Oct. 2, 2017, 12:03 p.m. (2017-10-02 12:03:56 UTC) #6
hub
test still don't pass. https://codereview.adblockplus.org/29556737/diff/29559667/compiled/filter/Matcher.cpp File compiled/filter/Matcher.cpp (right): https://codereview.adblockplus.org/29556737/diff/29559667/compiled/filter/Matcher.cpp#newcode24 compiled/filter/Matcher.cpp:24: OwnedString CombinedMatcher::FindKeyword(const FilterPtr& filter) On ...
Oct. 3, 2017, 7:33 p.m. (2017-10-03 19:33:14 UTC) #7
sergei
https://codereview.adblockplus.org/29556737/diff/29559667/compiled/StringMap.h File compiled/StringMap.h (right): https://codereview.adblockplus.org/29556737/diff/29559667/compiled/StringMap.h#newcode243 compiled/StringMap.h:243: resize(0); On 2017/10/02 12:02:33, sergei wrote: > I'm not ...
Oct. 4, 2017, 8:54 a.m. (2017-10-04 08:54:33 UTC) #8
sergei
https://codereview.adblockplus.org/29556737/diff/29559667/compiled/StringMap.h File compiled/StringMap.h (right): https://codereview.adblockplus.org/29556737/diff/29559667/compiled/StringMap.h#newcode243 compiled/StringMap.h:243: resize(0); On 2017/10/04 08:54:31, sergei wrote: > On 2017/10/02 ...
Oct. 6, 2017, 9:33 a.m. (2017-10-06 09:33:57 UTC) #9
hub
I have commented ONE test assert that fails. I need to find why before we ...
Oct. 6, 2017, 1:49 p.m. (2017-10-06 13:49:20 UTC) #10
Wladimir Palant
We are no longer writing JavaScript code, so all the JavaScript-specific hacks of the current ...
Oct. 9, 2017, 8:39 a.m. (2017-10-09 08:39:48 UTC) #11
sergei
https://codereview.adblockplus.org/29556737/diff/29559667/compiled/library.js File compiled/library.js (right): https://codereview.adblockplus.org/29556737/diff/29559667/compiled/library.js#newcode111 compiled/library.js:111: result.push(createString(matches[i])); On 2017/10/06 13:49:17, hub wrote: > On 2017/10/04 ...
Oct. 9, 2017, 3:27 p.m. (2017-10-09 15:27:54 UTC) #12
Wladimir Palant
https://codereview.adblockplus.org/29556737/diff/29567770/compiled/bindings/main.cpp File compiled/bindings/main.cpp (right): https://codereview.adblockplus.org/29556737/diff/29567770/compiled/bindings/main.cpp#newcode146 compiled/bindings/main.cpp:146: .function("findKeyword", &CombinedMatcher::FindKeyword); On 2017/10/09 15:27:52, sergei wrote: > I ...
Oct. 10, 2017, 7:39 a.m. (2017-10-10 07:39:06 UTC) #13
hub
https://codereview.adblockplus.org/29556737/diff/29567770/compiled/bindings/main.cpp File compiled/bindings/main.cpp (right): https://codereview.adblockplus.org/29556737/diff/29567770/compiled/bindings/main.cpp#newcode136 compiled/bindings/main.cpp:136: .function("push", &ReMatchResults::push); On 2017/10/09 08:39:47, Wladimir Palant wrote: > ...
Oct. 10, 2017, 1:46 p.m. (2017-10-10 13:46:16 UTC) #14
sergei
Oct. 11, 2017, 9:55 a.m. (2017-10-11 09:55:17 UTC) #15
Message was sent while issue was closed.
https://codereview.adblockplus.org/29556737/diff/29567770/compiled/filter/Mat...
File compiled/filter/Matcher.cpp (right):

https://codereview.adblockplus.org/29556737/diff/29567770/compiled/filter/Mat...
compiled/filter/Matcher.cpp:49:
mFilterByKeyword[keyword].push_back(FilterPtr(&filter));
Although the review is already closed I think it's important to let everyone
know that here is a bug in this line to avoid it in a future.
The type of key of StringMap is DependentString, the type of keyword is
OwnedString, so after exiting of the scope of this method the stored
DependentString points to a removed string.

Powered by Google App Engine
This is Rietveld