chromium/third_party/blink/renderer/modules/shared_storage/shared_storage_worklet_thread.cc

// 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.

#include "third_party/blink/renderer/modules/shared_storage/shared_storage_worklet_thread.h"

#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/shared_storage/shared_storage_worklet_service.mojom-blink.h"
#include "third_party/blink/renderer/core/workers/global_scope_creation_params.h"
#include "third_party/blink/renderer/core/workers/worklet_thread_holder.h"
#include "third_party/blink/renderer/modules/shared_storage/shared_storage_worklet_global_scope.h"
#include "third_party/blink/renderer/platform/instrumentation/tracing/trace_event.h"

namespace blink {

namespace {
class SharedStorageWorkletThreadSharedBackingThreadImpl;
}  // namespace

template class WorkletThreadHolder<
    SharedStorageWorkletThreadSharedBackingThreadImpl>;

namespace {

// Use for ref-counting of all SharedStorageWorkletThreadSharedBackingThreadImpl
// instances in a process. Incremented by the constructor and decremented by
// destructor.
int ref_count =;

// Owns the `WorkerBackingThread`.
class SharedStorageWorkletThreadOwningBackingThreadImpl final
    : public SharedStorageWorkletThread {};

// Shares the `WorkerBackingThread` with other `SharedStorageWorkletThread`.
class SharedStorageWorkletThreadSharedBackingThreadImpl final
    : public SharedStorageWorkletThread {};

}  // namespace

// static
std::unique_ptr<SharedStorageWorkletThread> SharedStorageWorkletThread::Create(
    WorkerReportingProxy& worker_reporting_proxy) {}

SharedStorageWorkletThread::~SharedStorageWorkletThread() = default;

void SharedStorageWorkletThread::InitializeSharedStorageWorkletService(
    mojo::PendingReceiver<mojom::blink::SharedStorageWorkletService> receiver,
    base::OnceClosure disconnect_handler) {}

// static
std::optional<WorkerBackingThreadStartupData>
SharedStorageWorkletThread::CreateThreadStartupData() {}

SharedStorageWorkletThread::SharedStorageWorkletThread(
    WorkerReportingProxy& worker_reporting_proxy)
    :{}

WorkerOrWorkletGlobalScope* SharedStorageWorkletThread::CreateWorkerGlobalScope(
    std::unique_ptr<GlobalScopeCreationParams> creation_params) {}

}  // namespace blink