[vm] Remove macOS 10.14 and iOS 12 availability checks

macOS 10.14 has been Flutter's minimum for a while, and iOS 12 is the new minimum as of https://github.com/flutter/flutter/issues/140474.

Dart has not marked these platforms as supported for an even longer time.

Supported platforms reference: https://docs.flutter.dev/reference/supported-platforms

TEST=ci

Bug: https://github.com/flutter/flutter/issues/140474
Change-Id: I12377975d9c4d57e19d486898f0fcd89a1583f7c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346920
Reviewed-by: Ryan Macnak <rmacnak@google.com>
Reviewed-by: Slava Egorov <vegorov@google.com>
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Slava Egorov <vegorov@google.com>
This commit is contained in:
Parker Lougheed 2024-01-25 08:23:51 +00:00 committed by Commit Queue
parent f04e42be46
commit 7901612ea3
5 changed files with 16 additions and 59 deletions

View file

@ -287,23 +287,13 @@ static void TrustEvaluateHandler(Dart_Port dest_port_id,
usleep(3000 * 1000 /* 3 s*/);
}
OSStatus status = noErr;
// Perform the certificate verification.
if (__builtin_available(iOS 12.0, macOS 10.14, *)) {
// SecTrustEvaluateWithError available as of OSX 10.14 and iOS 12.
// The result is ignored as we get more information from the following call
// to SecTrustGetTrustResult which also happens to match the information we
// get from calling SecTrustEvaluate.
bool res = SecTrustEvaluateWithError(trust.get(), nullptr);
USE(res);
status = SecTrustGetTrustResult(trust.get(), &trust_result);
} else {
// SecTrustEvaluate is deprecated as of OSX 10.15 and iOS 13.
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated"
status = SecTrustEvaluate(trust.get(), &trust_result);
#pragma clang diagnostic pop
}
// The result is ignored as we get more information from the following call
// to SecTrustGetTrustResult which also happens to match the information we
// got from calling SecTrustEvaluate before macOS 10.14.
bool res = SecTrustEvaluateWithError(trust.get(), nullptr);
USE(res);
OSStatus status = SecTrustGetTrustResult(trust.get(), &trust_result);
postReply(reply_port_id,
status == noErr && (trust_result == kSecTrustResultProceed ||

View file

@ -95,25 +95,8 @@ int64_t OS::GetCurrentMonotonicMicros() {
}
int64_t OS::GetCurrentThreadCPUMicros() {
if (__builtin_available(macOS 10.12, iOS 10.0, *)) {
// This is more efficient when available.
return clock_gettime_nsec_np(CLOCK_THREAD_CPUTIME_ID) /
kNanosecondsPerMicrosecond;
}
mach_msg_type_number_t count = THREAD_BASIC_INFO_COUNT;
thread_basic_info_data_t info_data;
thread_basic_info_t info = &info_data;
mach_port_t thread_port = pthread_mach_thread_np(pthread_self());
kern_return_t r =
thread_info(thread_port, THREAD_BASIC_INFO, (thread_info_t)info, &count);
ASSERT(r == KERN_SUCCESS);
int64_t thread_cpu_micros =
(info->system_time.seconds + info->user_time.seconds);
thread_cpu_micros *= kMicrosecondsPerSecond;
thread_cpu_micros += info->user_time.microseconds;
thread_cpu_micros += info->system_time.microseconds;
return thread_cpu_micros;
return clock_gettime_nsec_np(CLOCK_THREAD_CPUTIME_ID) /
kNanosecondsPerMicrosecond;
}
int64_t OS::GetCurrentMonotonicMicrosForTimeline() {

View file

@ -167,9 +167,7 @@ static TimelineEventRecorder* CreateTimelineRecorder() {
#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_ANDROID)
return new TimelineEventSystraceRecorder();
#elif defined(DART_HOST_OS_MACOS)
if (__builtin_available(iOS 12.0, macOS 10.14, *)) {
return new TimelineEventMacosRecorder();
}
return new TimelineEventMacosRecorder();
#elif defined(DART_HOST_OS_FUCHSIA)
return new TimelineEventFuchsiaRecorder();
#else
@ -1076,10 +1074,8 @@ TimelineStream::TimelineStream(const char* name,
#endif
{
#if defined(DART_HOST_OS_MACOS)
if (__builtin_available(iOS 12.0, macOS 10.14, *)) {
macos_log_ = os_log_create("Dart", name);
has_static_labels_ = has_static_labels;
}
macos_log_ = os_log_create("Dart", name);
has_static_labels_ = has_static_labels;
#endif
}

View file

@ -30,17 +30,8 @@
#include <lib/trace-engine/context.h>
#include <lib/trace-engine/instrumentation.h>
#elif defined(DART_HOST_OS_MACOS)
#include <os/availability.h>
#if defined(__MAC_10_14) || defined (__IPHONE_12_0)
#define DART_HOST_OS_SUPPORTS_SIGNPOST 1
#endif
// signpost.h exists in macOS 10.14, iOS 12 or above
#if defined(DART_HOST_OS_SUPPORTS_SIGNPOST)
#include <os/signpost.h>
#else
#include <os/log.h>
#endif
#endif
#endif // defined(FUCHSIA_SDK) || defined(DART_HOST_OS_FUCHSIA)
namespace dart {
@ -1248,18 +1239,18 @@ class TimelineEventSystraceRecorder : public TimelineEventPlatformRecorder {
#endif // defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_LINUX)
#if defined(DART_HOST_OS_MACOS)
// A recorder that sends events to Macos's tracing app. See:
// A recorder that sends events to macOS's tracing app. See:
// https://developer.apple.com/documentation/os/logging?language=objc
class TimelineEventMacosRecorder : public TimelineEventPlatformRecorder {
public:
TimelineEventMacosRecorder() API_AVAILABLE(ios(12.0), macos(10.14));
virtual ~TimelineEventMacosRecorder() API_AVAILABLE(ios(12.0), macos(10.14));
TimelineEventMacosRecorder();
virtual ~TimelineEventMacosRecorder();
const char* name() const { return MACOS_RECORDER_NAME; }
intptr_t Size() { return 0; }
private:
void OnEvent(TimelineEvent* event) API_AVAILABLE(ios(12.0), macos(10.14));
void OnEvent(TimelineEvent* event);
};
#endif // defined(DART_HOST_OS_MACOS)

View file

@ -10,7 +10,6 @@
namespace dart {
// Only available on iOS 12.0, macOS 10.14 or above
TimelineEventMacosRecorder::TimelineEventMacosRecorder()
: TimelineEventPlatformRecorder() {
Timeline::set_recorder_discards_clock_values(true);
@ -23,7 +22,6 @@ void TimelineEventMacosRecorder::OnEvent(TimelineEvent* event) {
return;
}
#if defined(DART_HOST_OS_SUPPORTS_SIGNPOST)
os_log_t log = event->stream_->macos_log();
if (!os_signpost_enabled(log)) {
return;
@ -72,7 +70,6 @@ void TimelineEventMacosRecorder::OnEvent(TimelineEvent* event) {
default:
break;
}
#endif // defined(DART_HOST_OS_SUPPORTS_SIGNPOST)
}
} // namespace dart