Suppress another batch of -Wunsafe-buffers-in-libc-calls warnings.
These are mainly mac-specific files this time around. Bug: 390223051 Change-Id: Icff8edda7eb629e89640ba011b6044e6c07f84be Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6370522 Reviewed-by: Alex Gough <ajgo@chromium.org> Owners-Override: Alex Gough <ajgo@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org> Cr-Commit-Position: refs/heads/main@{#1436298}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
1050cd84dd
commit
cecea8d3b5
base/mac
chrome
common
utility
safe_browsing
components
device_signals
core
browser
update_client
wifi
device/bluetooth
media
audio
base
capture
cast
encoding
net/base
remoting/host/setup
rlz/mac/lib
services/webnn/coreml
third_party/blink/renderer/platform
ui/accessibility/platform
@ -9,6 +9,7 @@
|
||||
#include "base/apple/bridging.h"
|
||||
#include "base/apple/foundation_util.h"
|
||||
#include "base/base_paths.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/containers/span.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
@ -69,7 +70,7 @@ void ReadLaunchEventsFromFifo(
|
||||
// No data was read, wait for the file descriptor to become readable
|
||||
// again.
|
||||
fd_set fds;
|
||||
FD_ZERO(&fds);
|
||||
UNSAFE_TODO(FD_ZERO(&fds));
|
||||
FD_SET(f.GetPlatformFile(), &fds);
|
||||
select(FD_SETSIZE, &fds, nullptr, nullptr, nullptr);
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
#import "base/apple/foundation_util.h"
|
||||
#include "base/base_paths.h"
|
||||
#include "base/check_op.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/memory/free_deleter.h"
|
||||
#include "base/path_service.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
@ -66,7 +67,7 @@ char* ProductDirNameForBundle(NSBundle* chrome_bundle) {
|
||||
|
||||
// Leaked, but the only caller initializes a static with this result, so it
|
||||
// only happens once, and that's OK.
|
||||
return strdup(product_dir_name);
|
||||
return UNSAFE_TODO(strdup(product_dir_name));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,8 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/common/safe_browsing/disk_image_type_sniffer_mac.h"
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/threading/scoped_blocking_call.h"
|
||||
|
||||
namespace safe_browsing {
|
||||
@ -48,8 +50,8 @@ bool DiskImageTypeSnifferMac::IsAppleDiskImageTrailer(
|
||||
const base::span<const uint8_t> subspan =
|
||||
trailer.last(kSizeKolySignatureInBytes);
|
||||
|
||||
return (memcmp(subspan.data(), kKolySignature, kSizeKolySignatureInBytes) ==
|
||||
0);
|
||||
return UNSAFE_TODO(memcmp(subspan.data(), kKolySignature,
|
||||
kSizeKolySignatureInBytes)) == 0;
|
||||
}
|
||||
|
||||
DiskImageTypeSnifferMac::~DiskImageTypeSnifferMac() = default;
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "base/check.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/numerics/safe_math.h"
|
||||
|
||||
@ -50,7 +51,7 @@ class ByteSlice {
|
||||
bool CopyDataAt(size_t at, size_t size, uint8_t* out_data) {
|
||||
if (!RangeCheck(at, size))
|
||||
return false;
|
||||
memcpy(out_data, data_ + at, size);
|
||||
UNSAFE_TODO(memcpy(out_data, data_ + at, size));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -10,6 +10,7 @@
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/functional/callback_helpers.h"
|
||||
#include "base/metrics/histogram_functions.h"
|
||||
#include "base/strings/string_util.h"
|
||||
@ -172,8 +173,8 @@ bool DMGAnalyzer::ResumeExtraction() {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (memcmp(kDERPKCS7SignedData, signature_contents.data(),
|
||||
std::size(kDERPKCS7SignedData)) != 0) {
|
||||
if (UNSAFE_TODO(memcmp(kDERPKCS7SignedData, signature_contents.data(),
|
||||
std::size(kDERPKCS7SignedData))) != 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include "base/apple/foundation_util.h"
|
||||
#include "base/apple/scoped_cftyperef.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/containers/buffer_iterator.h"
|
||||
#include "base/containers/span.h"
|
||||
#include "base/logging.h"
|
||||
@ -786,7 +787,7 @@ off_t UDIFBlockChunkReadStream::Seek(off_t offset, int whence) {
|
||||
bool UDIFBlockChunkReadStream::CopyOutZeros(base::span<uint8_t> buf,
|
||||
size_t* bytes_read) {
|
||||
*bytes_read = std::min(buf.size(), length_in_bytes_ - offset_);
|
||||
bzero(buf.data(), *bytes_read);
|
||||
UNSAFE_TODO(bzero(buf.data(), *bytes_read));
|
||||
offset_ += *bytes_read;
|
||||
return true;
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
#include <utility>
|
||||
|
||||
#import "base/apple/foundation_util.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/json/json_writer.h"
|
||||
@ -173,7 +174,8 @@ std::vector<SettingsItem> GetSettingItems(
|
||||
base::apple::ObjCCast<NSNumber>(value_ptr)) {
|
||||
// Differentiating between integer and float types.
|
||||
const char* value_type = value_num.objCType;
|
||||
if (strcmp(value_type, "d") == 0 || strcmp(value_type, "f") == 0) {
|
||||
if (UNSAFE_TODO(strcmp(value_type, "d")) == 0 ||
|
||||
UNSAFE_TODO(strcmp(value_type, "f")) == 0) {
|
||||
double setting_num = value_num.doubleValue;
|
||||
item.setting_json_value = base::StringPrintf("%f", setting_num);
|
||||
} else {
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "base/barrier_closure.h"
|
||||
#include "base/check.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/files/scoped_temp_dir.h"
|
||||
@ -65,7 +66,8 @@ constexpr char kDownloadSessionIdSwitchName[] = "download-session-id";
|
||||
int ParseRangeHeader(const std::string& header) {
|
||||
int lower_range = 0;
|
||||
// TODO(crbug.com/40285933): Don't use sscanf.
|
||||
EXPECT_EQ(std::sscanf(header.c_str(), "bytes=%d-", &lower_range), 1);
|
||||
EXPECT_EQ(UNSAFE_TODO(std::sscanf(header.c_str(), "bytes=%d-", &lower_range)),
|
||||
1);
|
||||
return lower_range;
|
||||
}
|
||||
|
||||
|
@ -5,8 +5,8 @@
|
||||
#include "components/wifi/wifi_service.h"
|
||||
|
||||
#import <CoreWLAN/CoreWLAN.h>
|
||||
#import <netinet/in.h>
|
||||
#import <SystemConfiguration/SystemConfiguration.h>
|
||||
#import <netinet/in.h>
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
@ -15,6 +15,7 @@
|
||||
|
||||
#include "base/apple/foundation_util.h"
|
||||
#include "base/apple/scoped_cftyperef.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
#import "base/task/sequenced_task_runner.h"
|
||||
@ -439,7 +440,7 @@ std::string WiFiServiceMac::GetNetworkConnectionState(
|
||||
|
||||
// Check whether WiFi network is reachable.
|
||||
struct sockaddr_in local_wifi_address;
|
||||
bzero(&local_wifi_address, sizeof(local_wifi_address));
|
||||
UNSAFE_TODO(bzero(&local_wifi_address, sizeof(local_wifi_address)));
|
||||
local_wifi_address.sin_len = sizeof(local_wifi_address);
|
||||
local_wifi_address.sin_family = AF_INET;
|
||||
local_wifi_address.sin_addr.s_addr = htonl(IN_LINKLOCALNETNUM);
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/apple/scoped_cftyperef.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/containers/queue.h"
|
||||
#include "base/functional/bind.h"
|
||||
#include "base/functional/callback.h"
|
||||
@ -728,7 +729,7 @@ void BluetoothSocketMac::OnChannelDataReceived(void* data, size_t length) {
|
||||
|
||||
int data_size = base::checked_cast<int>(length);
|
||||
auto buffer = base::MakeRefCounted<net::IOBufferWithSize>(data_size);
|
||||
memcpy(buffer->data(), data, buffer->size());
|
||||
UNSAFE_TODO(memcpy(buffer->data(), data, buffer->size()));
|
||||
|
||||
// If there is a pending read callback, call it now.
|
||||
if (receive_callbacks_) {
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <memory>
|
||||
|
||||
#include "base/android/build_info.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/containers/heap_array.h"
|
||||
#include "base/containers/span.h"
|
||||
#include "base/files/file_util.h"
|
||||
@ -276,7 +277,7 @@ class FileAudioSink : public AudioInputStream::AudioInputCallback {
|
||||
|
||||
// Write recorded data chunk to the file and prepare for next chunk.
|
||||
// TODO(henrika): use file_util:: instead.
|
||||
fwrite(chunk.data(), 1, chunk.size(), binary_file_);
|
||||
UNSAFE_TODO(fwrite(chunk.data(), 1, chunk.size(), binary_file_));
|
||||
buffer_->Seek(chunk.size());
|
||||
bytes_written += chunk.size();
|
||||
}
|
||||
|
@ -8,6 +8,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/containers/heap_array.h"
|
||||
#include "base/environment.h"
|
||||
#include "base/functional/bind.h"
|
||||
@ -78,7 +79,7 @@ class WriteToFileAudioSink : public AudioInputStream::AudioInputCallback {
|
||||
}
|
||||
|
||||
// Write recorded data chunk to the file and prepare for next chunk.
|
||||
fwrite(chunk.data(), 1, chunk.size(), file_);
|
||||
UNSAFE_TODO(fwrite(chunk.data(), 1, chunk.size(), file_));
|
||||
buffer_.Seek(chunk.size());
|
||||
bytes_written += chunk.size();
|
||||
}
|
||||
@ -304,7 +305,7 @@ TEST_F(MacAudioInputTest, DISABLED_AUAudioInputStreamRecordToFile) {
|
||||
AudioInputStream* ais = CreateDefaultAudioInputStream();
|
||||
EXPECT_EQ(ais->Open(), AudioInputStream::OpenOutcome::kSuccess);
|
||||
|
||||
fprintf(stderr, " File name : %s\n", kFileName);
|
||||
UNSAFE_TODO(fprintf(stderr, " File name : %s\n", kFileName));
|
||||
fprintf(stderr, " Sample rate: %d\n", fs);
|
||||
WriteToFileAudioSink file_sink(kFileName);
|
||||
fprintf(stderr, " >> Speak into the mic while recording...\n");
|
||||
|
@ -7,6 +7,7 @@
|
||||
#include <array>
|
||||
#include <vector>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/containers/span.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
@ -44,7 +45,7 @@ class RawAnnexBBuffer : public AnnexBBuffer {
|
||||
return size <= annexb_buffer_size_;
|
||||
}
|
||||
void Append(const char* s, size_t n) override {
|
||||
memcpy(annexb_buffer_ + annexb_buffer_offset_, s, n);
|
||||
UNSAFE_TODO(memcpy(annexb_buffer_ + annexb_buffer_offset_, s, n));
|
||||
annexb_buffer_offset_ += n;
|
||||
DCHECK_GE(reserved_size_, annexb_buffer_offset_);
|
||||
}
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/memory/ref_counted.h"
|
||||
@ -314,8 +315,9 @@ HRESULT DeckLinkCaptureDelegate::VideoInputFrameArrived(
|
||||
HRESULT DeckLinkCaptureDelegate::QueryInterface(REFIID iid, void** ppv) {
|
||||
DCHECK(thread_checker_.CalledOnValidThread());
|
||||
CFUUIDBytes iunknown = CFUUIDGetUUIDBytes(IUnknownUUID);
|
||||
if (memcmp(&iid, &iunknown, sizeof(REFIID)) == 0 ||
|
||||
memcmp(&iid, &IID_IDeckLinkInputCallback, sizeof(REFIID)) == 0) {
|
||||
if (UNSAFE_TODO(memcmp(&iid, &iunknown, sizeof(REFIID))) == 0 ||
|
||||
UNSAFE_TODO(memcmp(&iid, &IID_IDeckLinkInputCallback, sizeof(REFIID))) ==
|
||||
0) {
|
||||
*ppv = static_cast<IDeckLinkInputCallback*>(this);
|
||||
AddRef();
|
||||
return S_OK;
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/containers/heap_array.h"
|
||||
#include "base/containers/span.h"
|
||||
#include "base/functional/bind.h"
|
||||
@ -447,7 +448,7 @@ class AudioEncoder::AppleAacImpl final : public AudioEncoder::ImplBase {
|
||||
|
||||
// Request AAC-LC encoding, with no downmixing or downsampling.
|
||||
AudioStreamBasicDescription out_asbd;
|
||||
memset(&out_asbd, 0, sizeof(AudioStreamBasicDescription));
|
||||
UNSAFE_TODO(memset(&out_asbd, 0, sizeof(AudioStreamBasicDescription)));
|
||||
out_asbd.mSampleRate = sampling_rate;
|
||||
out_asbd.mFormatID = kAudioFormatMPEG4AAC;
|
||||
out_asbd.mChannelsPerFrame = num_channels_;
|
||||
|
@ -12,6 +12,7 @@
|
||||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/posix/eintr_wrapper.h"
|
||||
@ -102,8 +103,10 @@ int AddressFlagsToNetAddressAttributes(int flags) {
|
||||
bool IPAttributesGetterMac::GetAddressAttributes(const ifaddrs* if_addr,
|
||||
int* attributes) {
|
||||
struct in6_ifreq ifr = {};
|
||||
strncpy(ifr.ifr_name, if_addr->ifa_name, sizeof(ifr.ifr_name) - 1);
|
||||
memcpy(&ifr.ifr_ifru.ifru_addr, if_addr->ifa_addr, if_addr->ifa_addr->sa_len);
|
||||
UNSAFE_TODO(
|
||||
strncpy(ifr.ifr_name, if_addr->ifa_name, sizeof(ifr.ifr_name) - 1));
|
||||
UNSAFE_TODO(memcpy(&ifr.ifr_ifru.ifru_addr, if_addr->ifa_addr,
|
||||
if_addr->ifa_addr->sa_len));
|
||||
int rv = ioctl(ioctl_socket_, SIOCGIFAFLAG_IN6, &ifr);
|
||||
if (rv >= 0) {
|
||||
*attributes = AddressFlagsToNetAddressAttributes(ifr.ifr_ifru.ifru_flags);
|
||||
@ -117,7 +120,8 @@ IPAttributesGetterMac::GetNetworkInterfaceType(const ifaddrs* if_addr) {
|
||||
return NetworkChangeNotifier::CONNECTION_UNKNOWN;
|
||||
|
||||
struct ifmediareq ifmr = {};
|
||||
strncpy(ifmr.ifm_name, if_addr->ifa_name, sizeof(ifmr.ifm_name) - 1);
|
||||
UNSAFE_TODO(
|
||||
strncpy(ifmr.ifm_name, if_addr->ifa_name, sizeof(ifmr.ifm_name) - 1));
|
||||
|
||||
if (ioctl(ioctl_socket_, SIOCGIFMEDIA, &ifmr) != -1) {
|
||||
if (ifmr.ifm_current & IFM_IEEE80211) {
|
||||
|
@ -6,13 +6,15 @@
|
||||
|
||||
#include <launch.h>
|
||||
#include <sys/types.h>
|
||||
#include <utility>
|
||||
|
||||
#include <optional>
|
||||
#include <utility>
|
||||
|
||||
#include "base/apple/bridging.h"
|
||||
#include "base/apple/foundation_util.h"
|
||||
#include "base/apple/osstatus_logging.h"
|
||||
#include "base/command_line.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/files/file_util.h"
|
||||
#include "base/files/scoped_file.h"
|
||||
#include "base/functional/bind.h"
|
||||
@ -48,7 +50,7 @@ constexpr char kIoThreadName[] = "DaemonControllerDelegateMac IO thread";
|
||||
// deleter function.
|
||||
class ScopedWaitpid {
|
||||
public:
|
||||
// -1 is treated as an invalid PID and waitpit() will not be called in this
|
||||
// -1 is treated as an invalid PID and waitpid() will not be called in this
|
||||
// case. Note that -1 is the value returned from
|
||||
// base::mac::ExecuteWithPrivilegesAndGetPID() when the child PID could not be
|
||||
// determined.
|
||||
@ -132,8 +134,8 @@ bool RunHelperAsRoot(const std::string& command,
|
||||
}
|
||||
|
||||
if (!input_data.empty()) {
|
||||
size_t bytes_written =
|
||||
fwrite(input_data.data(), sizeof(char), input_data.size(), pipe);
|
||||
size_t bytes_written = UNSAFE_TODO(
|
||||
fwrite(input_data.data(), sizeof(char), input_data.size(), pipe));
|
||||
// According to the fwrite manpage, a partial count is returned only if a
|
||||
// write error has occurred.
|
||||
if (bytes_written != input_data.size()) {
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
#include "base/apple/foundation_util.h"
|
||||
#include "base/apple/scoped_cftyperef.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/mac/mac_util.h"
|
||||
#include "base/mac/scoped_ioobject.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
@ -57,7 +58,7 @@ bool GetMACAddressFromIterator(io_iterator_t primary_interface_iterator,
|
||||
|
||||
bool success = false;
|
||||
|
||||
bzero(buffer, buffer_size);
|
||||
UNSAFE_TODO(bzero(buffer, buffer_size));
|
||||
base::mac::ScopedIOObject<io_object_t> primary_interface;
|
||||
while (primary_interface.reset(IOIteratorNext(primary_interface_iterator)),
|
||||
primary_interface) {
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include "base/apple/foundation_util.h"
|
||||
#include "base/check.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/notreached.h"
|
||||
#include "base/strings/sys_string_conversions.h"
|
||||
@ -112,7 +113,7 @@ bool RlzValueStoreMac::ReadAccessPointRlz(AccessPoint access_point,
|
||||
ASSERT_STRING("GetAccessPointRlz: Insufficient buffer size");
|
||||
return false;
|
||||
}
|
||||
strncpy(rlz, s.c_str(), rlz_size);
|
||||
UNSAFE_TODO(strncpy(rlz, s.c_str(), rlz_size));
|
||||
return true;
|
||||
}
|
||||
if (rlz_size > 0) {
|
||||
|
@ -6,6 +6,7 @@
|
||||
|
||||
#import <CoreML/CoreML.h>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/functional/callback_helpers.h"
|
||||
#include "base/memory/scoped_refptr.h"
|
||||
#include "mojo/public/cpp/base/big_buffer.h"
|
||||
@ -98,7 +99,7 @@ TensorImplCoreml::Create(
|
||||
|
||||
// TODO(crbug.com/333392274): Use the `WriteToMLMultiArray()` function
|
||||
// which handles non-contiguous buffers.
|
||||
memset(mutable_bytes, 0, size);
|
||||
UNSAFE_TODO(memset(mutable_bytes, 0, size));
|
||||
}];
|
||||
block_executing_synchronously = false;
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
|
||||
#if BUILDFLAG(IS_MAC) && !defined(WTF_USE_WEBAUDIO_PFFFT)
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "third_party/blink/renderer/platform/audio/fft_frame.h"
|
||||
#include "third_party/blink/renderer/platform/audio/hrtf_panner.h"
|
||||
#include "third_party/blink/renderer/platform/audio/vector_math.h"
|
||||
@ -131,8 +132,8 @@ FFTFrame::FFTFrame(const FFTFrame& frame)
|
||||
|
||||
// Copy/setup frame data
|
||||
unsigned nbytes = sizeof(float) * fft_size_;
|
||||
memcpy(RealData().Data(), frame.frame_.realp, nbytes);
|
||||
memcpy(ImagData().Data(), frame.frame_.imagp, nbytes);
|
||||
UNSAFE_TODO(memcpy(RealData().Data(), frame.frame_.realp, nbytes));
|
||||
UNSAFE_TODO(memcpy(ImagData().Data(), frame.frame_.imagp, nbytes));
|
||||
}
|
||||
|
||||
FFTFrame::~FFTFrame() {}
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include "base/apple/bridging.h"
|
||||
#import "base/apple/foundation_util.h"
|
||||
#include "base/apple/scoped_cftyperef.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "third_party/blink/renderer/platform/font_family_names.h"
|
||||
#include "third_party/blink/renderer/platform/fonts/font_selection_types.h"
|
||||
@ -311,8 +312,8 @@ TEST_P(TestFontMatchingByNameAndWeight, TestCTAndNSMatchEqual) {
|
||||
// "HelveticaNeue-Light". This fonts should be skipped in this test.
|
||||
// This issue is described in the comment under
|
||||
// "MatchFamilyWithWeightVariations" test.
|
||||
if (strcmp(font_name.family_name, "Helvetica Neue") == 0 ||
|
||||
strcmp(font_name.family_name, "Hiragino Sans") == 0) {
|
||||
if (UNSAFE_TODO(strcmp(font_name.family_name, "Helvetica Neue")) == 0 ||
|
||||
UNSAFE_TODO(strcmp(font_name.family_name, "Hiragino Sans")) == 0) {
|
||||
return;
|
||||
}
|
||||
TestCTAndNSMatchEqual(font_name.family_name, 11, weight, kNormalSlopeValue,
|
||||
|
@ -8,6 +8,7 @@
|
||||
#include <Foundation/Foundation.h>
|
||||
|
||||
#include "base/apple/foundation_util.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/mac/mac_util.h"
|
||||
#include "base/memory/raw_ptr_exclusion.h"
|
||||
@ -2484,8 +2485,9 @@ const ui::CocoaActionList& GetCocoaActionListForTesting() {
|
||||
|
||||
- (id)AXStringForRange:(id)parameter {
|
||||
if (![parameter isKindOfClass:[NSValue class]] ||
|
||||
(0 != strcmp([parameter objCType], @encode(NSRange))))
|
||||
(0 != UNSAFE_TODO(strcmp([parameter objCType], @encode(NSRange))))) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
return [self accessibilityStringForRange:[parameter rangeValue]];
|
||||
}
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include "base/apple/foundation_util.h"
|
||||
#include "base/apple/scoped_cftyperef.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/memory/raw_ptr.h"
|
||||
#include "base/metrics/histogram_functions.h"
|
||||
#include "base/metrics/histogram_macros.h"
|
||||
@ -500,7 +501,7 @@ AXTextEdit::~AXTextEdit() = default;
|
||||
|
||||
bool ui::IsNSRange(id value) {
|
||||
return [value isKindOfClass:[NSValue class]] &&
|
||||
0 == strcmp([value objCType], @encode(NSRange));
|
||||
0 == UNSAFE_TODO(strcmp([value objCType], @encode(NSRange)));
|
||||
}
|
||||
|
||||
@implementation BrowserAccessibilityCocoa {
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "base/apple/bridging.h"
|
||||
#include "base/apple/foundation_util.h"
|
||||
#include "base/apple/scoped_cftyperef.h"
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/containers/fixed_flat_set.h"
|
||||
#include "base/debug/stack_trace.h"
|
||||
#include "base/functional/callback.h"
|
||||
@ -279,7 +280,7 @@ AXOptionalNSObject AXElementWrapper::GetParameterizedAttributeValue(
|
||||
base::apple::ScopedCFTypeRef<CFTypeRef> parameter_ref(
|
||||
CFBridgingRetain(parameter));
|
||||
if ([parameter isKindOfClass:[NSValue class]] &&
|
||||
!strcmp([parameter objCType], @encode(NSRange))) {
|
||||
!UNSAFE_TODO(strcmp([parameter objCType], @encode(NSRange)))) {
|
||||
NSRange range = [parameter rangeValue];
|
||||
parameter_ref.reset(AXValueCreate(kAXValueTypeCFRange, &range));
|
||||
}
|
||||
|
Reference in New Issue
Block a user