OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_MAC_SCOPED_LAUNCH_DATA_H_ | 5 #ifndef BASE_MAC_SCOPED_LAUNCH_DATA_H_ |
6 #define CHROME_BROWSER_MAC_SCOPED_LAUNCH_DATA_H_ | 6 #define BASE_MAC_SCOPED_LAUNCH_DATA_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <launch.h> | 9 #include <launch.h> |
10 | 10 |
11 #include <algorithm> | 11 #include <algorithm> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
15 | 15 |
16 namespace launchd { | 16 namespace base { |
| 17 namespace mac { |
17 | 18 |
18 // Just like scoped_ptr<> but for launch_data_t. | 19 // Just like scoped_ptr<> but for launch_data_t. |
19 class ScopedLaunchData { | 20 class ScopedLaunchData { |
20 public: | 21 public: |
21 typedef launch_data_t element_type; | 22 typedef launch_data_t element_type; |
22 | 23 |
23 explicit ScopedLaunchData(launch_data_t object = NULL) | 24 explicit ScopedLaunchData(launch_data_t object = NULL) |
24 : object_(object) { | 25 : object_(object) { |
25 } | 26 } |
26 | 27 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 object_ = NULL; | 63 object_ = NULL; |
63 return temp; | 64 return temp; |
64 } | 65 } |
65 | 66 |
66 private: | 67 private: |
67 launch_data_t object_; | 68 launch_data_t object_; |
68 | 69 |
69 DISALLOW_COPY_AND_ASSIGN(ScopedLaunchData); | 70 DISALLOW_COPY_AND_ASSIGN(ScopedLaunchData); |
70 }; | 71 }; |
71 | 72 |
72 } // namespace launchd | 73 } // namespace mac |
| 74 } // namespace base |
73 | 75 |
74 #endif // CHROME_BROWSER_MAC_SCOPED_LAUNCH_DATA_H_ | 76 #endif // BASE_MAC_SCOPED_LAUNCH_DATA_H_ |
OLD | NEW |