Commit 3020baca authored by Matt Falkenhagen's avatar Matt Falkenhagen Committed by Commit Bot

service worker: Clarify comment about when controller endpoint is null.

Change-Id: I2437f4bae9bfd7384d42a586fd7ee6cfba54210d
Reviewed-on: https://chromium-review.googlesource.com/1098418Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566709}
parent cc83191e
...@@ -258,13 +258,13 @@ ServiceWorkerControlleeRequestHandler::MaybeCreateSubresourceLoaderParams() { ...@@ -258,13 +258,13 @@ ServiceWorkerControlleeRequestHandler::MaybeCreateSubresourceLoaderParams() {
// Otherwise let's send the controller service worker information along // Otherwise let's send the controller service worker information along
// with the navigation commit. // with the navigation commit.
// Note that |controller_info->endpoint| could be null if the controller
// service worker isn't starting up or running, e.g. in no-fetch worker
// cases. In that case the renderer frame won't get the controller pointer
// upon the navigation commit, and subresource loading will not be intercepted
// at least until the frame gets a new controller ptr by SetController.
SubresourceLoaderParams params; SubresourceLoaderParams params;
auto controller_info = mojom::ControllerServiceWorkerInfo::New(); auto controller_info = mojom::ControllerServiceWorkerInfo::New();
// Note that |controller_info->endpoint| is null if the controller has no
// fetch event handler. In that case the renderer frame won't get the
// controller pointer upon the navigation commit, and subresource loading will
// not be intercepted. (It might get intercepted later if the controller
// changes due to skipWaiting() so SetController is sent.)
controller_info->endpoint = controller_info->endpoint =
provider_host_->GetControllerServiceWorkerPtr().PassInterface(); provider_host_->GetControllerServiceWorkerPtr().PassInterface();
controller_info->client_id = provider_host_->client_uuid(); controller_info->client_id = provider_host_->client_uuid();
......
...@@ -55,7 +55,7 @@ interface ControllerServiceWorker { ...@@ -55,7 +55,7 @@ interface ControllerServiceWorker {
// commit, and also as a parameter of ServiceWorkerContainer.SetController(). // commit, and also as a parameter of ServiceWorkerContainer.SetController().
struct ControllerServiceWorkerInfo { struct ControllerServiceWorkerInfo {
// S13nServiceWorker: // S13nServiceWorker:
// Non-null if the controller has fetch event handlers. // Non-null iff the controller has a fetch event handler.
ControllerServiceWorker? endpoint; ControllerServiceWorker? endpoint;
// S13nServiceWorker: // S13nServiceWorker:
// The client being controlled, used for FetchEvent#clientId. The ID is // The client being controlled, used for FetchEvent#clientId. The ID is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment