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

Unified Diff: sandbox/mac/os_compatibility.cc

Issue 1853713004: mac: Remove some 10.6-SDK-only sandbox code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/mac/bootstrap_sandbox_unittest.mm ('k') | sandbox/mac/sandbox_mac.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/mac/os_compatibility.cc
diff --git a/sandbox/mac/os_compatibility.cc b/sandbox/mac/os_compatibility.cc
index 5ddf6a5d03ec9c973e98ffb754e64b089daf1252..5275a4ad61ff9dadf6d3a47d51e8702a153e0773 100644
--- a/sandbox/mac/os_compatibility.cc
+++ b/sandbox/mac/os_compatibility.cc
@@ -18,15 +18,8 @@ namespace {
#pragma pack(push, 4)
// Verified from launchd-329.3.3 (10.6.8).
-struct look_up2_request_10_6 {
- mach_msg_header_t Head;
- NDR_record_t NDR;
- name_t servicename;
- pid_t targetpid;
- uint64_t flags;
-};
-
-struct look_up2_reply_10_6 {
+// look_up2_reply_10_7 is the same as the 10_6 version.
+struct look_up2_reply_10_7 {
mach_msg_header_t Head;
mach_msg_body_t msgh_body;
mach_msg_port_descriptor_t service_port;
@@ -45,15 +38,13 @@ struct look_up2_request_10_7 {
uint64_t flags;
};
-// look_up2_reply_10_7 is the same as the 10_6 version.
-
// Verified from:
// launchd-329.3.3 (10.6.8)
// launchd-392.39 (10.7.5)
// launchd-442.26.2 (10.8.5)
// launchd-842.1.4 (10.9.0)
typedef int vproc_gsk_t; // Defined as an enum in liblaunch/vproc_priv.h.
-struct swap_integer_request_10_6 {
+struct swap_integer_request_10_7 {
mach_msg_header_t Head;
NDR_record_t NDR;
vproc_gsk_t inkey;
@@ -72,10 +63,10 @@ size_t strnlen(const char* str, size_t maxlen) {
return len;
}
-class OSCompatibility_10_6 : public OSCompatibility {
+class OSCompatibility_10_7 : public OSCompatibility {
public:
- OSCompatibility_10_6() {}
- ~OSCompatibility_10_6() override {}
+ OSCompatibility_10_7() {}
+ ~OSCompatibility_10_7() override {}
uint64_t GetMessageSubsystem(const IPCMessage message) override {
return (message.mach->msgh_id / 100) * 100;
@@ -98,12 +89,12 @@ class OSCompatibility_10_6 : public OSCompatibility {
}
std::string GetServiceLookupName(const IPCMessage message) override {
- return GetRequestName<look_up2_request_10_6>(message);
+ return GetRequestName<look_up2_request_10_7>(message);
}
void WriteServiceLookUpReply(IPCMessage message,
mach_port_t service_port) override {
- auto reply = reinterpret_cast<look_up2_reply_10_6*>(message.mach);
+ auto reply = reinterpret_cast<look_up2_reply_10_7*>(message.mach);
reply->Head.msgh_size = sizeof(*reply);
reply->Head.msgh_bits =
MACH_MSGH_BITS_REMOTE(MACH_MSG_TYPE_MOVE_SEND_ONCE) |
@@ -116,7 +107,7 @@ class OSCompatibility_10_6 : public OSCompatibility {
bool IsSwapIntegerReadOnly(const IPCMessage message) override {
auto request =
- reinterpret_cast<const swap_integer_request_10_6*>(message.mach);
+ reinterpret_cast<const swap_integer_request_10_7*>(message.mach);
return request->inkey == 0 && request->inval == 0 && request->outkey != 0;
}
@@ -136,16 +127,6 @@ class OSCompatibility_10_6 : public OSCompatibility {
}
};
-class OSCompatibility_10_7 : public OSCompatibility_10_6 {
- public:
- OSCompatibility_10_7() {}
- ~OSCompatibility_10_7() override {}
-
- std::string GetServiceLookupName(const IPCMessage message) override {
- return GetRequestName<look_up2_request_10_7>(message);
- }
-};
-
class OSCompatibility_10_10 : public OSCompatibility {
public:
OSCompatibility_10_10() {}
@@ -198,9 +179,7 @@ class OSCompatibility_10_10 : public OSCompatibility {
// static
scoped_ptr<OSCompatibility> OSCompatibility::CreateForPlatform() {
- if (base::mac::IsOSSnowLeopard())
- return make_scoped_ptr(new OSCompatibility_10_6());
- else if (base::mac::IsOSLionOrLater() && base::mac::IsOSMavericksOrEarlier())
+ if (base::mac::IsOSLionOrLater() && base::mac::IsOSMavericksOrEarlier())
return make_scoped_ptr(new OSCompatibility_10_7());
else
return make_scoped_ptr(new OSCompatibility_10_10());
« no previous file with comments | « sandbox/mac/bootstrap_sandbox_unittest.mm ('k') | sandbox/mac/sandbox_mac.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698