Move shared worker browser-side infrastructure to the UI thread
SharedWorkerServiceImpl is no longer allocated using base::Singleton.
That was never necessary given that the instance is used exclusively
on a single thread. The change to put it on the main thread revealed
a shutdown crash related to the order of shutdown of singletons.
Rather than try to make sense of that, it seems better to just let
the instance leak. It serves no purpose to try to clean it up.
Note, in the future, it probably makes sense to hang an instance of
the service off of each StoragePartition instead.
Switched unit test over to using MockRenderProcessHost, which allows
for simplification of SharedWorkerServiceImpl. It no longer needs
extra layers of indirection to support unit testing.
Bug: 612308
Change-Id: Iac67e9d22e7942769bf29ce76b199ac9da3295ac
Reviewed-on: https://chromium-review.googlesource.com/674744
Reviewed-by: Brett Wilson <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Commit-Queue: Darin Fisher <[email protected]>
Cr-Commit-Position: refs/heads/master@{#507251}
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index f19bf95..1e3eb64 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -365,9 +365,8 @@
base::Bind(ShutdownServiceWorkerContext));
// Shared workers also keep render process hosts alive, and are expected to
- // return ref counts to 0 after documents close. However, shared worker
- // bookkeeping is done on the IO thread and we want to ensure the hosts are
- // destructed now, so forcibly release their ref counts here.
+ // return ref counts to 0 after documents close. However, to ensure that
+ // hosts are destructed now, forcibly release their ref counts here.
for (RenderProcessHost::iterator host_iterator =
RenderProcessHost::AllHostsIterator();
!host_iterator.IsAtEnd(); host_iterator.Advance()) {