blob: f8f635befa40c2a42259c95d2dad7ee5dc22ffbc [file] [log] [blame]
Wez500d4432019-03-08 18:12:491// Copyright 2019 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "fuchsia/base/lifecycle_impl.h"
6
Wez500d4432019-03-08 18:12:497namespace cr_fuchsia {
8
Sharon Yang461c3ac82019-08-22 21:05:209LifecycleImpl::LifecycleImpl(sys::OutgoingDirectory* outgoing_directory,
Wez500d4432019-03-08 18:12:4910 base::OnceClosure on_terminate)
Sharon Yang461c3ac82019-08-22 21:05:2011 : binding_(outgoing_directory, this),
Wez500d4432019-03-08 18:12:4912 on_terminate_(std::move(on_terminate)) {}
13
14LifecycleImpl::~LifecycleImpl() = default;
15
16void LifecycleImpl::Terminate() {
17 if (on_terminate_)
18 std::move(on_terminate_).Run();
19}
20
21} // namespace cr_fuchsia