Commit e7466584 authored by Maks Orlovich's avatar Maks Orlovich Committed by Commit Bot

net-export on iOS: fix bounded mode.

It turns out that JS -> base::Value conversion there produces doubles
while the code expected it to produce ints, like desktop/android do.

Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I18c255597250956fbd1a224986fb806b3bb9fa11
Reviewed-on: https://chromium-review.googlesource.com/1052090
Commit-Queue: Maks Orlovich <morlovich@chromium.org>
Reviewed-by: default avatarHelen Li <xunjieli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#557308}
parent 7ebf529c
...@@ -148,8 +148,12 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) { ...@@ -148,8 +148,12 @@ void NetExportMessageHandler::OnStartNetLog(const base::ListValue* list) {
// Determine the max file size. // Determine the max file size.
uint64_t max_log_file_size = net_log::NetExportFileWriter::kNoLimit; uint64_t max_log_file_size = net_log::NetExportFileWriter::kNoLimit;
if (params.size() > 1 && params[1].is_int() && params[1].GetInt() > 0) { // Unlike in desktop/Android net_export_ui, the size limit here is encoded
max_log_file_size = params[1].GetInt(); // into a base::Value as a double; this is a behavior difference between
// ValueResultFromWKResult and V8ValueConverter[Impl]::FromV8Value[Impl].
if (params.size() > 1 && (params[1].is_int() || params[1].is_double()) &&
params[1].GetDouble() > 0.0) {
max_log_file_size = params[1].GetDouble();
} }
file_writer_->StartNetLog( file_writer_->StartNetLog(
......
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