chromium/chrome/browser/task_manager/providers/worker_task_provider.h

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

#ifndef CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WORKER_TASK_PROVIDER_H_
#define CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WORKER_TASK_PROVIDER_H_

#include <memory>

#include "base/containers/flat_map.h"
#include "base/scoped_multi_source_observation.h"
#include "base/scoped_observation.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager_observer.h"
#include "chrome/browser/profiles/profile_observer.h"
#include "chrome/browser/task_manager/providers/task_provider.h"

class ProfileManager;

namespace task_manager {

class PerProfileWorkerTaskTracker;

// This is an implementation of TaskProvider that tracks dedicated workers,
// shared workers and service workers.
//
// It doesn't directly create the tasks but instead creates an instance of
// PerProfileWorkerTaskTracker for each existing profile. These
// PerProfileWorkerTaskTracker instances are then responsible for tracking
// workers and creating/deleting tasks.

// See https://w3c.github.io/workers/ or https://w3c.github.io/ServiceWorker/
// for more details.
class WorkerTaskProvider : public TaskProvider,
                           public ProfileManagerObserver,
                           public ProfileObserver {};

}  // namespace task_manager

#endif  // CHROME_BROWSER_TASK_MANAGER_PROVIDERS_WORKER_TASK_PROVIDER_H_