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 12 namespace base { 13 namespace mac { 14 15 namespace internal { 16 17 struct ScopedLaunchDataTraits { InvalidValueScopedLaunchDataTraits18 static launch_data_t InvalidValue() { return nullptr; } FreeScopedLaunchDataTraits19 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. 25 using 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