|
|
Created:
5 years ago by JakeYoon Modified:
4 years, 11 months ago CC:
blink-reviews, blink-reviews-dom_chromium.org, chromium-reviews, dglazkov+blink, eae+blinkwatch, rwlbuis, sof Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionCleanup return values in DOM Range.
This CL turns const by value return values into
const by ref.
Replacing const value by a const ref when a member
variable is safe, because the member variable will
live at least as long as the temporary object
returned now.
It can also be more efficient, because returning
a ref can spare copying.
BUG=568959
Patch Set 1 #
Total comments: 1
Patch Set 2 : Separate AUTHORS modify #
Total comments: 3
Messages
Total messages: 20 (3 generated)
Description was changed from ========== Cleanup return values in DOM Range. This CL turns const by value return values into const by ref. Replacing const value by a const ref when a member variable is safe, because the member variable will live at least as long as the temporary object returned now. It can also be more efficient, because returning a ref can spare copying. BUG=568959 ========== to ========== Cleanup return values in DOM Range. This CL turns const by value return values into const by ref. Replacing const value by a const ref when a member variable is safe, because the member variable will live at least as long as the temporary object returned now. It can also be more efficient, because returning a ref can spare copying. BUG=568959 ==========
yjaeseok@gmail.com changed reviewers: + haraken@chromium.org
Hello Haraken, Can you please take a look at this small cleanup? Cheers, Jaeseok Yoon.
https://codereview.chromium.org/1535403002/diff/1/AUTHORS File AUTHORS (right): https://codereview.chromium.org/1535403002/diff/1/AUTHORS#newcode247 AUTHORS:247: Jaeseok Yoon <yjaeseok@gmail.com> Please make this change separately before landing this CL. Also have you signed up a CLA?
Hello, Separate AUTHORS! And I already have signed up a CLA. Thanks Haraken. :)
On 2015/12/20 21:02:57, JakeYoon wrote: > Hello, > > Separate AUTHORS! > And I already have signed up a CLA. > Thanks Haraken. :) Where is the AUTHORS CL? You need to land it first.
On 2015/12/21 01:03:27, haraken wrote: > On 2015/12/20 21:02:57, JakeYoon wrote: > > Hello, > > > > Separate AUTHORS! > > And I already have signed up a CLA. > > Thanks Haraken. :) > > Where is the AUTHORS CL? You need to land it first. AUTHORS CL is https://codereview.chromium.org/1544533002 Thanks Haraken :)
On 2015/12/21 14:44:55, JakeYoon wrote: > On 2015/12/21 01:03:27, haraken wrote: > > On 2015/12/20 21:02:57, JakeYoon wrote: > > > Hello, > > > > > > Separate AUTHORS! > > > And I already have signed up a CLA. > > > Thanks Haraken. :) > > > > Where is the AUTHORS CL? You need to land it first. > > AUTHORS CL is https://codereview.chromium.org/1544533002 > Thanks Haraken :) haraken@ Please review this issue. And could you review https://codereview.chromium.org/1444173002 also? Thanks :)
haraken@chromium.org changed reviewers: + yoichio@chromium.org, yosin@chromium.org
This change needs to be reviewed by yosin@ or yoichio@. https://codereview.chromium.org/1535403002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Range.h (right): https://codereview.chromium.org/1535403002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Range.h:117: const Position& endPosition() const { return m_end.toPosition(); } Why doesn't toPosition return const Position&?
Hi yosin and yoichio!! Why don't you review my first commit?! Maybe it is your good opportunity.!! On Dec 22, 2015 3:45 PM, <haraken@chromium.org> wrote: > This change needs to be reviewed by yosin@ or yoichio@. > > > > > https://codereview.chromium.org/1535403002/diff/20001/third_party/WebKit/Sour... > File third_party/WebKit/Source/core/dom/Range.h (right): > > > https://codereview.chromium.org/1535403002/diff/20001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/dom/Range.h:117: const Position& > endPosition() const { return m_end.toPosition(); } > > Why doesn't toPosition return const Position&? > > https://codereview.chromium.org/1535403002/ > -- You received this message because you are subscribed to the Google Groups "Blink Reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to blink-reviews+unsubscribe@chromium.org.
Hi yosin and yoichio!! Why don't you review my first commit?! Maybe it is your good opportunity.!! On Dec 22, 2015 3:45 PM, <haraken@chromium.org> wrote: > This change needs to be reviewed by yosin@ or yoichio@. > > > > > https://codereview.chromium.org/1535403002/diff/20001/third_party/WebKit/Sour... > File third_party/WebKit/Source/core/dom/Range.h (right): > > > https://codereview.chromium.org/1535403002/diff/20001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/dom/Range.h:117: const Position& > endPosition() const { return m_end.toPosition(); } > > Why doesn't toPosition return const Position&? > > https://codereview.chromium.org/1535403002/ > -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
On Sun, Dec 20, 2015 at 11:03 PM, <haraken@chromium.org> wrote: > On 2015/12/20 21:02:57, JakeYoon wrote: > >> Hello, >> > > Separate AUTHORS! >> And I already have signed up a CLA. >> Thanks Haraken. :) >> > > Where is the AUTHORS CL? You need to land it first. > > Why? I think this is rather very confusing. Why land a separate CL adding his name to AUTHORS file before even getting the "real" CL in? This does not make any sense. -- Thiago Farina -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
On Sun, Dec 20, 2015 at 11:03 PM, <haraken@chromium.org> wrote: > On 2015/12/20 21:02:57, JakeYoon wrote: > >> Hello, >> > > Separate AUTHORS! >> And I already have signed up a CLA. >> Thanks Haraken. :) >> > > Where is the AUTHORS CL? You need to land it first. > > Why? I think this is rather very confusing. Why land a separate CL adding his name to AUTHORS file before even getting the "real" CL in? This does not make any sense. -- Thiago Farina -- You received this message because you are subscribed to the Google Groups "Blink Reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to blink-reviews+unsubscribe@chromium.org.
On 2015/12/30 14:39:38, tfarina wrote: > On Sun, Dec 20, 2015 at 11:03 PM, <mailto:haraken@chromium.org> wrote: > > > On 2015/12/20 21:02:57, JakeYoon wrote: > > > >> Hello, > >> > > > > Separate AUTHORS! > >> And I already have signed up a CLA. > >> Thanks Haraken. :) > >> > > > > Where is the AUTHORS CL? You need to land it first. > > > > Why? I think this is rather very confusing. Why land a separate CL adding > his name to AUTHORS file before even getting the "real" CL in? This does > not make any sense. I was thinking that we need to confirm the CLA and land the AUTHORS change before landing any actual CL. Is our convention to land the AUTHORS change in the first CL?
On Wednesday, December 30, 2015, <haraken@chromium.org> wrote: > On 2015/12/30 14:39:38, tfarina wrote: > >> On Sun, Dec 20, 2015 at 11:03 PM, <mailto:haraken@chromium.org> wrote: >> > > > On 2015/12/20 21:02:57, JakeYoon wrote: >> > >> >> Hello, >> >> >> > >> > Separate AUTHORS! >> >> And I already have signed up a CLA. >> >> Thanks Haraken. :) >> >> >> > >> > Where is the AUTHORS CL? You need to land it first. >> > >> > Why? I think this is rather very confusing. Why land a separate CL >> adding >> his name to AUTHORS file before even getting the "real" CL in? This does >> not make any sense. >> > > I was thinking that we need to confirm the CLA and land the AUTHORS change > before landing any actual CL. How come this could be any good? Suppose his real patch does not get approved by any means, then he (by him I just mean anyone contributing) will be listed as one of the authors of the chromium project without having any change checked in the source tree.. To me any change to the AUTHORS file should be done *after* real work has been committed to the project, not before. > Is our convention to land the AUTHORS change in the first CL? > > I don't see why not, that or after. I think the signing of CLA is a separate process. > > https://codereview.chromium.org/1535403002/ > -- Thiago Farina -- You received this message because you are subscribed to the Google Groups "Blink Reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to blink-reviews+unsubscribe@chromium.org.
On Wednesday, December 30, 2015, <haraken@chromium.org> wrote: > On 2015/12/30 14:39:38, tfarina wrote: > >> On Sun, Dec 20, 2015 at 11:03 PM, <mailto:haraken@chromium.org> wrote: >> > > > On 2015/12/20 21:02:57, JakeYoon wrote: >> > >> >> Hello, >> >> >> > >> > Separate AUTHORS! >> >> And I already have signed up a CLA. >> >> Thanks Haraken. :) >> >> >> > >> > Where is the AUTHORS CL? You need to land it first. >> > >> > Why? I think this is rather very confusing. Why land a separate CL >> adding >> his name to AUTHORS file before even getting the "real" CL in? This does >> not make any sense. >> > > I was thinking that we need to confirm the CLA and land the AUTHORS change > before landing any actual CL. How come this could be any good? Suppose his real patch does not get approved by any means, then he (by him I just mean anyone contributing) will be listed as one of the authors of the chromium project without having any change checked in the source tree.. To me any change to the AUTHORS file should be done *after* real work has been committed to the project, not before. > Is our convention to land the AUTHORS change in the first CL? > > I don't see why not, that or after. I think the signing of CLA is a separate process. > > https://codereview.chromium.org/1535403002/ > -- Thiago Farina -- You received this message because you are subscribed to the Google Groups "Chromium-reviews" group. To unsubscribe from this group and stop receiving emails from it, send an email to chromium-reviews+unsubscribe@chromium.org.
Sorry for late response. I was on vacation during last December. https://codereview.chromium.org/1535403002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Range.h (right): https://codereview.chromium.org/1535403002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Range.h:116: const Position& startPosition() const { return m_start.toPosition(); } We can't return const ref here at least VS2013 and VS2015. I got following error message: d:\src\w\cr\src\third_party\webkit\source\core\dom\range.h(116) : warning C4172: returning address of local variable or temporary d:\src\w\cr\src\third_party\webkit\source\core\dom\range.h(117) : warning C4172: returning address of local variable or temporary Can clang/gcc compile this change w/o warnings/errors?
https://codereview.chromium.org/1535403002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/dom/Range.h (right): https://codereview.chromium.org/1535403002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/dom/Range.h:116: const Position& startPosition() const { return m_start.toPosition(); } On 2016/01/05 04:32:31, Yosi_UTC9 wrote: > We can't return const ref here at least VS2013 and VS2015. I got following error > message: > > d:\src\w\cr\src\third_party\webkit\source\core\dom\range.h(116) : warning C4172: > returning address of local variable or temporary > d:\src\w\cr\src\third_party\webkit\source\core\dom\range.h(117) : warning C4172: > returning address of local variable or temporary > > Can clang/gcc compile this change w/o warnings/errors? > In fact, This patch is for replacing const value by a const ref when a member. But startPosition function doesn't return a member variable, So it looks like incorrect. How do you think Yoshi@ ??
On 2016/01/05 at 13:12:46, yjaeseok wrote: > https://codereview.chromium.org/1535403002/diff/20001/third_party/WebKit/Sour... > File third_party/WebKit/Source/core/dom/Range.h (right): > > https://codereview.chromium.org/1535403002/diff/20001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/dom/Range.h:116: const Position& startPosition() const { return m_start.toPosition(); } > On 2016/01/05 04:32:31, Yosi_UTC9 wrote: > > We can't return const ref here at least VS2013 and VS2015. I got following error > > message: > > > > d:\src\w\cr\src\third_party\webkit\source\core\dom\range.h(116) : warning C4172: > > returning address of local variable or temporary > > d:\src\w\cr\src\third_party\webkit\source\core\dom\range.h(117) : warning C4172: > > returning address of local variable or temporary > > > > Can clang/gcc compile this change w/o warnings/errors? > > > > In fact, This patch is for replacing const value > by a const ref when a member. > > But startPosition function doesn't return > a member variable, So it looks like incorrect. > How do you think Yoshi@ ?? start and end positions are calculated from RangeBoundaryPoint which holds before node, container node and "cached" offset for ease of relocation and avoiding offset computation. We don't want to change it to Position object. Returning |const Position| is for note that Position object immutable. There are no member functions for mutating member variables in Position. |