Commit 43681139 authored by Marijn Kruisselbrink's avatar Marijn Kruisselbrink Committed by Commit Bot

Remove NOTREACHED() from EncodedFormData::SizeInBytes.

The comment incorrectly asserted that the method was only called by
PingLoader. In fact the method is called for every request by devtools.
So instead just ignore data pipes in the size calculation for now, just
like blobs without blob data handle are ignored.

If we do want actual size information for these elements at some point
we'd probably just want to add an explicit size field along with the
DataPipeGetter, just like network::DataElement already does for almost
every other type of element.

Bug: 821878
Change-Id: I6a64aaeffbcf0e22bf90bcf44c38367bf682cf3e
Reviewed-on: https://chromium-review.googlesource.com/964612Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543784}
parent f01ed503
......@@ -178,12 +178,13 @@ unsigned long long EncodedFormData::SizeInBytes() const {
size += e.optional_blob_data_handle_->size();
break;
case FormDataElement::kDataPipe:
// We can get the size but it'd be async. Data pipe elements only exist
// for requests intercepted by service workers (and possibly
// subsequently redirected). But this function is only called for
// requests initiated by PingLoader, assume this function isn't needed
// in that case.
NOTREACHED();
// We can get the size but it'd be async. Data pipe elements exist only
// in EncodedFormData instances that were filled from the content side
// using the WebHTTPBody interface, and generally represent blobs.
// Since for actual kEncodedBlob elements we ignore their size as well
// if the element was created through WebHTTPBody (which never sets
// optional_blob_data_handle), we'll ignore the size of these elements
// as well.
break;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment