Skip to content

Commit 5b7911b

Browse files
Bug 1262671 - Remove unused TrimWriteData (r=froydnj)
1 parent f159cad commit 5b7911b

File tree

2 files changed

+0
-29
lines changed

2 files changed

+0
-29
lines changed

ipc/chromium/src/base/pickle.cc

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -577,23 +577,6 @@ char* Pickle::BeginWriteData(int length) {
577577
return data_ptr;
578578
}
579579

580-
void Pickle::TrimWriteData(int new_length) {
581-
DCHECK(variable_buffer_offset_ != 0);
582-
583-
// Fetch the the variable buffer size
584-
int* cur_length = reinterpret_cast<int*>(
585-
reinterpret_cast<char*>(header_) + variable_buffer_offset_);
586-
587-
if (new_length < 0 || new_length > *cur_length) {
588-
NOTREACHED() << "Invalid length in TrimWriteData.";
589-
return;
590-
}
591-
592-
// Update the payload size and variable buffer size
593-
header_->payload_size -= (*cur_length - new_length);
594-
*cur_length = new_length;
595-
}
596-
597580
void Pickle::Resize(uint32_t new_capacity) {
598581
new_capacity = ConstantAligner<kPayloadUnit>::align(new_capacity);
599582

ipc/chromium/src/base/pickle.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -176,18 +176,6 @@ class Pickle {
176176
// The returned pointer will only be valid until the next write operation
177177
// on this Pickle.
178178
char* BeginWriteData(int length);
179-
180-
// For Pickles which contain variable length buffers (e.g. those created
181-
// with BeginWriteData), the Pickle can
182-
// be 'trimmed' if the amount of data required is less than originally
183-
// requested. For example, you may have created a buffer with 10K of data,
184-
// but decided to only fill 10 bytes of that data. Use this function
185-
// to trim the buffer so that we don't send 9990 bytes of unused data.
186-
// You cannot increase the size of the variable buffer; only shrink it.
187-
// This function assumes that the length of the variable buffer has
188-
// not been changed.
189-
void TrimWriteData(int length);
190-
191179
void EndRead(void* iter) const {
192180
DCHECK(iter == end_of_payload());
193181
}

0 commit comments

Comments
 (0)