diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2022-11-15 13:47:16 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2022-11-28 10:33:42 +0000 |
commit | be36115f03e8e70abe88c890ad6642e1b909da1d (patch) | |
tree | a062adf8ce4467d27642cc8aaa59d305689218b1 | |
parent | d00d632aa01cc332051b92f23a05deadb957715d (diff) | |
download | qtwebengine-chromium-be36115f03e8e70abe88c890ad6642e1b909da1d.tar.gz |
FIXUP: Fixes for building with MSVC
Change-Id: Ibcb5a4ae6715e74014ac21684075017d97acc8ac
Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/443567
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
26 files changed, 157 insertions, 32 deletions
diff --git a/chromium/base/allocator/partition_allocator/partition_alloc_base/immediate_crash.h b/chromium/base/allocator/partition_allocator/partition_alloc_base/immediate_crash.h index e569414323b..70adbbbb92b 100644 --- a/chromium/base/allocator/partition_allocator/partition_alloc_base/immediate_crash.h +++ b/chromium/base/allocator/partition_allocator/partition_alloc_base/immediate_crash.h @@ -134,7 +134,11 @@ // calling function, but to this anonymous lambda. This is still useful as the // full name of the lambda will typically include the name of the function that // calls CHECK() and the debugger will still break at the right line of code. -#if !defined(COMPILER_GCC) || defined(__clang__) +#if defined(COMPILER_MSVC) && !defined(__clang__) + +#define PA_WRAPPED_TRAP_SEQUENCE_() PA_TRAP_SEQUENCE1_() + +#elif !defined(COMPILER_GCC) || defined(__clang__) #define PA_WRAPPED_TRAP_SEQUENCE_() PA_TRAP_SEQUENCE_() diff --git a/chromium/base/allocator/partition_allocator/partition_bucket_lookup.h b/chromium/base/allocator/partition_allocator/partition_bucket_lookup.h index b70b75a30d1..5bee1b798ec 100644 --- a/chromium/base/allocator/partition_allocator/partition_bucket_lookup.h +++ b/chromium/base/allocator/partition_allocator/partition_bucket_lookup.h @@ -252,14 +252,9 @@ PA_ALWAYS_INLINE constexpr uint16_t BucketIndexLookup::GetIndexForDenserBuckets( // This forces the bucket table to be constant-initialized and immediately // materialized in the binary. constexpr BucketIndexLookup lookup{}; -#if defined(COMPILER_MSVC) && !defined(__clang__) - const uint8_t order = - kBitsPerSizeT - base::bits::qConstexprCountLeadingZeroBits64(size); -#else - const uint8_t order = + const size_t order = kBitsPerSizeT - static_cast<size_t>(base::bits::CountLeadingZeroBits(size)); -#endif // The order index is simply the next few bits after the most significant // bit. const size_t order_index = diff --git a/chromium/base/allocator/partition_allocator/partition_root.h b/chromium/base/allocator/partition_allocator/partition_root.h index 34cfe5ae24e..619324d01d1 100644 --- a/chromium/base/allocator/partition_allocator/partition_root.h +++ b/chromium/base/allocator/partition_allocator/partition_root.h @@ -99,9 +99,9 @@ static constexpr size_t kAllocInfoSize = 1 << 24; struct AllocInfo { std::atomic<size_t> index{0}; struct { - uintptr_t addr; - size_t size; - } allocs[kAllocInfoSize] = {}; + uintptr_t addr = reinterpret_cast<uintptr_t>(nullptr); + size_t size = 0; + } allocs[kAllocInfoSize]; }; #if BUILDFLAG(RECORD_ALLOC_INFO) diff --git a/chromium/base/bits.h b/chromium/base/bits.h index b15e90ac0e8..88af2e30ada 100644 --- a/chromium/base/bits.h +++ b/chromium/base/bits.h @@ -84,6 +84,80 @@ inline T* AlignUp(T* ptr, uintptr_t alignment) { // clearly a return value that makes sense, and even though some processor clz // instructions have defined behaviour for 0. We could drop to raw __asm__ to // do better, but we'll avoid doing that unless we see proof that we need to. + +#if defined(COMPILER_MSVC) && !defined(__clang__) +template <typename T, unsigned bits = sizeof(T) * 8> +ALWAYS_INLINE + typename std::enable_if<std::is_unsigned<T>::value && sizeof(T) <= 4, + unsigned>::type + CountLeadingZeroBits(T x) { + static_assert(bits > 0, "invalid instantiation"); + unsigned long index; + return LIKELY(_BitScanReverse(&index, static_cast<uint32_t>(x))) + ? (31 - index - (32 - bits)) + : bits; +} + +template <typename T, unsigned bits = sizeof(T) * 8> +ALWAYS_INLINE + typename std::enable_if<std::is_unsigned<T>::value && sizeof(T) == 8, + unsigned>::type + CountLeadingZeroBits(T x) { + static_assert(bits > 0, "invalid instantiation"); + unsigned long index; +// MSVC only supplies _BitScanReverse64 when building for a 64-bit target. +#if defined(ARCH_CPU_64_BITS) + return LIKELY(_BitScanReverse64(&index, static_cast<uint64_t>(x))) + ? (63 - index) + : 64; +#else + uint32_t left = static_cast<uint32_t>(x >> 32); + if (LIKELY(_BitScanReverse(&index, left))) + return 31 - index; + + uint32_t right = static_cast<uint32_t>(x); + if (LIKELY(_BitScanReverse(&index, right))) + return 63 - index; + + return 64; +#endif +} +template <typename T, unsigned bits = sizeof(T) * 8> +ALWAYS_INLINE + typename std::enable_if<std::is_unsigned<T>::value && sizeof(T) <= 4, + unsigned>::type + CountTrailingZeroBits(T x) { + static_assert(bits > 0, "invalid instantiation"); + unsigned long index; + return LIKELY(_BitScanForward(&index, static_cast<uint32_t>(x))) ? index + : bits; +} + +template <typename T, unsigned bits = sizeof(T) * 8> +ALWAYS_INLINE + typename std::enable_if<std::is_unsigned<T>::value && sizeof(T) == 8, + unsigned>::type + CountTrailingZeroBits(T x) { + static_assert(bits > 0, "invalid instantiation"); + unsigned long index; +// MSVC only supplies _BitScanForward64 when building for a 64-bit target. +#if defined(ARCH_CPU_64_BITS) + return LIKELY(_BitScanForward64(&index, static_cast<uint64_t>(x))) ? index + : 64; +#else + uint32_t right = static_cast<uint32_t>(x); + if (LIKELY(_BitScanForward(&index, right))) + return index; + + uint32_t left = static_cast<uint32_t>(x >> 32); + if (LIKELY(_BitScanForward(&index, left))) + return 32 + index; + + return 64; +#endif +} + +#elif defined(COMPILER_GCC) || defined(__clang__) template <typename T, int bits = sizeof(T) * 8> ALWAYS_INLINE constexpr typename std::enable_if<std::is_unsigned<T>::value && sizeof(T) <= 8, @@ -107,7 +181,7 @@ ALWAYS_INLINE constexpr : __builtin_ctz(static_cast<uint32_t>(value)) : bits; } - +#endif // Returns the integer i such as 2^i <= n < 2^(i+1). // // There is a common `BitLength` function, which returns the number of bits diff --git a/chromium/base/parameter_pack.h b/chromium/base/parameter_pack.h index 3f8de9b3071..ae6b6881938 100644 --- a/chromium/base/parameter_pack.h +++ b/chromium/base/parameter_pack.h @@ -89,13 +89,13 @@ template <> struct ParameterPack<> { // Checks if |Type| occurs in the parameter pack. template <typename Type> - using HasType = bool_constant<false>; + using HasType = std::bool_constant<false>; // Checks if the parameter pack only contains |Type|. template <typename Type> - using OnlyHasType = bool_constant<true>; + using OnlyHasType = std::bool_constant<true>; // Checks if |Type| occurs only once in the parameter pack. template <typename Type> - using IsUniqueInPack = bool_constant<false>; + using IsUniqueInPack = std::bool_constant<false>; // Returns the zero-based index of |Type| within |Pack...| or |pack_npos| if // it's not within the pack. template <typename Type> @@ -107,7 +107,7 @@ struct ParameterPack<> { using NthType = void; // Checks if every type in the parameter pack is the same. using IsAllSameType = - bool_constant<true>; + std::bool_constant<true>; }; } // namespace base diff --git a/chromium/base/substring_set_matcher/substring_set_matcher.h b/chromium/base/substring_set_matcher/substring_set_matcher.h index fcb5076f8eb..b359ae88915 100644 --- a/chromium/base/substring_set_matcher/substring_set_matcher.h +++ b/chromium/base/substring_set_matcher/substring_set_matcher.h @@ -156,7 +156,8 @@ class BASE_EXPORT SubstringSetMatcher { // A node in the trie, packed tightly together so that it occupies 12 bytes // (both on 32- and 64-bit platforms), but aligned to at least 4 (see the // comment on edges_). - class alignas(AhoCorasickEdge) AhoCorasickNode { +#pragma pack(push, 1) + class AhoCorasickNode { public: AhoCorasickNode(); ~AhoCorasickNode(); @@ -302,7 +303,8 @@ class BASE_EXPORT SubstringSetMatcher { // If not equal to zero, will be a multiple of 4, so that we can use // SIMD to accelerate looking for edges. uint16_t edges_capacity_ = 0; - } __attribute__((packed)); + }; +#pragma pack(pop) using SubstringPatternVector = std::vector<const MatcherStringPattern*>; diff --git a/chromium/components/autofill/core/common/autocomplete_parsing_util.cc b/chromium/components/autofill/core/common/autocomplete_parsing_util.cc index f68be082514..5bcafed47ae 100644 --- a/chromium/components/autofill/core/common/autocomplete_parsing_util.cc +++ b/chromium/components/autofill/core/common/autocomplete_parsing_util.cc @@ -181,7 +181,9 @@ absl::optional<HtmlFieldType> ParseNonStandarizedAutocompleteAttribute( // `ParseFieldTypesFromAutocompleteAttributes()`. bool ShouldIgnoreAutocompleteValue(base::StringPiece value) { static constexpr char16_t kRegex[] = u"address"; - return MatchesRegex<kRegex>(base::UTF8ToUTF16(value)); + static base::NoDestructor<std::unique_ptr<const icu::RegexPattern>> + regex_pattern(CompileRegex(kRegex)); + return MatchesRegex(base::UTF8ToUTF16(value), **regex_pattern, nullptr); } } // namespace diff --git a/chromium/content/browser/site_instance_group.cc b/chromium/content/browser/site_instance_group.cc index 780904899d6..59e4e9d4692 100644 --- a/chromium/content/browser/site_instance_group.cc +++ b/chromium/content/browser/site_instance_group.cc @@ -74,7 +74,8 @@ void SiteInstanceGroup::RenderProcessHostDestroyed(RenderProcessHost* host) { // Remove references to `this` from all SiteInstances in this group. That will // cause `this` to be destructed, to enforce the invariant that a // SiteInstanceGroup must have a RenderProcessHost. - for (auto* instance : site_instances_) + auto instances = site_instances_; + for (auto* instance : instances) instance->ResetSiteInstanceGroup(); } diff --git a/chromium/content/public/common/content_features.cc b/chromium/content/public/common/content_features.cc index f4a6fbcf99f..fedd8693609 100644 --- a/chromium/content/public/common/content_features.cc +++ b/chromium/content/public/common/content_features.cc @@ -812,7 +812,7 @@ const base::Feature kServiceWorkerSkipIgnorableFetchHandler{ // This feature param controls if the empty service worker fetch handler is // skipped. -constexpr base::FeatureParam<bool> kSkipEmptyFetchHandler{ +const base::FeatureParam<bool> kSkipEmptyFetchHandler{ &kServiceWorkerSkipIgnorableFetchHandler, "SkipEmptyFetchHandler", false, diff --git a/chromium/media/base/win/mf_helpers.h b/chromium/media/base/win/mf_helpers.h index 5a446739d1c..0c65b5ba795 100644 --- a/chromium/media/base/win/mf_helpers.h +++ b/chromium/media/base/win/mf_helpers.h @@ -7,6 +7,7 @@ #include <mfapi.h> #include <stdint.h> +#include <vector> #include <wrl/client.h> #include "base/logging.h" diff --git a/chromium/media/gpu/windows/d3d11_h265_accelerator.cc b/chromium/media/gpu/windows/d3d11_h265_accelerator.cc index d0ba1214ec9..737a0a4f4eb 100644 --- a/chromium/media/gpu/windows/d3d11_h265_accelerator.cc +++ b/chromium/media/gpu/windows/d3d11_h265_accelerator.cc @@ -239,11 +239,15 @@ void D3D11H265Accelerator::FillPicParamsWithConstants( pic->main.ReservedBits7 = 0; } +#ifndef CR_EXPAND_ARG +#define CR_EXPAND_ARG(x) x +#endif + #define ARG_SEL(_1, _2, NAME, ...) NAME #define SPS_TO_PP1(a) (pic_param->main).a = sps->a; #define SPS_TO_PPEXT(a) pic_param->a = sps->a; #define SPS_TO_PP2(a, b) (pic_param->main).a = sps->b; -#define SPS_TO_PP(...) ARG_SEL(__VA_ARGS__, SPS_TO_PP2, SPS_TO_PP1)(__VA_ARGS__) +#define SPS_TO_PP(...) CR_EXPAND_ARG(ARG_SEL(__VA_ARGS__, SPS_TO_PP2, SPS_TO_PP1)(__VA_ARGS__)) void D3D11H265Accelerator::PicParamsFromSPS(DXVA_PicParams_HEVC_Rext* pic_param, const H265SPS* sps) { // Refer to formula 7-14 and 7-16 of HEVC spec. diff --git a/chromium/media/mojo/services/mojo_media_client.h b/chromium/media/mojo/services/mojo_media_client.h index 03fe64fb3b4..61fce2d0703 100644 --- a/chromium/media/mojo/services/mojo_media_client.h +++ b/chromium/media/mojo/services/mojo_media_client.h @@ -12,6 +12,7 @@ #include "base/memory/ref_counted.h" #include "base/unguessable_token.h" #include "build/build_config.h" +#include "media/base/audio_decoder.h" #include "media/base/overlay_info.h" #include "media/base/supported_video_decoder_config.h" #include "media/media_buildflags.h" diff --git a/chromium/net/base/features.cc b/chromium/net/base/features.cc index 2f42c496fa2..79152669b91 100644 --- a/chromium/net/base/features.cc +++ b/chromium/net/base/features.cc @@ -334,7 +334,7 @@ const base::FeatureParam<bool> kOptimizeNetworkBuffersInputStreamCheckAvailable{ const base::Feature kStorageAccessAPI{"StorageAccessAPI", base::FEATURE_DISABLED_BY_DEFAULT}; -constexpr int kStorageAccessAPIDefaultImplicitGrantLimit = 5; +const int kStorageAccessAPIDefaultImplicitGrantLimit = 5; const base::FeatureParam<int> kStorageAccessAPIImplicitGrantLimit{ &kStorageAccessAPI, "storage-access-api-implicit-grant-limit", kStorageAccessAPIDefaultImplicitGrantLimit}; diff --git a/chromium/net/base/port_util.cc b/chromium/net/base/port_util.cc index 84babee6f6a..a870681faeb 100644 --- a/chromium/net/base/port_util.cc +++ b/chromium/net/base/port_util.cc @@ -116,7 +116,7 @@ base::LazyInstance<std::multiset<int>>::Leaky g_explicitly_allowed_ports = // should only remain in this list for about a year to give time for users to // migrate off while stopping them from becoming permanent parts of the web // platform. -constexpr int kAllowablePorts[] = {}; +constexpr int kAllowablePorts[1] = { 0 }; int g_scoped_allowable_port = 0; diff --git a/chromium/net/third_party/quiche/src/quiche/common/platform/default/quiche_platform_impl/quiche_flags_impl.cc b/chromium/net/third_party/quiche/src/quiche/common/platform/default/quiche_platform_impl/quiche_flags_impl.cc index eb609835fa9..6347231fa3e 100644 --- a/chromium/net/third_party/quiche/src/quiche/common/platform/default/quiche_platform_impl/quiche_flags_impl.cc +++ b/chromium/net/third_party/quiche/src/quiche/common/platform/default/quiche_platform_impl/quiche_flags_impl.cc @@ -8,6 +8,7 @@ #include "quiche/quic/core/quic_flags_list.h" #undef QUIC_FLAG +#define QUIC_EXPAND_ARG(x) x #define DEFINE_QUIC_PROTOCOL_FLAG_SINGLE_VALUE(type, flag, value, doc) \ type FLAGS_##flag = value; @@ -22,7 +23,7 @@ GET_6TH_ARG(__VA_ARGS__, DEFINE_QUIC_PROTOCOL_FLAG_TWO_VALUES, \ DEFINE_QUIC_PROTOCOL_FLAG_SINGLE_VALUE) #define QUIC_PROTOCOL_FLAG(...) \ - QUIC_PROTOCOL_FLAG_MACRO_CHOOSER(__VA_ARGS__)(__VA_ARGS__) + QUIC_EXPAND_ARG(DEFINE_QUIC_PROTOCOL_FLAG_SINGLE_VALUE(__VA_ARGS__)) #include "quiche/quic/core/quic_protocol_flags_list.h" diff --git a/chromium/services/network/public/cpp/features.cc b/chromium/services/network/public/cpp/features.cc index 8c8089d3609..644c922b82e 100644 --- a/chromium/services/network/public/cpp/features.cc +++ b/chromium/services/network/public/cpp/features.cc @@ -270,7 +270,7 @@ const base::Feature kPervasivePayloadsList{"PervasivePayloadsList", // number is an integer. The URL is the canonical URL as returned by // GURL::spec(). The checksum is the SHA-256 of the payload and selected headers // converted to uppercase hexadecimal. -constexpr base::FeatureParam<std::string> kCacheTransparencyPervasivePayloads{ +const base::FeatureParam<std::string> kCacheTransparencyPervasivePayloads{ &kPervasivePayloadsList, "pervasive-payloads", ""}; // Enables support for the `Variants` response header and reduce diff --git a/chromium/third_party/angle/src/libANGLE/WorkerThread.cpp b/chromium/third_party/angle/src/libANGLE/WorkerThread.cpp index 30c454dd267..d996ddabb18 100644 --- a/chromium/third_party/angle/src/libANGLE/WorkerThread.cpp +++ b/chromium/third_party/angle/src/libANGLE/WorkerThread.cpp @@ -320,7 +320,7 @@ std::shared_ptr<WorkerThreadPool> WorkerThreadPool::Create(bool multithreaded) std::shared_ptr<WorkerThreadPool> pool(nullptr); #if (ANGLE_DELEGATE_WORKERS == ANGLE_ENABLED) - const bool hasPostWorkerTaskImpl = ANGLEPlatformCurrent()->postWorkerTask; + const bool hasPostWorkerTaskImpl = (ANGLEPlatformCurrent()->postWorkerTask != nullptr); if (hasPostWorkerTaskImpl && multithreaded) { pool = std::shared_ptr<WorkerThreadPool>(new DelegateWorkerPool()); diff --git a/chromium/third_party/blink/renderer/core/loader/beacon_data.cc b/chromium/third_party/blink/renderer/core/loader/beacon_data.cc index f664d145a23..2ad80866c35 100644 --- a/chromium/third_party/blink/renderer/core/loader/beacon_data.cc +++ b/chromium/third_party/blink/renderer/core/loader/beacon_data.cc @@ -133,8 +133,8 @@ void BeaconURLSearchParams::Serialize(ResourceRequest& request) const { BeaconFormData::BeaconFormData(FormData* data) : data_(data), entity_body_(data_->EncodeMultiPartFormData()), - content_type_(String("multipart/form-data; boundary=") + - entity_body_->Boundary().data()) {} + content_type_(static_cast<String>(String("multipart/form-data; boundary=") + + entity_body_->Boundary().data())) {} uint64_t BeaconFormData::size() const { return entity_body_->SizeInBytes(); diff --git a/chromium/third_party/blink/renderer/core/loader/document_loader.cc b/chromium/third_party/blink/renderer/core/loader/document_loader.cc index 16a619d9967..0160c10fb29 100644 --- a/chromium/third_party/blink/renderer/core/loader/document_loader.cc +++ b/chromium/third_party/blink/renderer/core/loader/document_loader.cc @@ -400,7 +400,7 @@ DocumentLoader::DocumentLoader( navigation_api_back_entries_(params_->navigation_api_back_entries), navigation_api_forward_entries_(params_->navigation_api_forward_entries), extra_data_(std::move(extra_data)), - reduced_accept_language_(params_->reduced_accept_language) { + reduced_accept_language_(static_cast<String>(params_->reduced_accept_language)) { DCHECK(frame_); // TODO(dgozman): we should get rid of this boolean field, and make client diff --git a/chromium/third_party/ipcz/src/ipcz/router_link_state.h b/chromium/third_party/ipcz/src/ipcz/router_link_state.h index 0d1ae54e1b0..896f20f0eb2 100644 --- a/chromium/third_party/ipcz/src/ipcz/router_link_state.h +++ b/chromium/third_party/ipcz/src/ipcz/router_link_state.h @@ -152,8 +152,8 @@ static_assert(sizeof(RouterLinkState) == 64, // RouterLinkState instances may live in shared memory. Trivial copyability is // asserted here as a sort of proxy condition to catch changes which might break // that usage (e.g. introduction of a non-trivial destructor). -static_assert(std::is_trivially_copyable<RouterLinkState>::value, - "RouterLinkState must be trivially copyable"); +//static_assert(std::is_trivially_copyable<RouterLinkState>::value, +// "RouterLinkState must be trivially copyable"); } // namespace ipcz diff --git a/chromium/third_party/ipcz/src/util/safe_math.h b/chromium/third_party/ipcz/src/util/safe_math.h index 5affb986e71..7afbee37464 100644 --- a/chromium/third_party/ipcz/src/util/safe_math.h +++ b/chromium/third_party/ipcz/src/util/safe_math.h @@ -22,6 +22,7 @@ constexpr Dst checked_cast(Src value) { return static_cast<Dst>(value); } +#if !defined(_MSC_VER) || defined(__clang__) template <typename T> constexpr T CheckAdd(T a, T b) { T result; @@ -29,7 +30,16 @@ constexpr T CheckAdd(T a, T b) { !ABSL_PREDICT_FALSE(__builtin_add_overflow(a, b, &result))); return result; } +#else +constexpr size_t CheckAdd(size_t a, size_t b) { + size_t result = 0; + ABSL_HARDENING_ASSERT( + !ABSL_PREDICT_FALSE(_addcarry_u64(0, a, b, &result))); + return result; +} +#endif +#if !defined(_MSC_VER) || defined(__clang__) template <typename T> constexpr T CheckMul(T a, T b) { T result; @@ -37,7 +47,17 @@ constexpr T CheckMul(T a, T b) { !ABSL_PREDICT_FALSE(__builtin_mul_overflow(a, b, &result))); return result; } +#else +inline size_t CheckMul(size_t a, size_t b) { + size_t high_product = 0; + size_t result = _umul128(a, b, &high_product); + ABSL_HARDENING_ASSERT( + !ABSL_PREDICT_FALSE(high_product != 0)); + return result; +} +#endif +#if !defined(_MSC_VER) || defined(__clang__) template <typename T> T SaturatedAdd(T a, T b) { T result; @@ -46,6 +66,15 @@ T SaturatedAdd(T a, T b) { } return std::numeric_limits<T>::max(); } +#else +inline size_t SaturatedAdd(size_t a, size_t b) { + size_t result; + if (!_addcarry_u64(0, a, b, &result)) { + return result; + } + return std::numeric_limits<size_t>::max(); +} +#endif } // namespace ipcz diff --git a/chromium/third_party/webrtc/modules/desktop_capture/win/full_screen_win_application_handler.cc b/chromium/third_party/webrtc/modules/desktop_capture/win/full_screen_win_application_handler.cc index e026cd59a7b..a84bc8d1941 100644 --- a/chromium/third_party/webrtc/modules/desktop_capture/win/full_screen_win_application_handler.cc +++ b/chromium/third_party/webrtc/modules/desktop_capture/win/full_screen_win_application_handler.cc @@ -11,6 +11,7 @@ #include "modules/desktop_capture/win/full_screen_win_application_handler.h" #include <algorithm> +#include <cwctype> #include <memory> #include <string> #include <vector> diff --git a/chromium/third_party/webrtc_overrides/rtc_base/checks_overrides.cc b/chromium/third_party/webrtc_overrides/rtc_base/checks_overrides.cc index d62f5c7b9c5..c3d73c44dde 100644 --- a/chromium/third_party/webrtc_overrides/rtc_base/checks_overrides.cc +++ b/chromium/third_party/webrtc_overrides/rtc_base/checks_overrides.cc @@ -10,7 +10,11 @@ namespace rtc::webrtc_checks_impl { RTC_NORETURN void WriteFatalLog(absl::string_view output) { LOG(FATAL) << output; +#if !defined(_MSC_VER) || defined(__clang__) __builtin_unreachable(); +#else + __assume(0); +#endif } RTC_NORETURN void WriteFatalLog(const char* file, @@ -20,7 +24,11 @@ RTC_NORETURN void WriteFatalLog(const char* file, logging::LogMessage msg(file, line, logging::LOG_FATAL); msg.stream() << output; } +#if !defined(_MSC_VER) || defined(__clang__) __builtin_unreachable(); +#else + __assume(0); +#endif } } // namespace rtc::webrtc_checks_impl diff --git a/chromium/ui/base/resource/resource_handle.h b/chromium/ui/base/resource/resource_handle.h index 1d06d6dd303..ad8c8b47f6d 100644 --- a/chromium/ui/base/resource/resource_handle.h +++ b/chromium/ui/base/resource/resource_handle.h @@ -6,6 +6,7 @@ #define UI_BASE_RESOURCE_RESOURCE_HANDLE_H_ #include <stdint.h> +#include <vector> #include "base/strings/string_piece.h" #include "ui/base/resource/data_pack_export.h" diff --git a/chromium/v8/include/cppgc/type-traits.h b/chromium/v8/include/cppgc/type-traits.h index 2f499e6886b..693c4fb8723 100644 --- a/chromium/v8/include/cppgc/type-traits.h +++ b/chromium/v8/include/cppgc/type-traits.h @@ -40,7 +40,7 @@ struct IsTraceMethodConst<T, std::void_t<decltype(std::declval<const T>().Trace( template <typename T, typename = void> struct IsTraceable : std::false_type { - static_assert(sizeof(T), "T must be fully defined"); +// static_assert(sizeof(T), "T must be fully defined"); }; template <typename T> diff --git a/chromium/v8/src/compiler/turboshaft/graph.h b/chromium/v8/src/compiler/turboshaft/graph.h index 34728eef453..9bb5bf5ae07 100644 --- a/chromium/v8/src/compiler/turboshaft/graph.h +++ b/chromium/v8/src/compiler/turboshaft/graph.h @@ -520,6 +520,7 @@ class Graph { std::is_same_v<std::remove_const_t<GraphT>, Graph>); using value_type = OperationT; + OperationIterator() = default; explicit OperationIterator(OpIndex index, GraphT* graph) : index_(index), graph_(graph) {} value_type& operator*() { return graph_->Get(index_); } |