• Yaron Friedman's avatar
    Reduce unnecessary OOM from screen captures. · 0dc3d913
    Yaron Friedman authored
    WebContents.getContentBitmapAsync was unnecessarily passing the bitmap
    to java before compressing it and saving to disk.
    
    Instead, changes the API so that the caller provides a directory in which to
    grab screenshots, and then WebContents seemlessly creates a new temp
    file, compresses to jpeg and saves to that directory, requiring 0 java heap
    allocation. As part of this async screen capture, also get a public Uri
    for exporting via ContentProvider because all clients do this anyway.
    BUG=651348
    
    Change-Id: I6be01348f225adfa370c6a5e08ebd57f15e8fe93
    Reviewed-on: https://chromium-review.googlesource.com/935670Reviewed-by: default avatarBernhard Bauer <bauerb@chromium.org>
    Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
    Commit-Queue: Yaron Friedman <yfriedman@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#550240}
    0dc3d913
callback_android.cc 1.56 KB