[email protected] | fd1c931 | 2012-03-29 16:57:53 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
[email protected] | 8b5ad7f | 2011-06-30 17:58:15 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
3 | // found in the LICENSE file. | ||||
4 | |||||
[email protected] | fd1c931 | 2012-03-29 16:57:53 | [diff] [blame] | 5 | #ifndef BASE_MAC_SCOPED_LAUNCH_DATA_H_ |
6 | #define BASE_MAC_SCOPED_LAUNCH_DATA_H_ | ||||
[email protected] | 8b5ad7f | 2011-06-30 17:58:15 | [diff] [blame] | 7 | |
8 | #include <launch.h> | ||||
9 | |||||
Robert Sesek | cfd6ed56 | 2016-01-04 17:43:00 | [diff] [blame] | 10 | #include "base/scoped_generic.h" |
[email protected] | 8b5ad7f | 2011-06-30 17:58:15 | [diff] [blame] | 11 | |
[email protected] | fd1c931 | 2012-03-29 16:57:53 | [diff] [blame] | 12 | namespace base { |
13 | namespace mac { | ||||
[email protected] | 8b5ad7f | 2011-06-30 17:58:15 | [diff] [blame] | 14 | |
Robert Sesek | cfd6ed56 | 2016-01-04 17:43:00 | [diff] [blame] | 15 | namespace internal { |
[email protected] | 8b5ad7f | 2011-06-30 17:58:15 | [diff] [blame] | 16 | |
Robert Sesek | cfd6ed56 | 2016-01-04 17:43:00 | [diff] [blame] | 17 | struct ScopedLaunchDataTraits { |
18 | static launch_data_t InvalidValue() { return nullptr; } | ||||
19 | static void Free(launch_data_t ldt) { launch_data_free(ldt); } | ||||
[email protected] | 8b5ad7f | 2011-06-30 17:58:15 | [diff] [blame] | 20 | }; |
21 | |||||
Robert Sesek | cfd6ed56 | 2016-01-04 17:43:00 | [diff] [blame] | 22 | } // namespace internal |
23 | |||||
24 | // Just like scoped_ptr<> but for launch_data_t. | ||||
25 | using ScopedLaunchData = | ||||
26 | ScopedGeneric<launch_data_t, internal::ScopedLaunchDataTraits>; | ||||
27 | |||||
[email protected] | fd1c931 | 2012-03-29 16:57:53 | [diff] [blame] | 28 | } // namespace mac |
29 | } // namespace base | ||||
[email protected] | 8b5ad7f | 2011-06-30 17:58:15 | [diff] [blame] | 30 | |
[email protected] | fd1c931 | 2012-03-29 16:57:53 | [diff] [blame] | 31 | #endif // BASE_MAC_SCOPED_LAUNCH_DATA_H_ |