blob: da62006bfb25367767cdd95737d3d4aed274e8a4 [file] [log] [blame]
[email protected]fd1c9312012-03-29 16:57:531// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]8b5ad7f2011-06-30 17:58:152// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]fd1c9312012-03-29 16:57:535#ifndef BASE_MAC_SCOPED_LAUNCH_DATA_H_
6#define BASE_MAC_SCOPED_LAUNCH_DATA_H_
[email protected]8b5ad7f2011-06-30 17:58:157
8#include <launch.h>
9
Robert Sesekcfd6ed562016-01-04 17:43:0010#include "base/scoped_generic.h"
[email protected]8b5ad7f2011-06-30 17:58:1511
[email protected]fd1c9312012-03-29 16:57:5312namespace base {
13namespace mac {
[email protected]8b5ad7f2011-06-30 17:58:1514
Robert Sesekcfd6ed562016-01-04 17:43:0015namespace internal {
[email protected]8b5ad7f2011-06-30 17:58:1516
Robert Sesekcfd6ed562016-01-04 17:43:0017struct ScopedLaunchDataTraits {
18 static launch_data_t InvalidValue() { return nullptr; }
19 static void Free(launch_data_t ldt) { launch_data_free(ldt); }
[email protected]8b5ad7f2011-06-30 17:58:1520};
21
Robert Sesekcfd6ed562016-01-04 17:43:0022} // namespace internal
23
24// Just like scoped_ptr<> but for launch_data_t.
25using ScopedLaunchData =
26 ScopedGeneric<launch_data_t, internal::ScopedLaunchDataTraits>;
27
[email protected]fd1c9312012-03-29 16:57:5328} // namespace mac
29} // namespace base
[email protected]8b5ad7f2011-06-30 17:58:1530
[email protected]fd1c9312012-03-29 16:57:5331#endif // BASE_MAC_SCOPED_LAUNCH_DATA_H_