summaryrefslogtreecommitdiffstats
path: root/toolkit/modules/nsIE10SUtils.idl
blob: 39fc58a9891b0c6dc7656993980d3ef52d329abf (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
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 *
 * 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 "nsISupports.idl"

interface nsIPrincipal;
interface nsIURI;

/**
 * C++ exposed interface for the `E10SUtils` object from the
 * `resource://gre/modules/E10SUtils.jsm` module.
 */
[scriptable, uuid(1e18680e-052d-4509-a17e-678f5c495e02)]
interface nsIE10SUtils : nsISupports {
  cenum RemoteWorkerType: 8 {
    REMOTE_WORKER_TYPE_SHARED,
    REMOTE_WORKER_TYPE_SERVICE,
  };

  /**
   * Determine what remote type should be used to load a document with the given
   * principal.
   *
   * @param aPrincipal  The result principal for the document being loaded.
   * @param aChannelOriginalURI. The original URI being loaded
   *                             (which isn't always the same as the Principal's
   *                              URI)
   * @param aMultiProcess  Does the browser have remote tabs enabled.
   * @param aRemoteSubframes  Does the browser have remote subframes enabled.
   * @param aPreferredRemoteType  If multiple remote types are compatible with
   *                              the load, prefer staying in this remote type.
   * @param aCurrentPrincipal  The principal of the currently loaded document.
   * @param aIsSubframe  Is the process switch occuring in a subframe.
   *
   * @return  The remote type to complete this load in.
   */
  AUTF8String getRemoteTypeForPrincipal(in nsIPrincipal aPrincipal,
                                        in nsIURI aChannelOriginalURI,
                                        in boolean aMultiProcess,
                                        in boolean aRemoteSubframes,
                                        in AUTF8String aPreferredRemoteType,
                                        in nsIPrincipal aCurrentPrincipal,
                                        in boolean aIsSubframe);

  /**
   * Determine what remote type should be used to launch a worker script with
   * the given principal.
   *
   * @param aPrincipal  
   *   The result principal for the document being loaded.
   * @param aWorkerTypeName
   *   The type of remote worker being launched (Ci.nsIE10SUtils.REMOTE_WORKER_TYPE_*).
   * @param aIsMultiProcess
   *   A boolean to indicate if e10s enabled.
   * @param aIsFission
   *   A boolean to indicate if fission is enabled.
   * @param aPreferredRemoteType
   *   If multiple remote types are compatible with the worker,
   *   prefer staying in this remote type.
   *
   * @return  The remote type to launch the worker in.
   */
  AUTF8String getRemoteTypeForWorkerPrincipal(in nsIPrincipal aPrincipal,
                                              in nsIE10SUtils_RemoteWorkerType aWorkerType,
                                              in boolean aIsMultiProcess,
                                              in boolean aIsFission,
                                              in AUTF8String aPreferredRemoteType);
};