Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Side by Side Diff: base/mac/scoped_launch_data.h

Issue 981803004: 10.10 compatibility for base::mac::ScopedLaunchData (Closed) Base URL: https://chromium.googlesource.com/chromium/mini_chromium@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 MINI_CHROMIUM_BASE_MAC_SCOPED_LAUNCH_DATA_H_ 5 #ifndef MINI_CHROMIUM_BASE_MAC_SCOPED_LAUNCH_DATA_H_
6 #define MINI_CHROMIUM_BASE_MAC_SCOPED_LAUNCH_DATA_H_ 6 #define MINI_CHROMIUM_BASE_MAC_SCOPED_LAUNCH_DATA_H_
7 7
8 #include <launch.h> 8 #include <launch.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
11 11
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 14
15 namespace {
16
17 inline void LaunchDataFree(launch_data_t data) {
18 #pragma clang diagnostic push
19 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
20 return launch_data_free(data);
21 #pragma clang diagnostic pop
22 }
23
24 } // namespace
25
15 namespace base { 26 namespace base {
16 namespace mac { 27 namespace mac {
17 28
18 // Just like scoped_ptr<> but for launch_data_t. 29 // Just like scoped_ptr<> but for launch_data_t.
19 class ScopedLaunchData { 30 class ScopedLaunchData {
20 public: 31 public:
21 typedef launch_data_t element_type; 32 typedef launch_data_t element_type;
22 33
23 explicit ScopedLaunchData(launch_data_t object = NULL) 34 explicit ScopedLaunchData(launch_data_t object = NULL)
24 : object_(object) { 35 : object_(object) {
25 } 36 }
26 37
27 ~ScopedLaunchData() { 38 ~ScopedLaunchData() {
28 if (object_) 39 if (object_)
29 launch_data_free(object_); 40 LaunchDataFree(object_);
30 } 41 }
31 42
32 void reset(launch_data_t object = NULL) { 43 void reset(launch_data_t object = NULL) {
33 if (object != object_) { 44 if (object != object_) {
34 if (object_) 45 if (object_)
35 launch_data_free(object_); 46 LaunchDataFree(object_);
36 object_ = object; 47 object_ = object;
37 } 48 }
38 } 49 }
39 50
40 bool operator==(launch_data_t that) const { 51 bool operator==(launch_data_t that) const {
41 return object_ == that; 52 return object_ == that;
42 } 53 }
43 54
44 bool operator!=(launch_data_t that) const { 55 bool operator!=(launch_data_t that) const {
45 return object_ != that; 56 return object_ != that;
(...skipping 20 matching lines...) Expand all
66 private: 77 private:
67 launch_data_t object_; 78 launch_data_t object_;
68 79
69 DISALLOW_COPY_AND_ASSIGN(ScopedLaunchData); 80 DISALLOW_COPY_AND_ASSIGN(ScopedLaunchData);
70 }; 81 };
71 82
72 } // namespace mac 83 } // namespace mac
73 } // namespace base 84 } // namespace base
74 85
75 #endif // MINI_CHROMIUM_BASE_MAC_SCOPED_LAUNCH_DATA_H_ 86 #endif // MINI_CHROMIUM_BASE_MAC_SCOPED_LAUNCH_DATA_H_
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698