Use mojo IPC for communicating w/ the shared worker instance
This change introduces a new service (SharedWorkerFactory) exported from renderer processes to support the instantiation of shared worker instances. The SharedWorkerFactory is instantiated from within the SharedWorkerServiceImpl::TryReserve function, which runs on the UI thread. This way we defer connecting to that service until we want to create a shared worker. It also allows the unit tests to swap in a mock implementation of SharedWorkerFactory. In a future CL, it'll be possible to remove the SharedWorkerMessageFilter. Even though that class now no longer filters any Chrome IPC messages, its other functionality is still needed. Similarly, we still need to allocate a routing ID for the shared worker even though that is not needed by the shared worker infrastructure. Dev Tools uses the routing ID to help lookup the shared worker, so that'll need to change before we clean this up. Also, in a future CL, it'll be possible to move the shared worker service code to run entirely on the UI thread. This will allow a lot of code simplification as we'll no longer have to deal w/ the race conditions during process reservation. A bunch of complexity will disappear. To try to keep this CL manageable, I chose to postpone the threading changes to a follow-up CL. The lifetime of the SharedWorker instance in the renderer process is a bit squirrely thanks to how WebSharedWorker manages its lifetime. This CL does not attempt any changes there. Bug: 612308 Change-Id: Ifc355d42d0c869519acee853c953342a2bcf691a Reviewed-on: https://chromium-review.googlesource.com/659139Reviewed-by:Daniel Cheng <dcheng@chromium.org> Reviewed-by:
Kinuko Yasuda (slow) <kinuko@chromium.org> Reviewed-by:
Hiroki Nakagawa <nhiroki@chromium.org> Commit-Queue: Darin Fisher <darin@chromium.org> Cr-Commit-Position: refs/heads/master@{#502910}
Showing
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Please register or sign in to comment