Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(2)

Issue 2851493004: base: Make ElapsedTimer movable (Closed)

Created:
6 months, 3 weeks ago by watk
Modified:
6 months, 3 weeks 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
Trybot results:  linux_android_rel_ng   chromium_presubmit   ios-simulator-xcode-clang   win_chromium_x64_rel_ng   win_clang   mac_chromium_rel_ng   mac_chromium_compile_dbg_ng   win_chromium_rel_ng   win_chromium_compile_dbg_ng   ios-simulator   linux_chromium_chromeos_rel_ng   chromeos_daisy_chromium_compile_only_ng   ios-device   ios-device-xcode-clang   cast_shell_linux   android_n5x_swarming_rel   chromeos_amd64-generic_chromium_compile_only_ng   cast_shell_android   android_clang_dbg_recipe   android_compile_dbg   android_cronet   android_arm64_dbg_recipe   linux_android_rel_ng   linux_chromium_tsan_rel_ng   linux_chromium_rel_ng   linux_chromium_chromeos_ozone_rel_ng   linux_chromium_compile_dbg_ng   linux_chromium_asan_rel_ng   chromium_presubmit   linux_android_rel_ng   ios-simulator-xcode-clang   win_chromium_rel_ng   win_chromium_x64_rel_ng   win_clang   win_chromium_compile_dbg_ng   mac_chromium_compile_dbg_ng   ios-simulator-xcode-clang   mac_chromium_rel_ng   ios-device-xcode-clang   ios-simulator   linux_chromium_tsan_rel_ng   linux_chromium_rel_ng   ios-device   linux_chromium_chromeos_rel_ng   linux_chromium_compile_dbg_ng   chromium_presubmit   linux_chromium_chromeos_ozone_rel_ng   linux_chromium_asan_rel_ng   chromeos_amd64-generic_chromium_compile_only_ng   cast_shell_linux   linux_android_rel_ng   chromeos_daisy_chromium_compile_only_ng   android_n5x_swarming_rel   cast_shell_android   android_cronet   android_clang_dbg_recipe   android_compile_dbg   android_arm64_dbg_recipe 

Messages

Total messages: 22 (10 generated)
watk
Hi danakj, PTAL. I'm writing something where I wish I had this API.
6 months, 3 weeks ago (2017-04-27 21:37:34 UTC) #2
watk
Dang, just realized this isn't quite what I want anyway. Closing.
6 months, 3 weeks 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.. ...
6 months, 3 weeks 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 ...
6 months, 3 weeks 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 ...
6 months, 3 weeks ago (2017-04-27 22:16:42 UTC) #8
danakj
LGTM
6 months, 3 weeks 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
6 months, 3 weeks 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, ...
6 months, 3 weeks 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
6 months, 3 weeks 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)
6 months, 3 weeks 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
6 months, 3 weeks ago (2017-04-28 23:25:45 UTC) #19
commit-bot: I haz the power
6 months, 3 weeks 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 efc10ee0f