blob: c4e08c5308c337f2bf6e0a95edcf675e7ad1fdd0 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
module blink.mojom;
import "mojo/public/mojom/base/time.mojom";
import "services/network/public/mojom/request_context_frame_type.mojom";
import "url/mojom/url.mojom";
// Indicates the service worker client type.
// See https://w3c.github.io/ServiceWorker/#service-worker-client-concept
// and https://w3c.github.io/ServiceWorker/#dom-clientqueryoptions-type.
enum ServiceWorkerClientType {
kWindow,
kSharedWorker,
kAll,
};
// Indicates the options for the service worker clients matching operation.
// https://w3c.github.io/ServiceWorker/#dictdef-clientqueryoptions.
struct ServiceWorkerClientQueryOptions {
// ClientQueryOptions#includeUncontrolled
bool include_uncontrolled = false;
// ClientQueryOptions#type
ServiceWorkerClientType client_type = ServiceWorkerClientType.kWindow;
};
// 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
// empty string. Sometimes this is needed when the browser process couldn't
// find a client.
struct ServiceWorkerClientInfo {
// Client#url
url.mojom.Url url;
// Client#id
string client_uuid;
// Client#type
ServiceWorkerClientType client_type;
// 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.
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;
// The time this client was created.
mojo_base.mojom.TimeTicks creation_time;
};