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

Issue 2328553002: Make CopyOnWriteBuffer keep capacity (Closed)

Created:
4 years, 3 months ago by danilchap
Modified:
4 years, 3 months ago
Reviewers:
kwiberg-webrtc
CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Make CopyOnWriteBuffer keep capacity for SetData and Clear functions too. This way result of all functions is same for shared and non-shared buffer cases R=kwiberg@webrtc.org Committed: https://chromium.googlesource.com/external/webrtc/+/2b2779f3f185bd2a0346cc425405561030cf224c

Patch Set 1 #

Total comments: 18

Patch Set 2 : Feedback #

Patch Set 3 : Guarantee capacity #

Total comments: 12

Patch Set 4 : Moved long non-template functions from .h into .cc #

Patch Set 5 : Revert move implmentation to .cc #

Patch Set 6 : Feedback #

Patch Set 7 : Test Feedback #

Patch Set 8 : heap_allocation -> original_allocation #

Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -40 lines) Patch
M webrtc/base/copyonwritebuffer.h View 1 2 3 4 5 2 chunks +12 lines, -8 lines 0 comments Download
M webrtc/base/copyonwritebuffer_unittest.cc View 1 2 3 4 5 6 7 2 chunks +91 lines, -32 lines 0 comments Download

Messages

Total messages: 20 (7 generated)
danilchap
While working with CopyOnWriteBuffer I run into issue where SetData may reduce capacity of the ...
4 years, 3 months ago (2016-09-08 15:48:29 UTC) #2
kwiberg-webrtc
https://codereview.webrtc.org/2328553002/diff/1/webrtc/base/copyonwritebuffer.h File webrtc/base/copyonwritebuffer.h (right): https://codereview.webrtc.org/2328553002/diff/1/webrtc/base/copyonwritebuffer.h#newcode157 webrtc/base/copyonwritebuffer.h:157: buffer_ = size > 0 ? new RefCountedObject<Buffer>(data, size) ...
4 years, 3 months ago (2016-09-09 08:55:14 UTC) #4
danilchap
https://codereview.webrtc.org/2328553002/diff/1/webrtc/base/copyonwritebuffer.h File webrtc/base/copyonwritebuffer.h (right): https://codereview.webrtc.org/2328553002/diff/1/webrtc/base/copyonwritebuffer.h#newcode157 webrtc/base/copyonwritebuffer.h:157: buffer_ = size > 0 ? new RefCountedObject<Buffer>(data, size) ...
4 years, 3 months ago (2016-09-09 11:21:17 UTC) #5
kwiberg-webrtc
https://codereview.webrtc.org/2328553002/diff/1/webrtc/base/copyonwritebuffer.h File webrtc/base/copyonwritebuffer.h (right): https://codereview.webrtc.org/2328553002/diff/1/webrtc/base/copyonwritebuffer.h#newcode157 webrtc/base/copyonwritebuffer.h:157: buffer_ = size > 0 ? new RefCountedObject<Buffer>(data, size) ...
4 years, 3 months ago (2016-09-09 12:59:14 UTC) #6
danilchap
May be go for different 'simple' solution: Make it similar to Buffer by forcing CowBuffer ...
4 years, 3 months ago (2016-09-09 16:00:56 UTC) #7
kwiberg-webrtc
On 2016/09/09 16:00:56, danilchap wrote: > May be go for different 'simple' solution: > Make ...
4 years, 3 months ago (2016-09-10 00:12:11 UTC) #8
kwiberg-webrtc
https://codereview.webrtc.org/2328553002/diff/1/webrtc/base/copyonwritebuffer.h File webrtc/base/copyonwritebuffer.h (right): https://codereview.webrtc.org/2328553002/diff/1/webrtc/base/copyonwritebuffer.h#newcode157 webrtc/base/copyonwritebuffer.h:157: buffer_ = size > 0 ? new RefCountedObject<Buffer>(data, size) ...
4 years, 3 months ago (2016-09-10 00:12:18 UTC) #9
danilchap
On 2016/09/10 00:12:11, kwiberg-webrtc wrote: > On 2016/09/09 16:00:56, danilchap wrote: > > May be ...
4 years, 3 months ago (2016-09-12 18:58:17 UTC) #12
kwiberg-webrtc
Patch set #3 lgtm. Moving longer functions to the .cc file is also a good ...
4 years, 3 months ago (2016-09-13 09:24:31 UTC) #13
danilchap
patch set #4 did just the move, but I still reverted it and will redo ...
4 years, 3 months ago (2016-09-13 09:56:37 UTC) #15
kwiberg-webrtc
lgtm https://codereview.webrtc.org/2328553002/diff/40001/webrtc/base/copyonwritebuffer_unittest.cc File webrtc/base/copyonwritebuffer_unittest.cc (right): https://codereview.webrtc.org/2328553002/diff/40001/webrtc/base/copyonwritebuffer_unittest.cc#newcode133 webrtc/base/copyonwritebuffer_unittest.cc:133: EXPECT_EQ(raw, buf1.cdata()); On 2016/09/13 09:56:37, danilchap wrote: > ...
4 years, 3 months ago (2016-09-13 10:01:18 UTC) #16
danilchap
https://codereview.webrtc.org/2328553002/diff/40001/webrtc/base/copyonwritebuffer_unittest.cc File webrtc/base/copyonwritebuffer_unittest.cc (right): https://codereview.webrtc.org/2328553002/diff/40001/webrtc/base/copyonwritebuffer_unittest.cc#newcode133 webrtc/base/copyonwritebuffer_unittest.cc:133: EXPECT_EQ(raw, buf1.cdata()); On 2016/09/13 10:01:18, kwiberg-webrtc wrote: > On ...
4 years, 3 months ago (2016-09-13 10:18:53 UTC) #17
danilchap
4 years, 3 months ago (2016-09-13 12:15:28 UTC) #20
Message was sent while issue was closed.
Committed patchset #8 (id:160001) manually as
2b2779f3f185bd2a0346cc425405561030cf224c (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698