service worker: Refactoring in controllee request handler for main resource.
There was very similar code, make it the same function.
This patch tries to maintain the same behavior as previous to minimize
changes.
Detailed changelog:
  - Move |need_to_update|. The point of this upfront was to choose whether
    to "unblock" association on early return. In the need_to_update case,
    we know we call an async function, so didn't want to unblock.
    It's easier to always to unblock upfront, and block before the async
    functions. RAII would improve this, but avoided that to minimize the
    diff.
  - Remove |status| from TRACE when it's already guaranteed to be kOk.
  - Previously we avoided calling AssociateRegistration until after
    trying to make the active worker transition ACTIVATING -> ACTIVATED.
    There shouldn't be a need for that: once there's an active worker,
    the provider host should "use" the registration. But to minimize the
    diff, I've maintained this old behavior. When the callback fires,
    we unassociate there if something failed.
Change-Id: I0d8a9bea5f516a42002ecb7e236a8f1e9eced678
Reviewed-on: https://chromium-review.googlesource.com/1143092
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Reviewed-by: 
Makoto Shimazu <shimazu@chromium.org>
Reviewed-by: 
Kenichi Ishibashi <bashi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577464}
Showing
Please register or sign in to comment