• Noel Gordon's avatar
    [piexwasm] Make callers handle Piex Module failure · d2972196
    Noel Gordon authored
    piex-wasm assumes chrome.runtime.reload can be used to reload the page
    on Module failures. Other environments (normal web pages, web workers,
    NodeJS, etc) obviously can't use chrome.runtime.reload.
    
    Remove the chrome.runtime.reload assumption: change the client code to
    provide the failure handler to piex-wasm. Change image_request_task.js
    RAW image client code: pass in the chrome.runtime.reload handler.
    
    While here, add or adjust comments to image_request_task.js and change
    the direct loading case to arrow function. No change in behavior.
    
    Bug: 1132695
    No-try: true
    Change-Id: I6a2b641cdc036dd208f4d64deb4f0b7fdff0835f
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2432705
    Commit-Queue: Noel Gordon <noel@chromium.org>
    Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#811085}
    d2972196
piex_loader.js 13.6 KB