| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "sandbox/mac/os_compatibility.h" | 5 #include "sandbox/mac/os_compatibility.h" |
| 6 | 6 |
| 7 #include <servers/bootstrap.h> | 7 #include <servers/bootstrap.h> |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <unistd.h> | 10 #include <unistd.h> |
| 11 | 11 |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/mac/mac_util.h" | 13 #include "base/mac/mac_util.h" |
| 14 #include "base/memory/ptr_util.h" |
| 14 #include "sandbox/mac/xpc.h" | 15 #include "sandbox/mac/xpc.h" |
| 15 | 16 |
| 16 namespace sandbox { | 17 namespace sandbox { |
| 17 | 18 |
| 18 namespace { | 19 namespace { |
| 19 | 20 |
| 20 #pragma pack(push, 4) | 21 #pragma pack(push, 4) |
| 21 // Verified from launchd-329.3.3 (10.6.8). | 22 // Verified from launchd-329.3.3 (10.6.8). |
| 22 // look_up2_reply_10_7 is the same as the 10_6 version. | 23 // look_up2_reply_10_7 is the same as the 10_6 version. |
| 23 struct look_up2_reply_10_7 { | 24 struct look_up2_reply_10_7 { |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 bool IsSwapIntegerReadOnly(const IPCMessage message) override { | 173 bool IsSwapIntegerReadOnly(const IPCMessage message) override { |
| 173 return xpc_dictionary_get_bool(message.xpc, "set") == false && | 174 return xpc_dictionary_get_bool(message.xpc, "set") == false && |
| 174 xpc_dictionary_get_uint64(message.xpc, "ingsk") == 0 && | 175 xpc_dictionary_get_uint64(message.xpc, "ingsk") == 0 && |
| 175 xpc_dictionary_get_int64(message.xpc, "in") == 0; | 176 xpc_dictionary_get_int64(message.xpc, "in") == 0; |
| 176 } | 177 } |
| 177 }; | 178 }; |
| 178 | 179 |
| 179 } // namespace | 180 } // namespace |
| 180 | 181 |
| 181 // static | 182 // static |
| 182 scoped_ptr<OSCompatibility> OSCompatibility::CreateForPlatform() { | 183 std::unique_ptr<OSCompatibility> OSCompatibility::CreateForPlatform() { |
| 183 if (base::mac::IsOSLionOrLater() && base::mac::IsOSMavericksOrEarlier()) | 184 if (base::mac::IsOSLionOrLater() && base::mac::IsOSMavericksOrEarlier()) |
| 184 return make_scoped_ptr(new OSCompatibility_10_7()); | 185 return base::WrapUnique(new OSCompatibility_10_7()); |
| 185 else | 186 else |
| 186 return make_scoped_ptr(new OSCompatibility_10_10()); | 187 return base::WrapUnique(new OSCompatibility_10_10()); |
| 187 } | 188 } |
| 188 | 189 |
| 189 OSCompatibility::~OSCompatibility() {} | 190 OSCompatibility::~OSCompatibility() {} |
| 190 | 191 |
| 191 } // namespace sandbox | 192 } // namespace sandbox |
| OLD | NEW |