Bug 1632594 - Use Long.valueOf instead of Integer.valueOf on GeckoSession#onExternalResponse. r=geckoview-reviewers,agi

When content length is over 2GB, `WebResponseInfo.contentLength` is negative
value. Use Long.valueOf instead of Integer.valueOf to pass this value.

Differential Revision: https://phabricator.services.mozilla.com/D74586
This commit is contained in:
Makoto Kato 2020-05-11 16:21:01 +00:00
parent 50334d3714
commit ec78483903
2 changed files with 5 additions and 2 deletions

View File

@ -104,7 +104,7 @@ NS_IMETHODIMP GeckoViewExternalAppService::CreateListener(
}
keys.AppendElement(jni::StringParam(NS_LITERAL_STRING("contentLength")));
values.AppendElement(java::sdk::Integer::ValueOf(contentLength));
values.AppendElement(java::sdk::Long::ValueOf(contentLength));
nsString filename;
if (NS_SUCCEEDED(channel->GetContentDispositionFilename(filename))) {
@ -132,4 +132,4 @@ NS_IMETHODIMP GeckoViewExternalAppService::ApplyDecodingForExtension(
// This currently doesn't matter, because we never read the stream.
*aApplyDecoding = true;
return NS_OK;
}
}

View File

@ -12,6 +12,9 @@ booleanValue =
# because some Integer values are cached.
valueOf(I)Ljava/lang/Integer; =
[java.lang.Long = skip:true]
valueOf(J)Ljava/lang/Long; =
[java.lang.Number = skip:true]
# Use doubleValue() for unboxing Double/Float/Long.
doubleValue =