|
|
Descriptionbase: 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 #
Messages
Total messages: 22 (10 generated)
watk@chromium.org changed reviewers: + danakj@chromium.org
Hi danakj, PTAL. I'm writing something where I wish I had this API.
Description was changed from ========== base: Add a ElapsedTimer::Reset() for resetting the timed interval 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 and call Reset() on it. ========== to ========== base: Add ElapsedTimer::Reset() for resetting the timed interval 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 and call Reset() on it. ==========
Dang, just realized this isn't quite what I want anyway. Closing.
Message was sent while issue was closed.
You could use an Optional<ElapsedTimer> but then you'd have to add a move constructor/assignment instead.. :P
Message was sent while issue was closed.
On 2017/04/27 21:45:08, watk wrote: > Dang, just realized this isn't quite what I want anyway. Closing. Oh ok :)
Message was sent while issue was closed.
Description was changed from ========== base: Add ElapsedTimer::Reset() for resetting the timed interval 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 and call Reset() on it. ========== to ========== 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. ==========
Ooh, Optional + movable would be nice so I don't have to feel weird about heap allocating a int64. Reopening :)
LGTM
The CQ bit was checked by watk@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
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_androi...) linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_compile_dbg_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...) linux_chromium_tsan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by watk@chromium.org
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
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_androi...)
The CQ bit was checked by watk@chromium.org
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": 40001, "attempt_start_ts": 1493421905499050, "parent_rev": "fd60d8ca4a34a9cacfa3f45d65598165543fa74e", "commit_rev": "badc743a3b4f1a1405cb8d9069d7353c333f3701"}
Message was sent while issue was closed.
Description was changed from ========== 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. ========== to ========== 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/+/badc743a3b4f1a1405cb8d9069d7... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/badc743a3b4f1a1405cb8d9069d7... |