File: renderer_configuration.mojom

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 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 (94 lines) | stat: -rw-r--r-- 3,986 bytes parent folder | download | duplicates (6)
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
// Copyright 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

module chrome.mojom;

import "components/content_settings/common/content_settings_manager.mojom";
import "components/content_settings/core/common/content_settings.mojom";
import "mojo/public/mojom/base/time.mojom";
import "url/mojom/url.mojom";

// Renderer configuration for a bound session.
// Network requests with `domain` and that are on `path` require a short lived
// cookie that would expire at `cookie_expiry_date`. Renderer throtller relies
// on `BoundSessionThrottlerParams` to defer a request when required.
// `BoundSessionThrottlerParams` can change when a bound session is created,
// terminated or on cookie expiration change.
[EnableIf=enable_bound_session_credentials]
struct BoundSessionThrottlerParams {
  string domain;
  string path;
  mojo_base.mojom.Time cookie_expiry_date;
};

// The renderer configuration parameters which can change post renderer launch.
struct DynamicParams {
  // `BoundSessionThrottlerParams` can be empty if there are no bound sessions.
  [EnableIf=enable_bound_session_credentials]
  array<BoundSessionThrottlerParams> bound_session_throttler_params;
  bool force_safe_search = true;
  int32 youtube_restrict = 0;
  string allowed_domains_for_apps;
};

// Event triggering release of blocked requests.
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
[EnableIf=enable_bound_session_credentials]
enum ResumeBlockedRequestsTrigger {
  kObservedFreshCookies = 0,
  kCookieRefreshFetchSuccess = 1,
  kCookieRefreshFetchFailure = 2,
  // kNetworkConnectionOffline = 3, Deprecated
  kTimeout = 4,
  kShutdownOrSessionTermination = 5,
  kCookieAlreadyFresh = 6,
  kRendererDisconnected = 7,
  kThrottlingRequestsPaused = 8,
};

// Allows the renderer to notify the browser process that requests in renderer
// are throttled and require a fresh short lived cookie.
interface BoundSessionRequestThrottledHandler {
  // Called to notify the browser process when a network request requires a
  // fresh cookie. This triggers a cookie refresh request and will
  // run the callback to release the request upon success, failure or timeout.
  // |untrusted_request_url| is used to determine which bound sessions cover
  // the request.
  // TODO(crbug.com/41495201): Remove this interface when DBSC is migrated to
  // the network stack.
  [EnableIf=enable_bound_session_credentials]
  HandleRequestBlockedOnCookie(url.mojom.Url untrusted_request_url)
      => (ResumeBlockedRequestsTrigger resume_trigger);
};

interface ChromeOSListener {
  // Call when the merge session process (cookie reconstruction from
  // OAuth2 refresh token in ChromeOS login) is complete. All XHR's
  // will be throttled until unlocked by this call.
  [EnableIf=is_chromeos]
  MergeSessionComplete();
};

// Configures the renderer.
interface RendererConfiguration {
  // Configures the renderer with settings that won't change.
  // The |chromeos_listener| is only passed on Chrome OS when
  // the merge session is still running - otherwise not set.
  // |content_settings_manager| may be sent as an optimization to avoid
  // requesting it from the browser process, and may be null.
  // |bound_session_request_throttled_handler| is passed only if the buildflag
  // `enable_bound_session_credentials` is enabled. It can be null if bound
  // sessions are not supported yet for the current profile type.
  SetInitialConfiguration(
      bool is_incognito_process,
      pending_receiver<ChromeOSListener>? chromeos_listener,
      pending_remote<content_settings.mojom.ContentSettingsManager>?
          content_settings_manager,
      pending_remote<BoundSessionRequestThrottledHandler>?
          bound_session_request_throttled_handler);

  // Update renderer configuration with settings that can change.
  SetConfiguration(DynamicParams params);
};