blob: 2193ab0f3dda5757cb2273d48fb36c6137c66e30 [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
7#include "base/fuchsia/service_directory.h"
8
9namespace cr_fuchsia {
10
11LifecycleImpl::LifecycleImpl(base::fuchsia::ServiceDirectory* service_directory,
12 base::OnceClosure on_terminate)
13 : binding_(service_directory, this),
14 on_terminate_(std::move(on_terminate)) {}
15
16LifecycleImpl::~LifecycleImpl() = default;
17
18void LifecycleImpl::Terminate() {
19 if (on_terminate_)
20 std::move(on_terminate_).Run();
21}
22
23} // namespace cr_fuchsia