File: system_signals.mojom

package info (click to toggle)
chromium 139.0.7258.138-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,120,676 kB
  • sloc: cpp: 35,100,869; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (98 lines) | stat: -rw-r--r-- 2,990 bytes parent folder | download | duplicates (9)
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module device_signals.mojom;

import "sandbox/policy/mojom/context.mojom";
import "sandbox/policy/mojom/sandbox.mojom";
import "mojo/public/mojom/base/byte_string.mojom";
import "mojo/public/mojom/base/file_path.mojom";

enum PresenceValue {
  // Was unable to determine whether the signal source exists or not. This
  // typically indicates that a failure occurred before even trying to assess
  // its presence.
  kUnspecified,

  // Unable to determine the signal source's existence due to insufficient user
  // permissions.
  kAccessDenied,

  // The signal's source does not exist.
  kNotFound,

  // The signal's source was found.
  kFound
};

struct ExecutableMetadata {
  bool is_running;
  array<mojo_base.mojom.ByteString>? public_keys_hashes;
  string? product_name;
  string? version;
  bool is_os_verified;
  string? subject_name;
};

struct FileSystemItem {
  mojo_base.mojom.FilePath file_path;
  PresenceValue presence;
  mojo_base.mojom.ByteString? sha256_hash;
  ExecutableMetadata? executable_metadata;
};

struct FileSystemItemRequest {
  mojo_base.mojom.FilePath file_path;
  bool compute_sha256;
  bool compute_executable_metadata;
};

[EnableIf=is_win]
enum AntiVirusProductState {
  // The security product software is turned on and protecting the user.
  kOn,
  // The security product software is turned off and protection is disabled.
  kOff,
  // The security product software is in the snoozed state, temporarily off,
  // and not actively protecting the computer.
  kSnoozed,
  // The security product software is expired and does not have the latest
  // updates.
  kExpired
};

[EnableIf=is_win]
struct AntiVirusSignal {
  string display_name;
  string product_id;
  AntiVirusProductState state;
};

[EnableIf=is_win]
struct HotfixSignal {
  string hotfix_id;
};

// Service in charge of collecting a specific set of device signals. The source
// of these signals is platform-specific and, in some cases (i.e. Windows), may
// need to be run a separate process.
// This service can be accessed from the browser process.
[ServiceSandbox=sandbox.mojom.Sandbox.kNoSandbox,
 RequireContext=sandbox.mojom.Context.kBrowser]
interface SystemSignalsService {
  // Collects signals about a set of file system items specified by `requests`.
  // Returns the collected information in `items`.
  GetFileSystemSignals(array<FileSystemItemRequest> requests)
    => (array<FileSystemItem> items);

  // Collects information about AntiVirus software installed on the current
  // device. Returns that information via `av_signals`.
  [EnableIf=is_win]
  GetAntiVirusSignals() => (array<AntiVirusSignal> av_signals);

  // Collects information about hotfixes that were installed on the device.
  // Returns that information via `hotfix_signals`.
  [EnableIf=is_win]
  GetHotfixSignals() => (array<HotfixSignal> hotfix_signals);
};