|
|
Chromium Code Reviews|
Created:
4 years ago by Łukasz Anforowicz Modified:
4 years ago CC:
darktears, blink-reviews, blink-reviews-animation_chromium.org, chromium-reviews, Eric Willigers, rjwright, shans Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionRename m_currentTask and s_currentTask/ to help rewrite_to_chrome_style tool.
This CL helps rewrite_to_chrome_style tool, by preventing the tool from
suggesting the following conflicting renames:
- |s_field| -> |field_|
- |m_field| -> |field_|
BUG=641004
Committed: https://crrev.com/1f0dfac7f60c84a476ce546a5ecc1687d4e7b658
Cr-Commit-Position: refs/heads/master@{#438058}
Patch Set 1 #Patch Set 2 : Better names + comments + DCHECKs. #
Total comments: 5
Patch Set 3 : Restrict the changes to 1) renaming of variables 2) extra header comments. #
Total comments: 2
Patch Set 4 : Tweaked the comments based on CR feedback from alancutter@. #
Total comments: 2
Patch Set 5 : Got rid of one more comment. #
Total comments: 2
Messages
Total messages: 36 (18 generated)
lukasza@chromium.org changed reviewers: + dcheng@chromium.org
Daniel, can you take a look please?
The CQ bit was checked by lukasza@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
What is the difference between m_currentTask and s_currentTask? Maybe we can pick more meaningful names?
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by lukasza@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
On 2016/12/09 18:21:20, dcheng wrote: > What is the difference between m_currentTask and s_currentTask? Maybe we can > pick more meaningful names? Thanks for the feedback - I appreciate it. You're right - we should have better names here. I tried to tweak the names in patchset #2. I am not sure if I fully understand the changed class, so let me also ask one of core/animation/OWNERS for feedback. https://codereview.chromium.org/2569433002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/animation/AnimationClock.h (left): https://codereview.chromium.org/2569433002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/animation/AnimationClock.h:53: void updateTime(double time); It might also make sense to: - s/updateTime/updateTargetTime/ - s/time/targetTime/ I didn't do this yet, because: - this would require touching extra 7 files - I am not sure I understand this class and how it is used (and therefore I am not sure if the new name is really better). Similarily, we can do: - s/m_time/m_targetTime/ - s/currentTime/targetTime/g - s/resetTimeForTesting/resetTargetTimeForTesting/
lukasza@chromium.org changed reviewers: + suzyh@chromium.org
suzyh@, could you also take a look please? Daniel is right that I shouldn't just rename s_currentTime to s_staticCurrentTime (although it does avoid a conflict after the big rename), but that I should come up with better names here. OTOH, I am not that familiar with AnimationClock class - could you please double-check that the changes I proposed make sense?
Description was changed from ========== s/s_currentTask/s_staticCurrentTask/ to help rewrite_to_chrome_style tool. This CL helps rewrite_to_chrome_style tool, by preventing the tool from suggesting the following conflicting renames: - |s_field| -> |field_| - |m_field| -> |field_| BUG=641004 ========== to ========== Rename m_currentTask and s_currentTask/ to help rewrite_to_chrome_style tool. This CL helps rewrite_to_chrome_style tool, by preventing the tool from suggesting the following conflicting renames: - |s_field| -> |field_| - |m_field| -> |field_| BUG=641004 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
suzyh@chromium.org changed reviewers: + dstockwell@chromium.org
+dstockwell as the original author of this class. Doug, do you have any recommendations for this patch? I'm more or less happy with the patch, aside from the comment about making it a no-op. https://codereview.chromium.org/2569433002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/animation/AnimationClock.cpp (right): https://codereview.chromium.org/2569433002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/animation/AnimationClock.cpp:78: m_taskForWhichTimeWasCalculated = s_currentlyRunningTask; I'd prefer that this patch was only a rename, without the control flow change (moving this line out of the "else" clause) or the DCHECK changes. While I'm happy for those changes to also occur, I'd like to have the variable name changes in a no-op patch. https://codereview.chromium.org/2569433002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/animation/AnimationClock.h (left): https://codereview.chromium.org/2569433002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/animation/AnimationClock.h:53: void updateTime(double time); On 2016/12/10 at 01:01:41, Łukasz Anforowicz wrote: > It might also make sense to: > - s/updateTime/updateTargetTime/ > - s/time/targetTime/ > > I didn't do this yet, because: > - this would require touching extra 7 files > - I am not sure I understand this class and how it is used (and therefore I am not sure if the new name is really better). > > Similarily, we can do: > - s/m_time/m_targetTime/ > - s/currentTime/targetTime/g > - s/resetTimeForTesting/resetTargetTimeForTesting/ Likewise deferring to dstockwell for suggestions here. https://codereview.chromium.org/2569433002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/animation/AnimationClock.h (right): https://codereview.chromium.org/2569433002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/animation/AnimationClock.h:43: // Tracks the time at which the currently running task should finish, I'm not entirely sure if this is the best way to describe the function of this class. Deferring to dstockwell for suggestions.
dstockwell@, can you PTAL? There are two things that need your attention: 1. Please review the latest patchset (i.e. review the accuracy of the new variable names and comments). This is higher priority - landing a CL that renames the variables is needed to help with the "big rename" in Blink. 2. Please provide feedback on whether further renames and refactorings are desirable / worth it (see previous CR comments). This might be lower priority (this doesn't impact the "big rename"). https://codereview.chromium.org/2569433002/diff/20001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/animation/AnimationClock.cpp (right): https://codereview.chromium.org/2569433002/diff/20001/third_party/WebKit/Sour... third_party/WebKit/Source/core/animation/AnimationClock.cpp:78: m_taskForWhichTimeWasCalculated = s_currentlyRunningTask; On 2016/12/12 03:54:01, suzyh wrote: > I'd prefer that this patch was only a rename, without the control flow change > (moving this line out of the "else" clause) or the DCHECK changes. While I'm > happy for those changes to also occur, I'd like to have the variable name > changes in a no-op patch. Done.
alancutter@chromium.org changed reviewers: + alancutter@chromium.org
https://codereview.chromium.org/2569433002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/animation/AnimationClock.h (right): https://codereview.chromium.org/2569433002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/animation/AnimationClock.h:44: // if finishing before the next animation frame is desired. // Maintains a stationary clock time during script execution. // Ideally tracks the glass time (the moment photons leave the screen) of the current frame.
https://codereview.chromium.org/2569433002/diff/40001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/animation/AnimationClock.h (right): https://codereview.chromium.org/2569433002/diff/40001/third_party/WebKit/Sour... third_party/WebKit/Source/core/animation/AnimationClock.h:44: // if finishing before the next animation frame is desired. On 2016/12/12 23:19:23, alancutter wrote: > // Maintains a stationary clock time during script execution. > // Ideally tracks the glass time (the moment photons leave the screen) of the > current frame. Done, except that: - I used "tries to track" instead of "ideally tracks", because the latter is slightly abiguous ("tries to track" VS "perfectly tracks") - I used "animation frame" instead of "frame" (to avoid ambiguity with blink::Frame). Also - given your feedback I doubt more and more my understanding of what this class does, so I also got rid of the comments I tried to helpfully add to updateTime and currentTime methods. I think that I do understand what s_currentlyRunningTask and m_taskForWhichTimeWasCalculated are doing, so I am still adding the 2 comments related to these fields.
On 2016/12/12 at 23:40:33, lukasza wrote: > https://codereview.chromium.org/2569433002/diff/40001/third_party/WebKit/Sour... > File third_party/WebKit/Source/core/animation/AnimationClock.h (right): > > https://codereview.chromium.org/2569433002/diff/40001/third_party/WebKit/Sour... > third_party/WebKit/Source/core/animation/AnimationClock.h:44: // if finishing before the next animation frame is desired. > On 2016/12/12 23:19:23, alancutter wrote: > > // Maintains a stationary clock time during script execution. > > // Ideally tracks the glass time (the moment photons leave the screen) of the > > current frame. > > Done, except that: > > - I used "tries to track" instead of "ideally tracks", because the latter is slightly abiguous ("tries to track" VS "perfectly tracks") > > - I used "animation frame" instead of "frame" (to avoid ambiguity with blink::Frame). > > > Also - given your feedback I doubt more and more my understanding of what this class does, so I also got rid of the comments I tried to helpfully add to updateTime and currentTime methods. I think that I do understand what s_currentlyRunningTask and m_taskForWhichTimeWasCalculated are doing, so I am still adding the 2 comments related to these fields. lgtm
https://codereview.chromium.org/2569433002/diff/60001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/animation/AnimationClock.h (right): https://codereview.chromium.org/2569433002/diff/60001/third_party/WebKit/Sour... third_party/WebKit/Source/core/animation/AnimationClock.h:72: // this case it recalculates |m_time|. Reading this one again it's a bit too much like a prose version of the code in the CPP file IMO. The purpose of these is already captured by "Maintains a stationary clock time during script execution", I don't think it's necessary to document how they get used internally.
https://codereview.chromium.org/2569433002/diff/60001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/animation/AnimationClock.h (right): https://codereview.chromium.org/2569433002/diff/60001/third_party/WebKit/Sour... third_party/WebKit/Source/core/animation/AnimationClock.h:72: // this case it recalculates |m_time|. On 2016/12/12 23:52:18, alancutter wrote: > Reading this one again it's a bit too much like a prose version of the code in > the CPP file IMO. The purpose of these is already captured by "Maintains a > stationary clock time during script execution", I don't think it's necessary to > document how they get used internally. Hmmm... okay. It is not immediately obvious to me that "stationary clock" = "clock that is incremented/recalculated once per task" (and the latter is probably be entirely accurate because of updateTime). OTOH, maybe the new field names are sufficiently self-explanatory and the comment is indeed duplicating some of what can be found in the code. Done.
https://codereview.chromium.org/2569433002/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/animation/AnimationClock.h (right): https://codereview.chromium.org/2569433002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/animation/AnimationClock.h:45: // frame. Optional: The "Maintains a stationary clock time during script execution" probably deserves a why. Here's the spec text that supports this behaviour, might be worth linking to: http://w3c.github.io/web-animations/#timing-model-concepts
https://codereview.chromium.org/2569433002/diff/80001/third_party/WebKit/Sour... File third_party/WebKit/Source/core/animation/AnimationClock.h (right): https://codereview.chromium.org/2569433002/diff/80001/third_party/WebKit/Sour... third_party/WebKit/Source/core/animation/AnimationClock.h:45: // frame. On 2016/12/13 00:19:01, alancutter wrote: > Optional: > The "Maintains a stationary clock time during script execution" probably > deserves a why. Here's the spec text that supports this behaviour, might be > worth linking to: http://w3c.github.io/web-animations/#timing-model-concepts Thanks for the link. I think I'll leave the comment as-is - mostly because the link didn't help me with understanding the class or the comment (OTOH, I work on parts of Chromium and Blink not related to animations, so this might be my fault; at any rate - I didn't find definition of "stationary" or an equivalent of AnimationClock in the linked spec).
lgtm
Thanks for the reviews everyone.
The CQ bit was checked by lukasza@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from alancutter@chromium.org Link to the patchset: https://codereview.chromium.org/2569433002/#ps80001 (title: "Got rid of one more comment.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 80001, "attempt_start_ts": 1481597192973700,
"parent_rev": "5f86e313436ed20d90fd273fc387a66e37dd5509", "commit_rev":
"3057be3da22b3ff7f70f1437bf47cd770db13abb"}
Message was sent while issue was closed.
Description was changed from ========== Rename m_currentTask and s_currentTask/ to help rewrite_to_chrome_style tool. This CL helps rewrite_to_chrome_style tool, by preventing the tool from suggesting the following conflicting renames: - |s_field| -> |field_| - |m_field| -> |field_| BUG=641004 ========== to ========== Rename m_currentTask and s_currentTask/ to help rewrite_to_chrome_style tool. This CL helps rewrite_to_chrome_style tool, by preventing the tool from suggesting the following conflicting renames: - |s_field| -> |field_| - |m_field| -> |field_| BUG=641004 Review-Url: https://codereview.chromium.org/2569433002 ==========
Message was sent while issue was closed.
Committed patchset #5 (id:80001)
Message was sent while issue was closed.
Description was changed from ========== Rename m_currentTask and s_currentTask/ to help rewrite_to_chrome_style tool. This CL helps rewrite_to_chrome_style tool, by preventing the tool from suggesting the following conflicting renames: - |s_field| -> |field_| - |m_field| -> |field_| BUG=641004 Review-Url: https://codereview.chromium.org/2569433002 ========== to ========== Rename m_currentTask and s_currentTask/ to help rewrite_to_chrome_style tool. This CL helps rewrite_to_chrome_style tool, by preventing the tool from suggesting the following conflicting renames: - |s_field| -> |field_| - |m_field| -> |field_| BUG=641004 Committed: https://crrev.com/1f0dfac7f60c84a476ce546a5ecc1687d4e7b658 Cr-Commit-Position: refs/heads/master@{#438058} ==========
Message was sent while issue was closed.
Patchset 5 (id:??) landed as https://crrev.com/1f0dfac7f60c84a476ce546a5ecc1687d4e7b658 Cr-Commit-Position: refs/heads/master@{#438058} |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
