Commit af8bcef5 authored by Matt Falkenhagen's avatar Matt Falkenhagen Committed by Commit Bot

service worker: Restore comment about visibilityState.

Undo a removal from r612849. WindowClient#visibilityState refers to the
web-exposed IDL attribute and is still relevant, even though the
mojom field name changed.

Also, change the order of the mojom fields to match the IDL attribute
order in the specification.

Change-Id: I445b82c368ac5e22e9bca4e8c22d3c7b1878eedb
Reviewed-on: https://chromium-review.googlesource.com/c/1358115Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Commit-Queue: Matt Falkenhagen <falken@chromium.org>
Cr-Commit-Position: refs/heads/master@{#613022}
parent 108ea5aa
......@@ -131,12 +131,12 @@ blink::mojom::ServiceWorkerClientInfoPtr GetWindowClientInfoOnUI(
DCHECK_NE(visibility, PageVisibilityState::kPrerender);
bool page_hidden = visibility != PageVisibilityState::kVisible;
return blink::mojom::ServiceWorkerClientInfo::New(
render_frame_host->GetLastCommittedURL(), client_uuid,
blink::mojom::ServiceWorkerClientType::kWindow, page_hidden,
render_frame_host->IsFocused(),
render_frame_host->GetLastCommittedURL(),
render_frame_host->GetParent()
? network::mojom::RequestContextFrameType::kNested
: network::mojom::RequestContextFrameType::kTopLevel,
client_uuid, blink::mojom::ServiceWorkerClientType::kWindow, page_hidden,
render_frame_host->IsFocused(),
render_frame_host->frame_tree_node()->last_focus_time(), create_time);
}
......@@ -328,10 +328,10 @@ void AddNonWindowClient(const ServiceWorkerProviderHost* host,
return;
auto client_info = blink::mojom::ServiceWorkerClientInfo::New(
host->url(), host->client_uuid(), host_client_type,
host->url(), network::mojom::RequestContextFrameType::kNone,
host->client_uuid(), host_client_type,
/*page_hidden=*/true,
/*is_focused=*/false, network::mojom::RequestContextFrameType::kNone,
base::TimeTicks(), host->create_time());
/*is_focused=*/false, base::TimeTicks(), host->create_time());
out_clients->push_back(std::move(client_info));
}
......@@ -542,10 +542,10 @@ void GetClient(const ServiceWorkerProviderHost* provider_host,
}
auto client_info = blink::mojom::ServiceWorkerClientInfo::New(
provider_host->url(), provider_host->client_uuid(),
provider_host->client_type(), /*page_hidden=*/true,
/*is_focused=*/false, network::mojom::RequestContextFrameType::kNone,
base::TimeTicks(), provider_host->create_time());
provider_host->url(), network::mojom::RequestContextFrameType::kNone,
provider_host->client_uuid(), provider_host->client_type(),
/*page_hidden=*/true,
/*is_focused=*/false, base::TimeTicks(), provider_host->create_time());
base::PostTaskWithTraits(
FROM_HERE, {BrowserThread::IO},
base::BindOnce(std::move(callback), std::move(client_info)));
......
......@@ -30,29 +30,30 @@ struct ServiceWorkerClientQueryOptions {
// Holds the information related to a service worker client.
// https://w3c.github.io/ServiceWorker/#client
//
// An invalid client info can be indicated by setting the client_uuid to the
// An invalid client info can be indicated by setting the |client_uuid| to the
// empty string. Sometimes this is needed when the browser process couldn't
// find a client.
struct ServiceWorkerClientInfo {
// Client#url
url.mojom.Url url;
// Client#frameType.
network.mojom.RequestContextFrameType frame_type = network.mojom.RequestContextFrameType.kNone;
// Client#id
string client_uuid;
// Client#type
ServiceWorkerClientType client_type;
// WindowClient#visibilityState
// Set to |true| if it's a non-window client.
bool page_hidden = true;
// WindowClient#focused
// Set to false if it's a non-window client.
// Set to |false| if it's a non-window client.
bool is_focused = false;
// Set to |kNone| if it's a non-window client.
network.mojom.RequestContextFrameType frame_type = network.mojom.RequestContextFrameType.kNone;
// The time this window was last focused. Set to base::TimeTicks() if it's
// a non-window client.
mojo_base.mojom.TimeTicks last_focus_time;
......
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