angler-fishThe Vulnerability History Project

ServiceWorker: Send state change events via SWProviderHost

      This CL refactors relationship among SW(Registration)Handle, SWProviderHost and
SWDispatcherHost.

Before this CL, the handle directly asks SWDispatcherHost to send an IPC
message when it receives an state change notification. After this CL, the
handle retains a weakptr to SWProviderHost and asks it to send the message.

This change enables that...

- the handles don't have to take care of receiver's thread id anymore.
It's managed by SWProviderHost instead. (Currently the thread id is hard-coded
as kDocumentMainThreadId, but I'll make it injectable in a subsequent CL.)

- IPC messages could be queued up when the receiver's thread hasn't been ready
to receive the messages. This would be useful when we support the worker thread
as a receiver's thread.

BUG=437677
TEST=content_unittests --gtest_filter=ServiceWorker*
TEST=run-webkit-tests http/tests/serviceworker/

Review URL: https://codereview.chromium.org/825383004

Cr-Commit-Position: refs/heads/master@{#312592}
    
commit 084b4564fc3f39352e9c394fd803a9fb248e2efb
+38 -39
+13 -6
+1 -1
+8 -9
+5 -3
+1 -42
+6 -69
-21
+30 -12
+3 -2
+5 -4
expand_less