Make ServiceWorkerDispatcher reuse existing WebServiceWorkerImpls.
ServiceWorkerDispatcher used to mint new WebServiceWorkerImpl instances every time it was passed a representation of a Service Worker. Ultimately, this causes user script to see distinct objects representing the same Service Worker, which is Confusing and Wrong. This patch makes ServiceWorkerDispatcher use its table of existing WebServiceWorkerImpls to consistently represent a ServiceWorker with the same object. A chunk of this patch is concerned with making it explicit when a ServiceWorkerHandleReference, which a WebServiceWorkerImpl wraps, is being created in the renderer (and should send an add-ref message to the browser) versus being adopted in the renderer. BUG=361907 TEST=ServiceWorker* Review URL: https://codereview.chromium.org/309503014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274477 0039d316-1c4b-4281-b951-d872f2087c98
Showing
Please register or sign in to comment