Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Issue 1507893005: Remove const qualifier from function return type (Closed)

Created:
5 years ago by tanay.c
Modified:
5 years ago
Reviewers:
rkc, Charlie
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove const qualifier from function return type BUG=393155 Committed: https://crrev.com/815e62e824debc9193ef7a96fdc8803b2224ff99 Cr-Commit-Position: refs/heads/master@{#364629}

Patch Set 1 #

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+14 lines, -14 lines) Patch
M chrome/browser/extensions/api/copresence/copresence_api.h View 2 chunks +4 lines, -4 lines 0 comments Download
M chrome/browser/extensions/api/copresence/copresence_api.cc View 3 chunks +4 lines, -4 lines 0 comments Download
M components/copresence/public/copresence_delegate.h View 2 chunks +3 lines, -3 lines 0 comments Download
M components/copresence/rpc/rpc_handler_unittest.cc View 1 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 14 (4 generated)
tanay.c
PTAL.
5 years ago (2015-12-08 11:35:42 UTC) #2
tanay.c
PTAL
5 years ago (2015-12-10 05:25:20 UTC) #3
rkc
Charlie is a more appropriate review for these. Though my opinion is that we shouldn't ...
5 years ago (2015-12-10 21:44:49 UTC) #5
Charlie
On 2015/12/10 21:44:49, Rahul Chaturvedi wrote: > Charlie is a more appropriate review for these. ...
5 years ago (2015-12-11 00:48:47 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1507893005/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1507893005/20001
5 years ago (2015-12-11 05:28:47 UTC) #8
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years ago (2015-12-11 06:15:46 UTC) #9
commit-bot: I haz the power
Patchset 2 (id:??) landed as https://crrev.com/815e62e824debc9193ef7a96fdc8803b2224ff99 Cr-Commit-Position: refs/heads/master@{#364629}
5 years ago (2015-12-11 06:16:58 UTC) #11
vabr (Chromium)
On 2015/12/11 06:16:58, commit-bot: I haz the power wrote: > Patchset 2 (id:??) landed as ...
5 years ago (2015-12-11 09:28:22 UTC) #12
tanay.c
On 2015/12/11 09:28:22, vabr (Chromium) wrote: > On 2015/12/11 06:16:58, commit-bot: I haz the power ...
5 years ago (2015-12-11 09:33:20 UTC) #13
vabr (Chromium)
5 years ago (2015-12-11 10:58:03 UTC) #14
Message was sent while issue was closed.
On 2015/12/11 09:33:20, tanay.c wrote:
> On 2015/12/11 09:28:22, vabr (Chromium) wrote:
> > On 2015/12/11 06:16:58, commit-bot: I haz the power wrote:
> > > Patchset 2 (id:??) landed as
> > > https://crrev.com/815e62e824debc9193ef7a96fdc8803b2224ff99
> > > Cr-Commit-Position: refs/heads/master@{#364629}
> > 
> > Note that this change is not beneficial: http://crbug.com/393155#c4. :(
> 
> Just had a look at the previous comments regarding particular conversions of
> |const std::string| to |std::string|. I agree with comment #4 , it might be
more
> appropriate to maintain the |const| to enable the compiler to throw error even
> for non user defined return types.  However, AFAIK the removal of const does
not
> add any risk since the values are being copied and there are no references
> involved and can be removed for a cleaner code. That being said, I will keep
> this in mind for any further conversions of this type.

Thank you.

Indeed, your change does not create a bad code by itself. But it makes it easier
for other people to introduce errors:
foo->StringValue() = "asdf";  // While not corrupting memory, this code does not
do what it looks like doing (altering the "string value" of foo).

Powered by Google App Engine
This is Rietveld 408576698