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

Issue 1707693002: Changed the semantics of Buffer::Clear to not alter the capacity (Closed)

Created:
4 years, 10 months ago by ossu
Modified:
4 years, 10 months ago
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Base URL:
https://chromium.googlesource.com/external/webrtc.git@noogle-encode
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Changed the semantics of Buffer::Clear to not alter the capacity Also added a test for Clear to ensure this invariant holds. With this change, it is easy to empty a Buffer and reuse its storage. Further down the line, code filling data into a Buffer could be written to just append to it, with the caller determining if the Buffer should first be cleared or not. There is currently only one use of Buffer::Clear (in AudioEncoderCopyRed::Reset()) and it should benefit from the change, by not requiring a reallocation after Reset. Committed: https://crrev.com/728012e49fc9f0c4ecda92781abbeda7cfc8a03f Cr-Commit-Position: refs/heads/master@{#11680}

Patch Set 1 #

Total comments: 7

Patch Set 2 : Rebase onto correct branch. #

Messages

Total messages: 33 (14 generated)
ossu
Please take a look.
4 years, 10 months ago (2016-02-18 11:16:39 UTC) #4
kwiberg-webrtc
Looks good, but see comment. Also, I've updated the commit message to have the first ...
4 years, 10 months ago (2016-02-18 11:22:32 UTC) #6
henrika_webrtc
https://codereview.webrtc.org/1707693002/diff/1/webrtc/base/buffer.h File webrtc/base/buffer.h (right): https://codereview.webrtc.org/1707693002/diff/1/webrtc/base/buffer.h#newcode183 webrtc/base/buffer.h:183: // Resets the buffer to zero size without altering ...
4 years, 10 months ago (2016-02-18 11:54:38 UTC) #7
ossu
https://codereview.webrtc.org/1707693002/diff/1/webrtc/base/buffer.h File webrtc/base/buffer.h (right): https://codereview.webrtc.org/1707693002/diff/1/webrtc/base/buffer.h#newcode184 webrtc/base/buffer.h:184: // buffer has been moved from. On 2016/02/18 11:22:32, ...
4 years, 10 months ago (2016-02-18 12:00:10 UTC) #8
ossu
On 2016/02/18 11:54:38, henrika_webrtc wrote: > https://codereview.webrtc.org/1707693002/diff/1/webrtc/base/buffer.h > File webrtc/base/buffer.h (right): > > https://codereview.webrtc.org/1707693002/diff/1/webrtc/base/buffer.h#newcode183 > ...
4 years, 10 months ago (2016-02-18 12:04:56 UTC) #9
kwiberg-webrtc
lgtm https://codereview.webrtc.org/1707693002/diff/1/webrtc/base/buffer.h File webrtc/base/buffer.h (right): https://codereview.webrtc.org/1707693002/diff/1/webrtc/base/buffer.h#newcode183 webrtc/base/buffer.h:183: // Resets the buffer to zero size without ...
4 years, 10 months ago (2016-02-18 12:05:35 UTC) #10
henrika_webrtc
LGTM
4 years, 10 months ago (2016-02-18 12:28:10 UTC) #11
henrika_webrtc
https://codereview.webrtc.org/1707693002/diff/1/webrtc/base/buffer.h File webrtc/base/buffer.h (right): https://codereview.webrtc.org/1707693002/diff/1/webrtc/base/buffer.h#newcode183 webrtc/base/buffer.h:183: // Resets the buffer to zero size without altering ...
4 years, 10 months ago (2016-02-18 12:28:19 UTC) #12
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1707693002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1707693002/1
4 years, 10 months ago (2016-02-18 12:31:17 UTC) #14
commit-bot: I haz the power
CLs for remote refs other than refs/pending/heads/master must contain NOTRY=true and NOPRESUBMIT=true in order for ...
4 years, 10 months ago (2016-02-18 12:31:19 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1707693002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1707693002/20001
4 years, 10 months ago (2016-02-18 12:34:41 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: android_rel on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_rel/builds/11021)
4 years, 10 months ago (2016-02-18 12:42:46 UTC) #21
kwiberg-webrtc
https://codereview.webrtc.org/1707693002/diff/1/webrtc/base/buffer.h File webrtc/base/buffer.h (right): https://codereview.webrtc.org/1707693002/diff/1/webrtc/base/buffer.h#newcode183 webrtc/base/buffer.h:183: // Resets the buffer to zero size without altering ...
4 years, 10 months ago (2016-02-18 13:12:04 UTC) #22
henrika_webrtc
Did not notice that it was used in so many places. I am fine as ...
4 years, 10 months ago (2016-02-18 13:20:33 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1707693002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1707693002/20001
4 years, 10 months ago (2016-02-18 13:58:09 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: android_rel on tryserver.webrtc (JOB_FAILED, http://build.chromium.org/p/tryserver.webrtc/builders/android_rel/builds/11023)
4 years, 10 months ago (2016-02-18 14:09:02 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1707693002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1707693002/20001
4 years, 10 months ago (2016-02-19 10:15:34 UTC) #29
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 10 months ago (2016-02-19 10:38:36 UTC) #31
commit-bot: I haz the power
4 years, 10 months ago (2016-02-19 10:38:47 UTC) #33
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/728012e49fc9f0c4ecda92781abbeda7cfc8a03f
Cr-Commit-Position: refs/heads/master@{#11680}

Powered by Google App Engine
This is Rietveld 408576698