summaryrefslogtreecommitdiff
path: root/chromium/fuchsia/base/lifecycle_impl.cc
blob: f8f635befa40c2a42259c95d2dad7ee5dc22ffbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Copyright 2019 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 "fuchsia/base/lifecycle_impl.h"

namespace cr_fuchsia {

LifecycleImpl::LifecycleImpl(sys::OutgoingDirectory* outgoing_directory,
                             base::OnceClosure on_terminate)
    : binding_(outgoing_directory, this),
      on_terminate_(std::move(on_terminate)) {}

LifecycleImpl::~LifecycleImpl() = default;

void LifecycleImpl::Terminate() {
  if (on_terminate_)
    std::move(on_terminate_).Run();
}

}  // namespace cr_fuchsia