Get image's data by JavaScript to accelerate Copy Image.
Current Copy Image feature downloads the image outside WKWebView. This CL adds functionality of fetching image's data by JavaScript in 2 steps: 1. Draws <img> to <canvas> and exports it; 2. If 1 failed, downloads the picture by XMLHttpRequest, which may be responsed from cache. Both 2 methods may fail due to cross-origin restriction, but under different conditions. More info in this design doc: https://docs.google.com/document/d/1twZ1-Ssn4_9L4eN23-7H-wJkKKWSWLJTSt6Kwn0DqsU/edit?usp=sharing Bug: 163201 Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet Change-Id: I12bac9d6bd40b4c42d35a23745edaa4dca9fa071 Reviewed-on: https://chromium-review.googlesource.com/1145276 Commit-Queue: Yi Su <mrsuyi@chromium.org> Reviewed-by:Eugene But <eugenebut@chromium.org> Cr-Commit-Position: refs/heads/master@{#581176}
Showing
Please register or sign in to comment