Wez | 500d443 | 2019-03-08 18:12:49 | [diff] [blame^] | 1 | // 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 | |
| 9 | namespace cr_fuchsia { |
| 10 | |
| 11 | LifecycleImpl::LifecycleImpl(base::fuchsia::ServiceDirectory* service_directory, |
| 12 | base::OnceClosure on_terminate) |
| 13 | : binding_(service_directory, this), |
| 14 | on_terminate_(std::move(on_terminate)) {} |
| 15 | |
| 16 | LifecycleImpl::~LifecycleImpl() = default; |
| 17 | |
| 18 | void LifecycleImpl::Terminate() { |
| 19 | if (on_terminate_) |
| 20 | std::move(on_terminate_).Run(); |
| 21 | } |
| 22 | |
| 23 | } // namespace cr_fuchsia |