1// Copyright (c) 2012 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#ifndef BASE_MAC_SCOPED_LAUNCH_DATA_H_
6#define BASE_MAC_SCOPED_LAUNCH_DATA_H_
7
8#include <launch.h>
9
10#include "base/scoped_generic.h"
11
12namespace base {
13namespace mac {
14
15namespace internal {
16
17struct ScopedLaunchDataTraits {
18  static launch_data_t InvalidValue() { return nullptr; }
19  static void Free(launch_data_t ldt) { launch_data_free(ldt); }
20};
21
22}  // namespace internal
23
24// Just like scoped_ptr<> but for launch_data_t.
25using ScopedLaunchData =
26    ScopedGeneric<launch_data_t, internal::ScopedLaunchDataTraits>;
27
28}  // namespace mac
29}  // namespace base
30
31#endif  // BASE_MAC_SCOPED_LAUNCH_DATA_H_
32