getProcessInfo method

Future<Map> getProcessInfo(
  1. Object processIds,
  2. bool includeMemory
)

Retrieves the process information for each process ID specified. |processIds|: The list of process IDs or single process ID for which to return the process information. An empty list indicates all processes are requested. |includeMemory|: True if detailed memory usage is required. Note, collecting memory usage information incurs extra CPU usage and should only be queried for when needed.

Implementation

Future<Map> getProcessInfo(
  Object processIds,
  bool includeMemory,
) async {
  var $res = await promiseToFuture<JSAny>($js.chrome.processes.getProcessInfo(
    switch (processIds) {
      int() => processIds.jsify()!,
      List<int>() => processIds.toJSArray((e) => e),
      _ => throw UnsupportedError(
          'Received type: ${processIds.runtimeType}. Supported types are: int, List<int>')
    },
    includeMemory,
  ));
  return $res.toDartMap();
}