File: renderer_host.mojom

package info (click to toggle)
chromium 139.0.7258.127-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,122,156 kB
  • sloc: cpp: 35,100,771; 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 (45 lines) | stat: -rw-r--r-- 1,974 bytes parent folder | download | duplicates (7)
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
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module content.mojom;

// The primordial interface implemented by a render process host. This should be
// used for implementing renderer-to-browser messages.
interface RendererHost {
  // Request a histogram from the browser process. The browser will send the
  // histogram data only if it has been passed the command line flag
  // switches::kStatsCollectionController. This may or may not include
  // histograms and some or all of their data from subprocesses and other
  // sources outside the actual browser process.
  [Sync]
  GetBrowserHistogram(string name) => (string histogram_json);

  // Notify the browser that this render process can or can't be suddenly
  // terminated.
  SuddenTerminationChanged(bool enabled);

  // Sends a string to be recorded by UserMetrics.
  RecordUserMetricsAction(string action);

  // Provides this render process' private memory footprint to the browser.
  // Used by the UserLevelMemoryPressureSignalGenerator.
  //
  // In case of compromised renderer process:
  // - Reporting small values make it less likely for a memory pressure signal
  //   to be sent. This isn't a big deal, it only increase the changes the OS to
  //   start killing the renderer process.
  // - Reporting large values makes Chrome to dispatch memory pressure
  //   signal needlessly. There is a 10 minutes wait in between them. It is not
  //   particularly worrying.
  //
  // TODO(crbug.com/40248151): if the
  // UserLevelMemoryPressureSignalGenerator is approved, investigate a
  // possibility to gather data inside the browser process, via e.g.
  // getProcessMemoryInfo.
  [EnableIf=is_android]
  SetPrivateMemoryFootprint(uint64 private_memory_footprint_bytes);

  // A renderer sends this when it wants to know whether a gpu process exists.
  [Sync] HasGpuProcess() => (bool has_gpu_process);
};