• Istiaque Ahmed's avatar
    Register SW based script only on first time extension activation. · 70f76ac2
    Istiaque Ahmed authored
    During browser startup, registering a service worker can be slow (in
    order of a few seconds). We currently register SW based extension's
    script on every extension activation (when we load extensions),
    which isn't necessary as SW registrations are suppose to persist
    across browser restart by design.
    
    Add a pref to remember the fact that we have successfully registered
    an extension's background SW script for a particular version of
    that extension and use that to decide whether or not to register
    the SW during OnActivateExtension.
    
    This CL will improve SW based extension's startup time.
    
    Bug: 889687
    Test: Demo browser clock extension doesn't lag much with the change (note that this is requires local modification to chromium, specifically Patchset #2)
    Change-Id: Icfb7174be27f65a1cb6b8ac6d99ddc6b33fdf1c0
    Reviewed-on: https://chromium-review.googlesource.com/c/1265821
    Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org>
    Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#604823}
    70f76ac2
service_worker_apitest.cc 64.4 KB