DescriptionServiceWorker: 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/
Committed: https://crrev.com/084b4564fc3f39352e9c394fd803a9fb248e2efb
Cr-Commit-Position: refs/heads/master@{#312592}
Patch Set 1 : #
Total comments: 4
Patch Set 2 : remove unnecessary error handling #
Total comments: 2
Patch Set 3 : update header comment #Patch Set 4 : rebase #Messages
Total messages: 24 (9 generated)
|