chromium/third_party/blink/public/common/service_worker/service_worker_router_rule.h

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_PUBLIC_COMMON_SERVICE_WORKER_SERVICE_WORKER_ROUTER_RULE_H_
#define THIRD_PARTY_BLINK_PUBLIC_COMMON_SERVICE_WORKER_SERVICE_WORKER_ROUTER_RULE_H_

#include <memory>
#include <optional>
#include <vector>

#include "third_party/blink/public/common/common_export.h"
#include "third_party/blink/public/common/safe_url_pattern.h"

namespace network::mojom {

enum class RequestMode : int32_t;
enum class RequestDestination : int32_t;
enum class ServiceWorkerRouterSourceType : int32_t;

}  // namespace network::mojom

namespace blink {

class ServiceWorkerRouterCondition;

// TODO(crbug.com/1490445): set this value by discussing in spec proposal.
static constexpr int kServiceWorkerRouterConditionMaxRecursionDepth =;
// TODO(crbug.com/1503017): set this value by discussing in spec proposal.
static constexpr size_t kServiceWorkerMaxRouterSize =;

struct BLINK_COMMON_EXPORT ServiceWorkerRouterRequestCondition {};

struct BLINK_COMMON_EXPORT ServiceWorkerRouterRunningStatusCondition {};

struct BLINK_COMMON_EXPORT ServiceWorkerRouterOrCondition {};

struct BLINK_COMMON_EXPORT ServiceWorkerRouterNotCondition {};

// TODO(crbug.com/1371756): implement other conditions in the proposal.
class BLINK_COMMON_EXPORT ServiceWorkerRouterCondition {};

// Network source structure.
// TODO(crbug.com/1371756): implement fields in the proposal.
struct BLINK_COMMON_EXPORT ServiceWorkerRouterNetworkSource {};

// Race network and fetch handler source.
struct BLINK_COMMON_EXPORT ServiceWorkerRouterRaceSource {};

// Fetch handler source structure.
struct BLINK_COMMON_EXPORT ServiceWorkerRouterFetchEventSource {};

// Cache source structure.
struct BLINK_COMMON_EXPORT ServiceWorkerRouterCacheSource {};

// This represents a source of the router rule.
// TODO(crbug.com/1371756): implement other sources in the proposal.
struct BLINK_COMMON_EXPORT ServiceWorkerRouterSource {};

// This represents a ServiceWorker static routing API's router rule.
// It represents each route.
struct BLINK_COMMON_EXPORT ServiceWorkerRouterRule {};

// This represents a condition of the router rule.
// This represents a list of ServiceWorker static routing API's router rules.
struct BLINK_COMMON_EXPORT ServiceWorkerRouterRules {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_PUBLIC_COMMON_SERVICE_WORKER_SERVICE_WORKER_ROUTER_RULE_H_