Currently WebContentsImpl::onDownloadImageFinished() passes the downloaded bitmap through JNI synchronously, which keeps both the native bitmap and Java bitmap on the stack, which increases the memory pressure.
Since WebContents::DownloadImage() is already async, we can post a task to notify that the image has been downloaded to reduce the memory pressure.
Currently WebContentsImpl::onDownloadImageFinished() passes the downloaded bitmap through JNI synchronously, which keeps both the native bitmap and Java bitmap on the stack, which increases the memory pressure. If the user then does memory-heavy jobs on the callback, it will have higher chance to hit OOMs.
Since WebContents::DownloadImage() is already async, we can post a task to notify that the image has been downloaded to reduce the memory pressure.
Comment 1 by zqzh...@chromium.org
, Dec 13 2016