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

Side by Side Diff: sandbox/mac/os_compatibility.cc

Issue 1849323003: Convert //sandbox to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixup nonsfi_sandbox_unittest.cc Created 4 years, 8 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 | « sandbox/mac/os_compatibility.h ('k') | sandbox/mac/xpc_message_server.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « sandbox/mac/os_compatibility.h ('k') | sandbox/mac/xpc_message_server.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698