Reland "Hook up running extension SW information to ProcessManager"

This is a reland of 7466707780d996e09adff361f84c0ae0add4602c
The only change is to wait for "activate" SW event in tests
instead of "install" event. This fixes the previous test
flakiness locally.

Original change's description:
> Hook up running extension SW information to ProcessManager
>
> When service worker context initializes, add the corresponding
> entry to ProcessManager and remove it when the context stops.
>
> Introduce IPC for worker initialization
> (DidInitializeServiceWorkerContext) and modify worker
> stop IPC (DidStopServiceWorkerContext) as necessary.
>
> Note that we cannot use loadstop
> (DidStartServiceWorkerContext) for PM entry addition because it
> can be too late as extension API calls might arrive in browser
> process before this.
>
> Also add SW information cleanup on render process termination as
> termination doesn't trigger stop worker messages (where the
> regular cleanup in PM happens).
>
> This CL will enable extension messaging in future CLs.
>
> Add tests for shutdown and termination behavior.
>
> Bug: 925918
> Change-Id: I9442bac9a1e9acf01063084a1e6ef2fac3279e09
> Reviewed-on: https://chromium-review.googlesource.com/c/1455267
> Reviewed-by: Dominick Ng <dominickn@chromium.org>
> Reviewed-by: Devlin <rdevlin.cronin@chromium.org>
> Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#636929}

TBR=rdevlin.cronin@chromium.org,dominickn@chromium.org

Bug: 925918
Change-Id: I148fe7ddce1b66b934eec20536172cbb94b27540
Reviewed-on: https://chromium-review.googlesource.com/c/1497862
Reviewed-by: Istiaque Ahmed <lazyboy@chromium.org>
Commit-Queue: Istiaque Ahmed <lazyboy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#637118}
15 files changed