1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19
   20
   21
   22
   23
   24
   25
   26
   27
   28
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67

content / public / browser / service_process_host_passkeys.h [blame]

// 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 CONTENT_PUBLIC_BROWSER_SERVICE_PROCESS_HOST_PASSKEYS_H_
#define CONTENT_PUBLIC_BROWSER_SERVICE_PROCESS_HOST_PASSKEYS_H_

#include "base/gtest_prod_util.h"
#include "base/types/pass_key.h"

namespace video_effects {
namespace mojom {
class VideoEffectsService;
}

video_effects::mojom::VideoEffectsService* GetVideoEffectsService();
}  // namespace video_effects

namespace screen_ai {
class ScreenAIServiceRouter;
}  // namespace screen_ai

class OnDeviceTranslationServiceController;

namespace content {
class VideoCaptureServiceLauncher;

class ServiceProcessHostPreloadLibraries {
 public:
  using PassKey = base::PassKey<ServiceProcessHostPreloadLibraries>;

 private:
  static PassKey GetPassKey() { return PassKey(); }

  // Service launchers using `ServiceProcessHost::Options::WithPreloadLibraries`
  // should be added here and must be reviewed by the security team.
  friend class screen_ai::ScreenAIServiceRouter;
  friend video_effects::mojom::VideoEffectsService*
  video_effects::GetVideoEffectsService();
  friend class ::OnDeviceTranslationServiceController;

  // Tests.
  FRIEND_TEST_ALL_PREFIXES(ServiceProcessHostBrowserTest,
                           PreloadLibraryPreloaded);
  FRIEND_TEST_ALL_PREFIXES(ServiceProcessHostBrowserTest,
                           PreloadLibraryMultiple);
  FRIEND_TEST_ALL_PREFIXES(ServiceProcessHostBrowserTest,
                           PreloadLibraryModName);
  FRIEND_TEST_ALL_PREFIXES(ServiceProcessHostBrowserTest,
                           PreloadLibraryBadPath);
};

class ServiceProcessHostGpuClient {
 public:
  using PassKey = base::PassKey<ServiceProcessHostGpuClient>;

 private:
  static PassKey GetPassKey() { return PassKey(); }

  // Service launchers using `ServiceProcessHost::Options::WithGpuClient`
  // should be added here and must be reviewed by the security team.
  friend class content::VideoCaptureServiceLauncher;
};

}  // namespace content

#endif  // CONTENT_PUBLIC_BROWSER_SERVICE_PROCESS_HOST_PASSKEYS_H_