diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-10-26 13:57:00 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-11-02 11:31:01 +0000 |
commit | 1943b3c2a1dcee36c233724fc4ee7613d71b9cf6 (patch) | |
tree | 8c1b5f12357025c197da5427ae02cfdc2f3570d6 /chromium/base/mac | |
parent | 21ba0c5d4bf8fba15dddd97cd693bad2358b77fd (diff) |
BASELINE: Update Chromium to 94.0.4606.111
Change-Id: I924781584def20fc800bedf6ff41fdb96c438193
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/base/mac')
-rw-r--r-- | chromium/base/mac/authorization_util.mm | 11 | ||||
-rw-r--r-- | chromium/base/mac/foundation_util.h | 1 | ||||
-rw-r--r-- | chromium/base/mac/foundation_util.mm | 4 | ||||
-rw-r--r-- | chromium/base/mac/foundation_util_unittest.mm | 2 | ||||
-rw-r--r-- | chromium/base/mac/mac_util.h | 20 | ||||
-rw-r--r-- | chromium/base/mac/mac_util.mm | 10 | ||||
-rw-r--r-- | chromium/base/mac/mac_util_unittest.mm | 36 | ||||
-rw-r--r-- | chromium/base/mac/os_crash_dumps.cc | 2 | ||||
-rw-r--r-- | chromium/base/mac/scoped_dispatch_object.h | 2 | ||||
-rw-r--r-- | chromium/base/mac/scoped_ioobject.h | 2 |
10 files changed, 58 insertions, 32 deletions
diff --git a/chromium/base/mac/authorization_util.mm b/chromium/base/mac/authorization_util.mm index cc5487b28ee..872a79bcc35 100644 --- a/chromium/base/mac/authorization_util.mm +++ b/chromium/base/mac/authorization_util.mm @@ -10,15 +10,16 @@ #include <string> +#include "base/cxx17_backports.h" #include "base/logging.h" #include "base/mac/bundle_locations.h" #include "base/mac/foundation_util.h" #include "base/mac/mac_logging.h" #include "base/mac/scoped_authorizationref.h" #include "base/posix/eintr_wrapper.h" -#include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_util.h" +#include "base/threading/hang_watcher.h" namespace base { namespace mac { @@ -37,6 +38,14 @@ AuthorizationRef GetAuthorizationRightsWithPrompt( return NULL; } + // Never consider the current WatchHangsInScope as hung. There was most likely + // one created in ThreadControllerWithMessagePumpImpl::DoWork(). The current + // hang watching deadline is not valid since the user can take unbounded time + // to answer the password prompt. HangWatching will resume when the next task + // or event is pumped in MessagePumpCFRunLoop so there is not need to + // reactivate it. You can see the function comments for more details. + base::HangWatcher::InvalidateActiveExpectations(); + AuthorizationFlags flags = kAuthorizationFlagDefaults | kAuthorizationFlagInteractionAllowed | kAuthorizationFlagExtendRights | diff --git a/chromium/base/mac/foundation_util.h b/chromium/base/mac/foundation_util.h index 8d2f33a3a9f..25fd5e8e8e2 100644 --- a/chromium/base/mac/foundation_util.h +++ b/chromium/base/mac/foundation_util.h @@ -9,7 +9,6 @@ #include <CoreFoundation/CoreFoundation.h> #include <string> -#include <vector> #include "base/base_export.h" #include "base/logging.h" diff --git a/chromium/base/mac/foundation_util.mm b/chromium/base/mac/foundation_util.mm index e63f0ec0e2e..89818822c34 100644 --- a/chromium/base/mac/foundation_util.mm +++ b/chromium/base/mac/foundation_util.mm @@ -8,6 +8,9 @@ #include <stdlib.h> #include <string.h> +#include <vector> + +#include "base/cxx17_backports.h" #include "base/files/file_path.h" #include "base/logging.h" #include "base/mac/bundle_locations.h" @@ -15,7 +18,6 @@ #include "base/notreached.h" #include "base/numerics/checked_math.h" #include "base/numerics/safe_conversions.h" -#include "base/stl_util.h" #include "base/strings/sys_string_conversions.h" #include "build/branding_buildflags.h" #include "build/build_config.h" diff --git a/chromium/base/mac/foundation_util_unittest.mm b/chromium/base/mac/foundation_util_unittest.mm index 677264b2b82..40117cc7c73 100644 --- a/chromium/base/mac/foundation_util_unittest.mm +++ b/chromium/base/mac/foundation_util_unittest.mm @@ -8,10 +8,10 @@ #include <stddef.h> #include "base/compiler_specific.h" +#include "base/cxx17_backports.h" #include "base/files/file_path.h" #include "base/format_macros.h" #include "base/mac/scoped_cftyperef.h" -#include "base/stl_util.h" #include "base/strings/stringprintf.h" #include "build/build_config.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/chromium/base/mac/mac_util.h b/chromium/base/mac/mac_util.h index 23c46c62145..8b15b9554ef 100644 --- a/chromium/base/mac/mac_util.h +++ b/chromium/base/mac/mac_util.h @@ -117,9 +117,6 @@ BASE_EXPORT int MacOSVersion(); return internal::MacOSVersion() >= 1000 + V; \ } -// TODO(https://crbug.com/1105187): Update MAC_OS_X_VERSION_MIN_REQUIRED to -// whatever macro it turns into in the future. - #define DEFINE_IS_OS_FUNCS_CR_MIN_REQUIRED(V, DEPLOYMENT_TARGET_TEST) \ inline bool IsOS##V() { \ DEPLOYMENT_TARGET_TEST(>, V, false) \ @@ -161,21 +158,22 @@ DEFINE_OLD_IS_OS_FUNCS_CR_MIN_REQUIRED(11, OLD_TEST_DEPLOYMENT_TARGET) DEFINE_OLD_IS_OS_FUNCS(12, OLD_TEST_DEPLOYMENT_TARGET) DEFINE_OLD_IS_OS_FUNCS(13, OLD_TEST_DEPLOYMENT_TARGET) DEFINE_OLD_IS_OS_FUNCS(14, OLD_TEST_DEPLOYMENT_TARGET) +DEFINE_OLD_IS_OS_FUNCS(15, OLD_TEST_DEPLOYMENT_TARGET) // Versions of macOS supported at runtime and whose SDK is supported for // building. -#ifdef MAC_OS_X_VERSION_10_15 -DEFINE_OLD_IS_OS_FUNCS(15, OLD_TEST_DEPLOYMENT_TARGET) -#else -DEFINE_OLD_IS_OS_FUNCS(15, IGNORE_DEPLOYMENT_TARGET) -#endif - #ifdef MAC_OS_VERSION_11_0 DEFINE_IS_OS_FUNCS(11, TEST_DEPLOYMENT_TARGET) #else DEFINE_IS_OS_FUNCS(11, IGNORE_DEPLOYMENT_TARGET) #endif +#ifdef MAC_OS_VERSION_12_0 +DEFINE_IS_OS_FUNCS(12, TEST_DEPLOYMENT_TARGET) +#else +DEFINE_IS_OS_FUNCS(12, IGNORE_DEPLOYMENT_TARGET) +#endif + #undef DEFINE_OLD_IS_OS_FUNCS_CR_MIN_REQUIRED #undef DEFINE_OLD_IS_OS_FUNCS #undef DEFINE_IS_OS_FUNCS_CR_MIN_REQUIRED @@ -187,8 +185,8 @@ DEFINE_IS_OS_FUNCS(11, IGNORE_DEPLOYMENT_TARGET) // This should be infrequently used. It only makes sense to use this to avoid // codepaths that are very likely to break on future (unreleased, untested, // unborn) OS releases, or to log when the OS is newer than any known version. -inline bool IsOSLaterThan11_DontCallThis() { - return !IsAtMostOS11(); +inline bool IsOSLaterThan12_DontCallThis() { + return !IsAtMostOS12(); } enum class CPUType { diff --git a/chromium/base/mac/mac_util.mm b/chromium/base/mac/mac_util.mm index 7c7c3e8b7f1..0deb44d73ca 100644 --- a/chromium/base/mac/mac_util.mm +++ b/chromium/base/mac/mac_util.mm @@ -78,8 +78,11 @@ class LoginItemsFileList { reinterpret_cast<LSSharedFileListItemRef>(login_item); #pragma clang diagnostic push // https://crbug.com/1154377 #pragma clang diagnostic ignored "-Wdeprecated-declarations" - ScopedCFTypeRef<CFURLRef> item_url( - LSSharedFileListItemCopyResolvedURL(item, 0, nullptr)); + // kLSSharedFileListDoNotMountVolumes is used so that we don't trigger + // mounting when it's not expected by a user. Just listing the login + // items should not cause any side-effects. + ScopedCFTypeRef<CFURLRef> item_url(LSSharedFileListItemCopyResolvedURL( + item, kLSSharedFileListDoNotMountVolumes, nullptr)); #pragma clang diagnostic pop if (item_url && CFEqual(item_url, url)) { @@ -388,9 +391,6 @@ int MacOSVersionInternal() { // correspondence between Darwin's major version numbers and macOS major // version numbers. int macos_major_version = darwin_major_version - 9; - DLOG_IF(WARNING, darwin_major_version > 20) - << "Assuming Darwin " << base::NumberToString(darwin_major_version) - << " is macOS " << base::NumberToString(macos_major_version); return macos_major_version * 100; } diff --git a/chromium/base/mac/mac_util_unittest.mm b/chromium/base/mac/mac_util_unittest.mm index f0a40d18cb2..2463bcbe6e3 100644 --- a/chromium/base/mac/mac_util_unittest.mm +++ b/chromium/base/mac/mac_util_unittest.mm @@ -8,13 +8,13 @@ #include "base/mac/mac_util.h" +#include "base/cxx17_backports.h" #include "base/files/file_path.h" #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/mac/foundation_util.h" #include "base/mac/scoped_cftyperef.h" #include "base/mac/scoped_nsobject.h" -#include "base/stl_util.h" #include "base/system/sys_info.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/platform_test.h" @@ -183,8 +183,9 @@ TEST_F(MacUtilTest, IsOSEllipsis) { TEST_FOR_FUTURE_10_OS(14); TEST_FOR_FUTURE_10_OS(15); TEST_FOR_FUTURE_OS(11); + TEST_FOR_FUTURE_OS(12); - EXPECT_FALSE(IsOSLaterThan11_DontCallThis()); + EXPECT_FALSE(IsOSLaterThan12_DontCallThis()); } else if (minor == 12) { EXPECT_FALSE(IsOS10_11()); EXPECT_FALSE(IsAtMostOS10_11()); @@ -194,8 +195,9 @@ TEST_F(MacUtilTest, IsOSEllipsis) { TEST_FOR_FUTURE_10_OS(14); TEST_FOR_FUTURE_10_OS(15); TEST_FOR_FUTURE_OS(11); + TEST_FOR_FUTURE_OS(12); - EXPECT_FALSE(IsOSLaterThan11_DontCallThis()); + EXPECT_FALSE(IsOSLaterThan12_DontCallThis()); } else if (minor == 13) { EXPECT_FALSE(IsOS10_11()); EXPECT_FALSE(IsAtMostOS10_11()); @@ -205,8 +207,9 @@ TEST_F(MacUtilTest, IsOSEllipsis) { TEST_FOR_FUTURE_10_OS(14); TEST_FOR_FUTURE_10_OS(15); TEST_FOR_FUTURE_OS(11); + TEST_FOR_FUTURE_OS(12); - EXPECT_FALSE(IsOSLaterThan11_DontCallThis()); + EXPECT_FALSE(IsOSLaterThan12_DontCallThis()); } else if (minor == 14) { EXPECT_FALSE(IsOS10_11()); EXPECT_FALSE(IsAtMostOS10_11()); @@ -216,8 +219,9 @@ TEST_F(MacUtilTest, IsOSEllipsis) { TEST_FOR_SAME_10_OS(14); TEST_FOR_FUTURE_10_OS(15); TEST_FOR_FUTURE_OS(11); + TEST_FOR_FUTURE_OS(12); - EXPECT_FALSE(IsOSLaterThan11_DontCallThis()); + EXPECT_FALSE(IsOSLaterThan12_DontCallThis()); } else if (minor == 15) { EXPECT_FALSE(IsOS10_11()); EXPECT_FALSE(IsAtMostOS10_11()); @@ -227,11 +231,12 @@ TEST_F(MacUtilTest, IsOSEllipsis) { TEST_FOR_PAST_10_OS(14); TEST_FOR_SAME_10_OS(15); TEST_FOR_FUTURE_OS(11); + TEST_FOR_FUTURE_OS(12); - EXPECT_FALSE(IsOSLaterThan11_DontCallThis()); + EXPECT_FALSE(IsOSLaterThan12_DontCallThis()); } else { // macOS 10.15 was the end of the line. - EXPECT_TRUE(false); + FAIL() << "Unexpected 10.x macOS."; } } else if (major == 11) { EXPECT_FALSE(IsOS10_11()); @@ -242,11 +247,24 @@ TEST_F(MacUtilTest, IsOSEllipsis) { TEST_FOR_PAST_10_OS(14); TEST_FOR_PAST_10_OS(15); TEST_FOR_SAME_OS(11); + TEST_FOR_FUTURE_OS(12); - EXPECT_FALSE(IsOSLaterThan11_DontCallThis()); + EXPECT_FALSE(IsOSLaterThan12_DontCallThis()); + } else if (major == 12) { + EXPECT_FALSE(IsOS10_11()); + EXPECT_FALSE(IsAtMostOS10_11()); + + TEST_FOR_PAST_10_OS(12); + TEST_FOR_PAST_10_OS(13); + TEST_FOR_PAST_10_OS(14); + TEST_FOR_PAST_10_OS(15); + TEST_FOR_PAST_OS(11); + TEST_FOR_SAME_OS(12); + + EXPECT_FALSE(IsOSLaterThan12_DontCallThis()); } else { // The spooky future. - EXPECT_FALSE(true); + FAIL() << "Time to update the OS macros!"; } } diff --git a/chromium/base/mac/os_crash_dumps.cc b/chromium/base/mac/os_crash_dumps.cc index 182d5d9fe5c..d105ec17ead 100644 --- a/chromium/base/mac/os_crash_dumps.cc +++ b/chromium/base/mac/os_crash_dumps.cc @@ -8,8 +8,8 @@ #include <stddef.h> #include <unistd.h> +#include "base/cxx17_backports.h" #include "base/logging.h" -#include "base/stl_util.h" namespace base { namespace mac { diff --git a/chromium/base/mac/scoped_dispatch_object.h b/chromium/base/mac/scoped_dispatch_object.h index cd2daf23342..c8cf9b4c2b0 100644 --- a/chromium/base/mac/scoped_dispatch_object.h +++ b/chromium/base/mac/scoped_dispatch_object.h @@ -25,7 +25,7 @@ struct ScopedDispatchObjectTraits { } }; -} // namepsace internal +} // namespace internal template <typename T> using ScopedDispatchObject = diff --git a/chromium/base/mac/scoped_ioobject.h b/chromium/base/mac/scoped_ioobject.h index c948cb55423..d656175f49c 100644 --- a/chromium/base/mac/scoped_ioobject.h +++ b/chromium/base/mac/scoped_ioobject.h @@ -24,7 +24,7 @@ struct ScopedIOObjectTraits { static void Release(IOT iot) { IOObjectRelease(iot); } }; -} // namespce internal +} // namespace internal // Just like ScopedCFTypeRef but for io_object_t and subclasses. template <typename IOT> |