Description[ServiceWorker] Make Stream support in ServiceWorkerURLRequestJob
In ServiceWorkerURLRequestJob::DidDispatchFetchEvent(), if response.stream_url of ServiceWorkerHostMsg_FetchEventFinished is set, ServiceWorkerURLRequestJob starts reading the body of the response from the stream instead of the blob.
But the stream may not be registered yet.
It is because ServiceWorkerHostMsg_FetchEventFinished is sent from the worker thread but StreamHostMsg_StartBuilding which triggers the stream registration is sent from the main thread of the ServiceWorker process.
So if ServiceWorkerURLRequestJob can't get the stream in DidDispatchFetchEvent(), call StreamRegistry::SetRegisterObserver() to receive the stream registration event.
When ServiceWorkerURLRequestJob successfuly gets the stream, it starts reading the stream.
The codes for reading the stream is almost same as the codes in StreamURLRequestJob.
This change depends on these changes:
https://codereview.chromium.org/760823002
https://codereview.chromium.org/759823003
BUG=436424
Committed: https://crrev.com/d556043ea410430fc84a555d4018265025dfc194
Cr-Commit-Position: refs/heads/master@{#308059}
Patch Set 1 : #
Total comments: 28
Patch Set 2 : #Patch Set 3 : #Patch Set 4 : incorporated nhiroki's comment #Patch Set 5 : include set #
Total comments: 12
Patch Set 6 : incorporated tyoshino and nhiroki's comment #
Total comments: 14
Patch Set 7 : incorporated tyoshino's comment #Patch Set 8 : AbortPendingStream #
Messages
Total messages: 32 (16 generated)
|