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

Issue 29393589: Issue 5013 - Make more methods const.- introduced JsConstValuePtr and JsConstValueList- JsValue:… (Closed)

Created:
March 23, 2017, 6:12 p.m. by hub
Modified:
March 24, 2017, 5:07 p.m.
Reviewers:
sergei
Base URL:
https://hg.adblockplus.org/libadblockplus/
Visibility:
Public.

Description

Issue 5013 - Make more methods const. - introduced JsConstValuePtr and JsConstValueList - JsValue::Call() now take a JsConstValueList or JsConstValuePtr - Use the single JsConstValuePtr overload of Call() when appropriate.

Patch Set 1 #

Total comments: 14

Patch Set 2 : Now mostly use the single param Call() overload #

Patch Set 3 : Rebased on master #

Unified diffs Side-by-side diffs Delta from patch set Stats (+54 lines, -79 lines) Patch
M include/AdblockPlus/FilterEngine.h View 6 chunks +9 lines, -9 lines 0 comments Download
M include/AdblockPlus/JsValue.h View 1 2 chunks +4 lines, -2 lines 0 comments Download
M src/FileSystemJsObject.cpp View 5 chunks +5 lines, -5 lines 0 comments Download
M src/FilterEngine.cpp View 1 2 7 chunks +27 lines, -53 lines 0 comments Download
M src/JsValue.cpp View 1 2 2 chunks +4 lines, -5 lines 0 comments Download
M src/Notification.cpp View 1 2 2 chunks +2 lines, -2 lines 0 comments Download
M src/WebRequestJsObject.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M test/JsValue.cpp View 1 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 8
hub
March 23, 2017, 6:12 p.m. (2017-03-23 18:12:28 UTC) #1
sergei
https://codereview.adblockplus.org/29393589/diff/29393590/include/AdblockPlus/JsValue.h File include/AdblockPlus/JsValue.h (right): https://codereview.adblockplus.org/29393589/diff/29393590/include/AdblockPlus/JsValue.h#newcode45 include/AdblockPlus/JsValue.h:45: typedef std::shared_ptr<const JsValue> JsConstValuePtr; What about ConstJsValuePtr? https://codereview.adblockplus.org/29393589/diff/29393590/include/AdblockPlus/JsValue.h#newcode51 include/AdblockPlus/JsValue.h:51: ...
March 23, 2017, 7:46 p.m. (2017-03-23 19:46:07 UTC) #2
hub
https://codereview.adblockplus.org/29393589/diff/29393590/include/AdblockPlus/JsValue.h File include/AdblockPlus/JsValue.h (right): https://codereview.adblockplus.org/29393589/diff/29393590/include/AdblockPlus/JsValue.h#newcode51 include/AdblockPlus/JsValue.h:51: typedef std::vector<AdblockPlus::JsConstValuePtr> JsConstValueList; On 2017/03/23 19:46:06, sergei wrote: > ...
March 24, 2017, 1:45 p.m. (2017-03-24 13:45:15 UTC) #3
sergei
https://codereview.adblockplus.org/29393589/diff/29393590/include/AdblockPlus/JsValue.h File include/AdblockPlus/JsValue.h (right): https://codereview.adblockplus.org/29393589/diff/29393590/include/AdblockPlus/JsValue.h#newcode51 include/AdblockPlus/JsValue.h:51: typedef std::vector<AdblockPlus::JsConstValuePtr> JsConstValueList; On 2017/03/24 13:45:15, hub wrote: > ...
March 24, 2017, 1:56 p.m. (2017-03-24 13:56:47 UTC) #4
hub
https://codereview.adblockplus.org/29393589/diff/29393590/src/FilterEngine.cpp File src/FilterEngine.cpp (right): https://codereview.adblockplus.org/29393589/diff/29393590/src/FilterEngine.cpp#newcode62 src/FilterEngine.cpp:62: return func->Call(params)->AsBool(); On 2017/03/24 13:56:47, sergei wrote: > On ...
March 24, 2017, 2:08 p.m. (2017-03-24 14:08:03 UTC) #5
sergei
https://codereview.adblockplus.org/29393589/diff/29393590/src/FilterEngine.cpp File src/FilterEngine.cpp (right): https://codereview.adblockplus.org/29393589/diff/29393590/src/FilterEngine.cpp#newcode62 src/FilterEngine.cpp:62: return func->Call(params)->AsBool(); On 2017/03/24 14:08:03, hub wrote: > On ...
March 24, 2017, 2:24 p.m. (2017-03-24 14:24:55 UTC) #6
hub
https://codereview.adblockplus.org/29393589/diff/29393590/src/FilterEngine.cpp File src/FilterEngine.cpp (right): https://codereview.adblockplus.org/29393589/diff/29393590/src/FilterEngine.cpp#newcode62 src/FilterEngine.cpp:62: return func->Call(params)->AsBool(); On 2017/03/24 14:24:55, sergei wrote: > I ...
March 24, 2017, 4:05 p.m. (2017-03-24 16:05:06 UTC) #7
sergei
March 24, 2017, 4:27 p.m. (2017-03-24 16:27:52 UTC) #8
LGTM

https://codereview.adblockplus.org/29393589/diff/29393590/src/FilterEngine.cpp
File src/FilterEngine.cpp (right):

https://codereview.adblockplus.org/29393589/diff/29393590/src/FilterEngine.cp...
src/FilterEngine.cpp:62: return func->Call(params)->AsBool();
On 2017/03/24 16:05:06, hub wrote:
> On 2017/03/24 14:24:55, sergei wrote:
> 
> > I think that we should simply change the implementation of
JsValue::Call(const
> > JsValue&) to don't create new JsValue and JsValuePtr. Finally I would like
to
> > get rid of JsValuePtr because on practice there is no need for it.
> 
> Agreed. Issue 3589?

I think it should be another issue (https://issues.adblockplus.org/ticket/5034)
and #3589 should be a part of it. So basically changing to `func->Call(*this)`
should be done as #5034.

Powered by Google App Engine
This is Rietveld