summaryrefslogtreecommitdiff
path: root/chromium/base/fuchsia/default_job.cc
blob: 366b14f6575d1097318d2d20c551e4874766cfe6 (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
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/fuchsia/default_job.h"

#include <zircon/process.h>

#include "base/logging.h"

namespace base {

namespace {
zx_handle_t g_job = ZX_HANDLE_INVALID;
}  // namespace

zx_handle_t GetDefaultJob() {
  if (g_job == ZX_HANDLE_INVALID)
    return zx_job_default();
  return g_job;
}

void SetDefaultJob(ScopedZxHandle job) {
  DCHECK_EQ(ZX_HANDLE_INVALID, g_job);
  g_job = job.release();
}

}  // namespace base