• Devlin Cronin's avatar
    [MD Extensions] Handle reload failures of unpacked extensions · 0a5f9449
    Devlin Cronin authored
    If a user hits "reload" on an unpacked extension, there's a chance that
    reload will fail (if the local files were modified in a way that causes
    a load error). Once this happens, successive calls to reload() will
    fail, because ExtensionService::ReloadExtension() doesn't play nicely
    with extensions that failed to reload.
    
    Adjust devleoperPrivate.reload() to return a LoadError (similar to
    loadUnpacked()) if the reload fails. The extensions page now checks for
    this result, and shows the load error dialog if the reload fails. The
    load error dialog can then trigger a retry of this load, which goes
    through loadUnpacked() rather than reload() (thus circumventing
    weirdness with ExtensionService::ReloadExtension()). This is comparable
    to how the current extensions page handles this scenario.
    
    This is *not* the ideal solution, as a) we shouldn't be going through
    loadUnpacked() for a loaded extension and b) the user can still get into
    a broken state (where the extension cannot be enabled, nor can it be
    reloaded) by dismissing the load error without fixing the error, but it
    brings us at least to parity with the old page.
    
    Bug: 789659
    
    Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
    Change-Id: Ib0bd6eb4bfe74b1da588a9ea78e3396703fee973
    Reviewed-on: https://chromium-review.googlesource.com/798599
    Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
    Reviewed-by: default avatarKaran Bhatia <karandeepb@chromium.org>
    Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#522205}
    0a5f9449
developer_private.idl 18.4 KB