summaryrefslogtreecommitdiffstats
path: root/dom/interfaces/base/nsIRemoteTab.idl
blob: 4d1d851c2eeb1a84144619b3324ab8a2e970616b (plain)
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
99
100
101
102
103
104
105
106
107
108
109
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */


#include "domstubs.idl"

interface nsIPrincipal;
webidl Element;
webidl WindowGlobalParent;
webidl BrowsingContext;

[builtinclass, scriptable, uuid(8e49f7b0-1f98-4939-bf91-e9c39cd56434)]
interface nsIRemoteTab : nsISupports
{
  /**
   * When set to true, this tells the child to paint and upload layers to
   * the compositor. When set to false, previous layers are cleared from
   * the compositor, but only if preserveLayers is also set to false.
   */
  attribute boolean renderLayers;

  /**
   * True if layers are being rendered and the compositor has reported
   * receiving them.
   */
  readonly attribute boolean hasLayers;

  /**
   * When set to true, this priority hint indicates that the content
   * processes of this tab should be set to a higher process priority.
   */
  attribute boolean priorityHint;

  /**
   * Adjusts the tab's active state in the process priority manager,
   * allowing its process to be given a lower priority.
   */
  void deprioritize();

  /**
   * As an optimisation, setting the docshell's active state to
   * inactive also triggers a layer invalidation to free up some
   * potentially unhelpful memory usage. Calling preserveLayers
   * will cause the layers to be preserved even for inactive
   * docshells.
   */
  void preserveLayers(in boolean aPreserveLayers);

  readonly attribute uint64_t tabId;

  readonly attribute uint64_t contentProcessId;

  /**
   * The OS level process Id of the related child process.
   */
  readonly attribute int32_t osPid;

  /**
   * The toplevel BrowsingContext loaded in this remote tab.
   */
  readonly attribute BrowsingContext browsingContext;

  /**
   * True if we've previously received layers for this tab when switching to
   * it.
   */
  readonly attribute boolean hasPresented;

  /**
   * Ensures that the content process which has this remote tab has all of the
   * permissions required to load a document with the given principal.
   */
  void transmitPermissionsForPrincipal(in nsIPrincipal aPrincipal);

  /**
   * Similar to `nsIDocShell.createAboutBlankDocumentViewer` but on a remote
   * frame.  The docShell must not yet have navigated away from the initial
   * about:blank document when this method is called.
   *
   * @param aPrincipal the principal to use for the new document.
   * @param aPartitionedPrincipal the partitioned principal to use for the new
   *        document.
   */
  void createAboutBlankDocumentViewer(in nsIPrincipal aPrincipal,
                                     in nsIPrincipal aPartitionedPrincipal);

  cenum NavigationType : 8 {
    NAVIGATE_BACK = 0,
    NAVIGATE_FORWARD = 1,
    NAVIGATE_INDEX = 2,
    NAVIGATE_URL = 3
  };

  /**
   * Interrupt content scripts if possible/needed to allow chrome scripts in the
   * content process to run (in particular, to allow navigating through browser
   * history.
   */
  [implicit_jscontext, binaryname(MaybeCancelContentJSExecutionFromScript)]
  void maybeCancelContentJSExecution(
      in nsIRemoteTab_NavigationType aNavigationType,
      [optional] in jsval aCancelContentJSOptions);

  /**
   * Notify the remote tab that the resolution has changed.
   */
  [noscript] void notifyResolutionChanged();
};