[Cronet] Provide API to directly save response to UrlResponse |
||||||
Issue descriptionFor some use cases it is beneficial to have an API to directly save data from Cronet UrlRequest response into the file. This could be better optimized and easier to use than regular Async API.
,
Jun 16 2016
I suppose that API could look like 'readToFile(File)' on the 'onResponseStarted' callback. We wouldn't want to read entire file into memory, but we may not want to write every 'onReadCompleted' into the file either as depending on protocol that could result in many small writes.
,
Jun 16 2016
It seems if onReadCompleted is called for small pieces of data for a particular protocol, we should really fix Cronet to not call Java onReadCompleted multiple times with small pieces of data. We would continue calling url_request_->Read(read_buffer_.get(), buffer_size, &bytes_read) in cronet_url_request_adapter.cc until the 32kB read buffer is full or the request is completed before surfacing to Java. WDYT?
,
Jun 17 2016
I talked to Matt briefly and we can't just delay the Read as I previously suggested, since we do not know if there will be more data coming and it might be a hanging GET. However, we could try to keep reading and buffering internally in Cronet so we have more data to surface to Java for the next Read. We could expose this option on a per-request basis, so embedder can experiment and see how much a difference this makes.
,
Jun 20 2016
The received data is getting buffered on the net layer, so there is no need to have additional buffers on Cronet layer. I think we could add a flag that buffer needs to be filled completely, and don't return it to the app until either it is filled or request is completed (successfully or not).
,
Jun 20 2016
,
Jul 19 2016
,
Jul 20 2017
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. If you change it back, also remove the "Hotlist-Recharge-Cold" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jul 21 2017
Is this feature still needed?
,
Jul 21 2017
There was no significant interest for this feature, and it can be easily implemented on top of current UrlRequest API so I'm closing this as Wontfix. |
||||||
►
Sign in to add a comment |
||||||
Comment 1 by xunji...@chromium.org
, Jun 16 2016