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

Issue 2851493004: base: Make ElapsedTimer movable (Closed)

Created:
3 years, 7 months ago by watk
Modified:
3 years, 7 months ago
Reviewers:
danakj
CC:
chromium-reviews, danakj+watch_chromium.org, chirantan+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

base: Make ElapsedTimer movable Previously if you wanted to reset the starting point of the interval (for measuring an idle timeout, for example) you had to construct a new instance on the heap. Now it's possible to keep a stack/member variable (potentially base::Optional) and assign fresh values to it to reset it. Review-Url: https://codereview.chromium.org/2851493004 Cr-Commit-Position: refs/heads/master@{#468193} Committed: https://chromium.googlesource.com/chromium/src/+/badc743a3b4f1a1405cb8d9069d7353c333f3701

Patch Set 1 #

Patch Set 2 : fix ordering in files #

Patch Set 3 : Use move constructor/operator= instead #

Unified diffs Side-by-side diffs Delta from patch set Stats (+11 lines, -0 lines) Patch
M base/timer/elapsed_timer.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M base/timer/elapsed_timer.cc View 1 2 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 22 (10 generated)
watk
Hi danakj, PTAL. I'm writing something where I wish I had this API.
3 years, 7 months ago (2017-04-27 21:37:34 UTC) #2
watk
Dang, just realized this isn't quite what I want anyway. Closing.
3 years, 7 months ago (2017-04-27 21:45:08 UTC) #4
danakj
You could use an Optional<ElapsedTimer> but then you'd have to add a move constructor/assignment instead.. ...
3 years, 7 months ago (2017-04-27 21:46:57 UTC) #5
danakj
On 2017/04/27 21:45:08, watk wrote: > Dang, just realized this isn't quite what I want ...
3 years, 7 months ago (2017-04-27 21:47:07 UTC) #6
watk
Ooh, Optional + movable would be nice so I don't have to feel weird about ...
3 years, 7 months ago (2017-04-27 22:16:42 UTC) #8
danakj
LGTM
3 years, 7 months ago (2017-04-27 22:20:13 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2851493004/40001
3 years, 7 months ago (2017-04-27 22:35:58 UTC) #11
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/281722) linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, ...
3 years, 7 months ago (2017-04-28 01:36:31 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2851493004/40001
3 years, 7 months ago (2017-04-28 18:56:39 UTC) #15
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/282447)
3 years, 7 months ago (2017-04-28 23:21:06 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2851493004/40001
3 years, 7 months ago (2017-04-28 23:25:45 UTC) #19
commit-bot: I haz the power
3 years, 7 months ago (2017-04-29 00:37:23 UTC) #22
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/badc743a3b4f1a1405cb8d9069d7...

Powered by Google App Engine
This is Rietveld 408576698