summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-02-08 13:13:08 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2021-03-16 15:20:15 +0100
commit9650eff615a19f2cda06760b2e475b24e8faae2b (patch)
treed6f721dc42817e673e31fd1dff72500d31762553
parent293f42fdc453074c627a62829602421e0ff75be6 (diff)
downloadqtwebengine-chromium-9650eff615a19f2cda06760b2e475b24e8faae2b.tar.gz
Fix misuse of {} initialization
Narrowing is supposed to be forbidden in {} initialization, but Chromium doesn't appear to care upstream. Change-Id: Ia3d1dac6ef19ef86afcbeee4ed11d807c53faaaa Reviewed-by: Michal Klocek <michal.klocek@qt.io>
-rw-r--r--chromium/base/big_endian.h2
-rw-r--r--chromium/base/task/thread_pool/job_task_source.cc4
-rw-r--r--chromium/base/time/time.cc8
-rw-r--r--chromium/base/win/embedded_i18n/language_selector.cc2
-rw-r--r--chromium/base/win/enum_variant.cc8
-rw-r--r--chromium/cc/input/scrollbar_animation_controller.cc2
-rw-r--r--chromium/cc/input/single_scrollbar_animation_controller_thinning.cc2
-rw-r--r--chromium/cc/layers/mirror_layer_impl.h2
-rw-r--r--chromium/cc/metrics/frame_sequence_metrics.cc2
-rw-r--r--chromium/cc/metrics/video_playback_roughness_reporter.cc2
-rw-r--r--chromium/cc/paint/paint_op_buffer.h2
-rw-r--r--chromium/cc/tiles/gpu_image_decode_cache.cc2
-rw-r--r--chromium/components/crx_file/crx_creator.cc9
-rw-r--r--chromium/components/crx_file/crx_verifier.cc4
-rw-r--r--chromium/components/pdf/renderer/pdf_ax_action_target.cc16
-rw-r--r--chromium/components/viz/common/gl_scaler.cc4
-rw-r--r--chromium/content/browser/accessibility/browser_accessibility.cc22
-rw-r--r--chromium/content/browser/accessibility/browser_accessibility_manager.cc2
-rw-r--r--chromium/content/browser/download/download_manager_impl.cc2
-rw-r--r--chromium/content/renderer/pepper/pepper_plugin_instance_impl.cc2
-rw-r--r--chromium/device/fido/public_key_credential_params.cc3
-rw-r--r--chromium/device/fido/win/type_conversions.cc4
-rw-r--r--chromium/device/fido/win/webauthn_api.cc4
-rw-r--r--chromium/device/gamepad/dualshock4_controller.cc8
-rw-r--r--chromium/device/gamepad/gamepad_device_linux.cc2
-rw-r--r--chromium/device/gamepad/gamepad_uma.cc2
-rw-r--r--chromium/device/gamepad/nintendo_controller.cc16
-rw-r--r--chromium/device/gamepad/raw_input_gamepad_device_win.cc6
-rw-r--r--chromium/device/gamepad/raw_input_gamepad_device_win.h2
-rw-r--r--chromium/extensions/browser/blob_reader.cc2
-rw-r--r--chromium/extensions/renderer/api/automation/automation_internal_custom_bindings.cc8
-rw-r--r--chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc4
-rw-r--r--chromium/gpu/vulkan/vulkan_swap_chain.cc32
-rw-r--r--chromium/media/mojo/common/mojo_shared_buffer_video_frame.cc4
-rw-r--r--chromium/media/mojo/services/mojo_cdm_allocator.cc2
-rw-r--r--chromium/media/renderers/win/media_foundation_audio_stream.cc2
-rw-r--r--chromium/media/renderers/win/media_foundation_renderer.cc2
-rw-r--r--chromium/media/video/openh264_video_encoder.cc4
-rw-r--r--chromium/media/video/video_encode_accelerator_adapter.cc12
-rw-r--r--chromium/media/video/vpx_video_encoder.cc2
-rw-r--r--chromium/pdf/out_of_process_instance.cc4
-rw-r--r--chromium/printing/print_settings_conversion.cc2
-rw-r--r--chromium/services/device/public/cpp/hid/hid_collection.cc2
-rw-r--r--chromium/services/device/public/cpp/hid/hid_item_state_table.cc8
-rw-r--r--chromium/storage/browser/blob/blob_impl.cc2
-rw-r--r--chromium/third_party/blink/renderer/core/inspector/inspector_dom_snapshot_agent.cc2
-rw-r--r--chromium/third_party/blink/renderer/core/layout/layout_block_flow_line.cc4
-rw-r--r--chromium/third_party/blink/renderer/core/layout/line/abstract_inline_text_box.cc4
-rw-r--r--chromium/third_party/blink/renderer/modules/accessibility/ax_inline_text_box.cc8
-rw-r--r--chromium/third_party/blink/renderer/modules/accessibility/ax_node_object.cc2
-rw-r--r--chromium/third_party/blink/renderer/modules/accessibility/ax_object.cc10
-rw-r--r--chromium/third_party/blink/renderer/modules/accessibility/ax_position.cc8
-rw-r--r--chromium/third_party/blink/renderer/modules/accessibility/ax_selection.cc8
-rw-r--r--chromium/third_party/blink/renderer/modules/encoding/text_encoder_stream.cc2
-rw-r--r--chromium/third_party/blink/renderer/modules/exported/web_ax_object.cc2
-rw-r--r--chromium/third_party/blink/renderer/modules/hid/hid_device.cc2
-rw-r--r--chromium/third_party/blink/renderer/modules/mediastream/input_device_info.cc4
-rw-r--r--chromium/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.cc4
-rw-r--r--chromium/third_party/blink/renderer/modules/webcodecs/decoder_template.cc6
-rw-r--r--chromium/third_party/blink/renderer/modules/webcodecs/video_encoder.cc2
-rw-r--r--chromium/third_party/blink/renderer/modules/webcodecs/video_frame.cc2
-rw-r--r--chromium/third_party/blink/renderer/modules/xr/xr_ray.cc2
-rw-r--r--chromium/third_party/blink/renderer/modules/xr/xr_session.cc10
-rw-r--r--chromium/third_party/blink/renderer/platform/audio/dynamics_compressor_kernel.cc4
-rw-r--r--chromium/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc2
-rw-r--r--chromium/third_party/blink/renderer/platform/fonts/opentype/open_type_math_support.cc4
-rw-r--r--chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.cc2
-rw-r--r--chromium/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc2
-rw-r--r--chromium/third_party/blink/renderer/platform/text/text_boundaries.cc12
-rw-r--r--chromium/third_party/ced/src/compact_enc_det/compact_enc_det.cc4
-rw-r--r--chromium/third_party/ced/src/compact_enc_det/compact_enc_det_generated_tables.h2
-rw-r--r--chromium/ui/accessibility/ax_language_detection.cc2
-rw-r--r--chromium/ui/accessibility/ax_node.cc34
-rw-r--r--chromium/ui/accessibility/ax_node_position.cc6
-rw-r--r--chromium/ui/accessibility/ax_position.h20
-rw-r--r--chromium/ui/accessibility/ax_table_info.cc6
-rw-r--r--chromium/ui/accessibility/ax_text_utils.cc2
-rw-r--r--chromium/ui/accessibility/platform/ax_platform_node_delegate_base.cc2
-rw-r--r--chromium/ui/display/win/screen_win.cc8
-rw-r--r--chromium/ui/display/win/uwp_text_scale_factor.cc2
-rw-r--r--chromium/ui/gfx/color_utils.cc2
-rw-r--r--chromium/ui/gfx/paint_throbber.cc4
-rw-r--r--chromium/ui/gfx/system_fonts_win.cc2
83 files changed, 221 insertions, 221 deletions
diff --git a/chromium/base/big_endian.h b/chromium/base/big_endian.h
index 1ef321dd491..aa7ae1a3a40 100644
--- a/chromium/base/big_endian.h
+++ b/chromium/base/big_endian.h
@@ -24,7 +24,7 @@ inline void ReadBigEndian(const char buf[], T* out) {
static_assert(std::is_integral<T>::value, "T has to be an integral type.");
// Make an unsigned version of the output type to make shift possible
// without UB.
- typename std::make_unsigned<T>::type unsigned_result = uint8_t{buf[0]};
+ typename std::make_unsigned<T>::type unsigned_result = uint8_t(buf[0]);
for (size_t i = 1; i < sizeof(T); ++i) {
unsigned_result <<= 8;
// Must cast to uint8_t to avoid clobbering by sign extension.
diff --git a/chromium/base/task/thread_pool/job_task_source.cc b/chromium/base/task/thread_pool/job_task_source.cc
index 43ccd33669f..9bf4976725f 100644
--- a/chromium/base/task/thread_pool/job_task_source.cc
+++ b/chromium/base/task/thread_pool/job_task_source.cc
@@ -46,13 +46,13 @@ JobTaskSource::State::Value JobTaskSource::State::DecrementWorkerCount() {
const size_t value_before_sub =
value_.fetch_sub(kWorkerCountIncrement, std::memory_order_relaxed);
DCHECK((value_before_sub >> kWorkerCountBitOffset) > 0);
- return {value_before_sub};
+ return {uint32_t(value_before_sub)};
}
JobTaskSource::State::Value JobTaskSource::State::IncrementWorkerCount() {
size_t value_before_add =
value_.fetch_add(kWorkerCountIncrement, std::memory_order_relaxed);
- return {value_before_add};
+ return {uint32_t(value_before_add)};
}
JobTaskSource::State::Value JobTaskSource::State::Load() const {
diff --git a/chromium/base/time/time.cc b/chromium/base/time/time.cc
index d224bd01f1a..8f7aa85fe2e 100644
--- a/chromium/base/time/time.cc
+++ b/chromium/base/time/time.cc
@@ -173,7 +173,7 @@ Optional<TimeDelta> TimeDelta::FromString(StringPiece duration_string) {
if (number.int_part != 0)
delta += sign * number.int_part * unit;
if (number.frac_part != 0)
- delta += (double{sign} * number.frac_part / number.frac_scale) * unit;
+ delta += (double(sign) * number.frac_part / number.frac_scale) * unit;
}
return delta;
}
@@ -198,7 +198,7 @@ int TimeDelta::InDaysFloored() const {
double TimeDelta::InSecondsF() const {
if (!is_inf())
- return double{delta_} / Time::kMicrosecondsPerSecond;
+ return double(delta_) / Time::kMicrosecondsPerSecond;
return (delta_ < 0) ? -std::numeric_limits<double>::infinity()
: std::numeric_limits<double>::infinity();
}
@@ -209,7 +209,7 @@ int64_t TimeDelta::InSeconds() const {
double TimeDelta::InMillisecondsF() const {
if (!is_inf())
- return double{delta_} / Time::kMicrosecondsPerMillisecond;
+ return double(delta_) / Time::kMicrosecondsPerMillisecond;
return (delta_ < 0) ? -std::numeric_limits<double>::infinity()
: std::numeric_limits<double>::infinity();
}
@@ -233,7 +233,7 @@ int64_t TimeDelta::InMillisecondsRoundedUp() const {
double TimeDelta::InMicrosecondsF() const {
if (!is_inf())
- return double{delta_};
+ return double(delta_);
return (delta_ < 0) ? -std::numeric_limits<double>::infinity()
: std::numeric_limits<double>::infinity();
}
diff --git a/chromium/base/win/embedded_i18n/language_selector.cc b/chromium/base/win/embedded_i18n/language_selector.cc
index fde6a282b0f..7956e873d2e 100644
--- a/chromium/base/win/embedded_i18n/language_selector.cc
+++ b/chromium/base/win/embedded_i18n/language_selector.cc
@@ -268,7 +268,7 @@ void SelectLanguageMatchingCandidate(
DCHECK(matched_candidate);
DCHECK(selected_language);
DCHECK(!languages_to_offset.empty());
- DCHECK_EQ(size_t{*selected_offset}, languages_to_offset.size());
+ DCHECK_EQ(size_t(*selected_offset), languages_to_offset.size());
DCHECK(matched_candidate->empty());
DCHECK(selected_language->empty());
// Note: While DCHECK_IS_ON() seems redundant here, this is required to avoid
diff --git a/chromium/base/win/enum_variant.cc b/chromium/base/win/enum_variant.cc
index 654cfc67c13..8c845406862 100644
--- a/chromium/base/win/enum_variant.cc
+++ b/chromium/base/win/enum_variant.cc
@@ -35,7 +35,7 @@ HRESULT EnumVariant::Next(ULONG requested_count,
return E_INVALIDARG;
DCHECK_LE(current_index_, items_.size());
- ULONG available_count = ULONG{items_.size()} - current_index_;
+ ULONG available_count = ULONG(items_.size()) - current_index_;
ULONG count = std::min(requested_count, available_count);
for (ULONG i = 0; i < count; ++i)
out_elements[i] = items_[current_index_ + i].Copy();
@@ -51,8 +51,8 @@ HRESULT EnumVariant::Next(ULONG requested_count,
HRESULT EnumVariant::Skip(ULONG skip_count) {
ULONG count = skip_count;
- if (current_index_ + count > ULONG{items_.size()})
- count = ULONG{items_.size()} - current_index_;
+ if (current_index_ + count > ULONG(items_.size()))
+ count = ULONG(items_.size()) - current_index_;
current_index_ += count;
return (count == skip_count ? S_OK : S_FALSE);
@@ -69,7 +69,7 @@ HRESULT EnumVariant::Clone(IEnumVARIANT** out_cloned_object) {
size_t count = items_.size();
Microsoft::WRL::ComPtr<EnumVariant> other =
- Microsoft::WRL::Make<EnumVariant>(ULONG{count});
+ Microsoft::WRL::Make<EnumVariant>(ULONG(count));
for (size_t i = 0; i < count; ++i)
other->items_[i] = static_cast<const VARIANT&>(items_[i]);
diff --git a/chromium/cc/input/scrollbar_animation_controller.cc b/chromium/cc/input/scrollbar_animation_controller.cc
index 89861d68b4c..501e3d22836 100644
--- a/chromium/cc/input/scrollbar_animation_controller.cc
+++ b/chromium/cc/input/scrollbar_animation_controller.cc
@@ -160,7 +160,7 @@ bool ScrollbarAnimationController::Animate(base::TimeTicks now) {
float ScrollbarAnimationController::AnimationProgressAtTime(
base::TimeTicks now) {
const base::TimeDelta delta = now - last_awaken_time_;
- return base::ClampToRange(float{delta / fade_duration_}, 0.0f, 1.0f);
+ return base::ClampToRange(float(delta / fade_duration_), 0.0f, 1.0f);
}
void ScrollbarAnimationController::RunAnimationFrame(float progress) {
diff --git a/chromium/cc/input/single_scrollbar_animation_controller_thinning.cc b/chromium/cc/input/single_scrollbar_animation_controller_thinning.cc
index 75a458650f3..7e25420efdc 100644
--- a/chromium/cc/input/single_scrollbar_animation_controller_thinning.cc
+++ b/chromium/cc/input/single_scrollbar_animation_controller_thinning.cc
@@ -99,7 +99,7 @@ float SingleScrollbarAnimationControllerThinning::AnimationProgressAtTime(
return 1.0f;
const base::TimeDelta delta = now - last_awaken_time_;
- return base::ClampToRange(float{delta / thinning_duration_}, 0.0f, 1.0f);
+ return base::ClampToRange(float(delta / thinning_duration_), 0.0f, 1.0f);
}
void SingleScrollbarAnimationControllerThinning::RunAnimationFrame(
diff --git a/chromium/cc/layers/mirror_layer_impl.h b/chromium/cc/layers/mirror_layer_impl.h
index 54f5e14166c..fb2049659eb 100644
--- a/chromium/cc/layers/mirror_layer_impl.h
+++ b/chromium/cc/layers/mirror_layer_impl.h
@@ -55,7 +55,7 @@ class CC_EXPORT MirrorLayerImpl : public LayerImpl {
private:
const char* LayerTypeAsString() const override;
viz::CompositorRenderPassId mirrored_layer_render_pass_id() const {
- return viz::CompositorRenderPassId{mirrored_layer_id()};
+ return viz::CompositorRenderPassId(mirrored_layer_id());
}
int mirrored_layer_id_ = 0;
diff --git a/chromium/cc/metrics/frame_sequence_metrics.cc b/chromium/cc/metrics/frame_sequence_metrics.cc
index e79edb0a3c0..7f00deb1a7b 100644
--- a/chromium/cc/metrics/frame_sequence_metrics.cc
+++ b/chromium/cc/metrics/frame_sequence_metrics.cc
@@ -223,7 +223,7 @@ void FrameSequenceMetrics::ReportMetrics() {
.Run({
main_throughput_.frames_expected,
main_throughput_.frames_produced,
- jank_reporter_->jank_count(),
+ uint32_t(jank_reporter_->jank_count()),
});
main_throughput_ = {};
diff --git a/chromium/cc/metrics/video_playback_roughness_reporter.cc b/chromium/cc/metrics/video_playback_roughness_reporter.cc
index 69474ed3080..c3556df8c92 100644
--- a/chromium/cc/metrics/video_playback_roughness_reporter.cc
+++ b/chromium/cc/metrics/video_playback_roughness_reporter.cc
@@ -60,7 +60,7 @@ void VideoPlaybackRoughnessReporter::FrameSubmitted(
FrameInfo info;
info.token = token;
info.decode_time = frame.metadata()->decode_end_time;
- info.refresh_rate_hz = int{std::round(1.0 / render_interval.InSecondsF())};
+ info.refresh_rate_hz = int(std::lround(1.0 / render_interval.InSecondsF()));
info.size = frame.natural_size();
info.intended_duration = frame.metadata()->wallclock_frame_duration;
diff --git a/chromium/cc/paint/paint_op_buffer.h b/chromium/cc/paint/paint_op_buffer.h
index 57b1d8e4440..c0052d09744 100644
--- a/chromium/cc/paint/paint_op_buffer.h
+++ b/chromium/cc/paint/paint_op_buffer.h
@@ -1080,7 +1080,7 @@ class CC_PAINT_EXPORT PaintOpBuffer : public SkRefCnt {
uint16_t skip = static_cast<uint16_t>(ComputeOpSkip(sizeof(T)));
T* op = reinterpret_cast<T*>(AllocatePaintOp(skip));
- new (op) T{std::forward<Args>(args)...};
+ new (op) T(std::forward<Args>(args)...);
DCHECK_EQ(op->type, static_cast<uint32_t>(T::kType));
op->skip = skip;
AnalyzeAddedOp(op);
diff --git a/chromium/cc/tiles/gpu_image_decode_cache.cc b/chromium/cc/tiles/gpu_image_decode_cache.cc
index 016a7c4ba31..3d246efa630 100644
--- a/chromium/cc/tiles/gpu_image_decode_cache.cc
+++ b/chromium/cc/tiles/gpu_image_decode_cache.cc
@@ -3002,7 +3002,7 @@ sk_sp<SkImage> GpuImageDecodeCache::CreateImageFromYUVATexturesInternal(
DCHECK(uploaded_y_image);
DCHECK(uploaded_u_image);
DCHECK(uploaded_v_image);
- SkYUVAInfo yuva_info({image_width, image_height}, yuva_planar_config,
+ SkYUVAInfo yuva_info({int(image_width), int(image_height)}, yuva_planar_config,
yuv_color_space);
GrBackendTexture yuv_textures[3]{};
yuv_textures[0] = uploaded_y_image->getBackendTexture(false);
diff --git a/chromium/components/crx_file/crx_creator.cc b/chromium/components/crx_file/crx_creator.cc
index 8ec6bb3691e..c37b680071f 100644
--- a/chromium/components/crx_file/crx_creator.cc
+++ b/chromium/components/crx_file/crx_creator.cc
@@ -74,8 +74,8 @@ CreatorResult Create(const base::FilePath& output_path,
signed_header_data.SerializeAsString();
const int signed_header_size = signed_header_data_str.size();
const uint8_t signed_header_size_octets[] = {
- signed_header_size, signed_header_size >> 8, signed_header_size >> 16,
- signed_header_size >> 24};
+ uint8_t(signed_header_size), uint8_t(signed_header_size >> 8),
+ uint8_t(signed_header_size >> 16), uint8_t(signed_header_size >> 24)};
// Create a signer, init with purpose, SignedData length, run SignedData
// through, run ZIP through.
@@ -104,8 +104,9 @@ CreatorResult Create(const base::FilePath& output_path,
header.set_signed_header_data(signed_header_data_str);
const std::string header_str = header.SerializeAsString();
const int header_size = header_str.size();
- const uint8_t header_size_octets[] = {header_size, header_size >> 8,
- header_size >> 16, header_size >> 24};
+ const uint8_t header_size_octets[] = {
+ uint8_t(header_size), uint8_t(header_size >> 8),
+ uint8_t(header_size >> 16), uint8_t(header_size >> 24)};
// Write CRX.
const uint8_t format_version_octets[] = {3, 0, 0, 0};
diff --git a/chromium/components/crx_file/crx_verifier.cc b/chromium/components/crx_file/crx_verifier.cc
index 1f523a7f6e6..cbd7d777b6a 100644
--- a/chromium/components/crx_file/crx_verifier.cc
+++ b/chromium/components/crx_file/crx_verifier.cc
@@ -125,8 +125,8 @@ VerifierResult VerifyCrx3(
// Create a little-endian representation of [signed-header-size].
const int signed_header_size = signed_header_data_str.size();
const uint8_t header_size_octets[] = {
- signed_header_size, signed_header_size >> 8, signed_header_size >> 16,
- signed_header_size >> 24};
+ uint8_t(signed_header_size), uint8_t(signed_header_size >> 8),
+ uint8_t(signed_header_size >> 16), uint8_t(signed_header_size >> 24)};
// Create a set of all required key hashes.
std::set<std::vector<uint8_t>> required_key_set(required_key_hashes.begin(),
diff --git a/chromium/components/pdf/renderer/pdf_ax_action_target.cc b/chromium/components/pdf/renderer/pdf_ax_action_target.cc
index 2bea222fab5..97123a810b5 100644
--- a/chromium/components/pdf/renderer/pdf_ax_action_target.cc
+++ b/chromium/components/pdf/renderer/pdf_ax_action_target.cc
@@ -177,10 +177,10 @@ bool PdfAXActionTarget::ScrollToMakeVisibleWithSubFocus(
pdf_action_data.vertical_scroll_alignment =
ConvertAXScrollToPdfScrollAlignment(vertical_scroll_alignment);
pdf_action_data.target_rect = {
- {target_plugin_node_.data().relative_bounds.bounds.x(),
- target_plugin_node_.data().relative_bounds.bounds.y()},
- {target_plugin_node_.data().relative_bounds.bounds.width(),
- target_plugin_node_.data().relative_bounds.bounds.height()}};
+ {int32_t(target_plugin_node_.data().relative_bounds.bounds.x()),
+ int32_t(target_plugin_node_.data().relative_bounds.bounds.y())},
+ {int32_t(target_plugin_node_.data().relative_bounds.bounds.width()),
+ int32_t(target_plugin_node_.data().relative_bounds.bounds.height())}};
pdf_accessibility_tree_source_->HandleAction(pdf_action_data);
return true;
}
@@ -191,10 +191,10 @@ bool PdfAXActionTarget::ScrollToGlobalPoint(const gfx::Point& point) const {
PP_PdfAccessibilityAction::PP_PDF_SCROLL_TO_GLOBAL_POINT;
pdf_action_data.target_point = {point.x(), point.y()};
pdf_action_data.target_rect = {
- {target_plugin_node_.data().relative_bounds.bounds.x(),
- target_plugin_node_.data().relative_bounds.bounds.y()},
- {target_plugin_node_.data().relative_bounds.bounds.width(),
- target_plugin_node_.data().relative_bounds.bounds.height()}};
+ {int32_t(target_plugin_node_.data().relative_bounds.bounds.x()),
+ int32_t(target_plugin_node_.data().relative_bounds.bounds.y())},
+ {int32_t(target_plugin_node_.data().relative_bounds.bounds.width()),
+ int32_t(target_plugin_node_.data().relative_bounds.bounds.height())}};
pdf_accessibility_tree_source_->HandleAction(pdf_action_data);
return true;
}
diff --git a/chromium/components/viz/common/gl_scaler.cc b/chromium/components/viz/common/gl_scaler.cc
index 129fc129987..5d97d3384e4 100644
--- a/chromium/components/viz/common/gl_scaler.cc
+++ b/chromium/components/viz/common/gl_scaler.cc
@@ -1408,8 +1408,8 @@ void GLScaler::ScalerStage::ScaleToMultipleOutputs(
gfx::RectF GLScaler::ScalerStage::ToSourceRect(
const gfx::Rect& output_rect) const {
return gfx::ScaleRect(gfx::RectF(output_rect),
- float{scale_from_.x()} / scale_to_.x(),
- float{scale_from_.y()} / scale_to_.y());
+ float(scale_from_.x()) / scale_to_.x(),
+ float(scale_from_.y()) / scale_to_.y());
}
gfx::Rect GLScaler::ScalerStage::ToInputRect(gfx::RectF source_rect) const {
diff --git a/chromium/content/browser/accessibility/browser_accessibility.cc b/chromium/content/browser/accessibility/browser_accessibility.cc
index 9ba15631190..b10fe9f9ca2 100644
--- a/chromium/content/browser/accessibility/browser_accessibility.cc
+++ b/chromium/content/browser/accessibility/browser_accessibility.cc
@@ -1384,12 +1384,12 @@ const ui::AXTree::Selection BrowserAccessibility::GetUnignoredSelection()
manager()->GetFromID(selection.anchor_object_id);
if (anchor_object && !anchor_object->PlatformIsLeaf()) {
DCHECK_GE(selection.anchor_offset, 0);
- if (size_t{selection.anchor_offset} <
+ if (size_t(selection.anchor_offset) <
anchor_object->node()->children().size()) {
const ui::AXNode* anchor_child =
anchor_object->node()->children()[selection.anchor_offset];
DCHECK(anchor_child);
- selection.anchor_offset = int{anchor_child->GetUnignoredIndexInParent()};
+ selection.anchor_offset = int(anchor_child->GetUnignoredIndexInParent());
} else {
selection.anchor_offset = anchor_object->GetChildCount();
}
@@ -1399,12 +1399,12 @@ const ui::AXTree::Selection BrowserAccessibility::GetUnignoredSelection()
manager()->GetFromID(selection.focus_object_id);
if (focus_object && !focus_object->PlatformIsLeaf()) {
DCHECK_GE(selection.focus_offset, 0);
- if (size_t{selection.focus_offset} <
+ if (size_t(selection.focus_offset) <
focus_object->node()->children().size()) {
const ui::AXNode* focus_child =
focus_object->node()->children()[selection.focus_offset];
DCHECK(focus_child);
- selection.focus_offset = int{focus_child->GetUnignoredIndexInParent()};
+ selection.focus_offset = int(focus_child->GetUnignoredIndexInParent());
} else {
selection.focus_offset = focus_object->GetChildCount();
}
@@ -1440,7 +1440,7 @@ gfx::NativeViewAccessible BrowserAccessibility::GetParent() {
}
int BrowserAccessibility::GetChildCount() const {
- return int{PlatformChildCount()};
+ return int(PlatformChildCount());
}
gfx::NativeViewAccessible BrowserAccessibility::ChildAtIndex(int index) {
@@ -1818,16 +1818,16 @@ bool BrowserAccessibility::AccessibilityPerformAction(
if (!anchor_object->PlatformIsLeaf()) {
DCHECK_GE(selection.anchor_offset, 0);
const BrowserAccessibility* anchor_child =
- anchor_object->InternalGetChild(uint32_t{selection.anchor_offset});
+ anchor_object->InternalGetChild(uint32_t(selection.anchor_offset));
if (anchor_child) {
selection.anchor_offset =
- int{anchor_child->node()->index_in_parent()};
+ int(anchor_child->node()->index_in_parent());
selection.anchor_node_id = anchor_child->node()->parent()->id();
} else {
// Since the child was not found, the only alternative is that this is
// an "after children" position.
selection.anchor_offset =
- int{anchor_object->node()->children().size()};
+ int(anchor_object->node()->children().size());
}
}
@@ -1837,14 +1837,14 @@ bool BrowserAccessibility::AccessibilityPerformAction(
if (!focus_object->PlatformIsLeaf()) {
DCHECK_GE(selection.focus_offset, 0);
const BrowserAccessibility* focus_child =
- focus_object->InternalGetChild(uint32_t{selection.focus_offset});
+ focus_object->InternalGetChild(uint32_t(selection.focus_offset));
if (focus_child) {
- selection.focus_offset = int{focus_child->node()->index_in_parent()};
+ selection.focus_offset = int(focus_child->node()->index_in_parent());
selection.focus_node_id = focus_child->node()->parent()->id();
} else {
// Since the child was not found, the only alternative is that this is
// an "after children" position.
- selection.focus_offset = int{focus_object->node()->children().size()};
+ selection.focus_offset = int(focus_object->node()->children().size());
}
}
diff --git a/chromium/content/browser/accessibility/browser_accessibility_manager.cc b/chromium/content/browser/accessibility/browser_accessibility_manager.cc
index 572b0e94433..e891c6ea4d1 100644
--- a/chromium/content/browser/accessibility/browser_accessibility_manager.cc
+++ b/chromium/content/browser/accessibility/browser_accessibility_manager.cc
@@ -438,7 +438,7 @@ bool BrowserAccessibilityManager::OnAccessibilityEvents(
// means a node just got repeated or something harmless like that,
// but it should still be investigated and could be the sign of a
// performance issue.
- DCHECK_LE(int{tree_update.nodes.size()}, ax_tree()->size());
+ DCHECK_LE(int(tree_update.nodes.size()), ax_tree()->size());
}
// If this page is hidden by an interstitial, suppress all events.
diff --git a/chromium/content/browser/download/download_manager_impl.cc b/chromium/content/browser/download/download_manager_impl.cc
index ff135b7f253..697ad165ee7 100644
--- a/chromium/content/browser/download/download_manager_impl.cc
+++ b/chromium/content/browser/download/download_manager_impl.cc
@@ -1269,7 +1269,7 @@ void DownloadManagerImpl::BeginResourceDownloadOnChecksComplete(
}
}
- DCHECK_EQ(params->url().SchemeIsBlob(), bool{blob_url_loader_factory});
+ DCHECK_EQ(params->url().SchemeIsBlob(), bool(blob_url_loader_factory));
std::unique_ptr<network::PendingSharedURLLoaderFactory>
pending_url_loader_factory;
if (blob_url_loader_factory) {
diff --git a/chromium/content/renderer/pepper/pepper_plugin_instance_impl.cc b/chromium/content/renderer/pepper/pepper_plugin_instance_impl.cc
index 9692196ee87..d0fbb170cad 100644
--- a/chromium/content/renderer/pepper/pepper_plugin_instance_impl.cc
+++ b/chromium/content/renderer/pepper/pepper_plugin_instance_impl.cc
@@ -1887,7 +1887,7 @@ void PepperPluginInstanceImpl::PrintPage(int page_number,
metafile_ = metafile;
}
- PP_PrintPageNumberRange_Dev page_range = {page_number, page_number};
+ PP_PrintPageNumberRange_Dev page_range = {uint32_t(page_number), uint32_t(page_number)};
ranges_.push_back(page_range);
#endif
}
diff --git a/chromium/device/fido/public_key_credential_params.cc b/chromium/device/fido/public_key_credential_params.cc
index bca368af5eb..cec6f9008dc 100644
--- a/chromium/device/fido/public_key_credential_params.cc
+++ b/chromium/device/fido/public_key_credential_params.cc
@@ -39,7 +39,8 @@ PublicKeyCredentialParams::CreateFromCBORValue(const cbor::Value& cbor_value) {
}
credential_params.push_back(PublicKeyCredentialParams::CredentialInfo{
- CredentialType::kPublicKey, algorithm_type_it->second.GetInteger()});
+ CredentialType::kPublicKey,
+ static_cast<int>(algorithm_type_it->second.GetInteger())});
}
return PublicKeyCredentialParams(std::move(credential_params));
diff --git a/chromium/device/fido/win/type_conversions.cc b/chromium/device/fido/win/type_conversions.cc
index 270bdbbdce1..39efbbd1014 100644
--- a/chromium/device/fido/win/type_conversions.cc
+++ b/chromium/device/fido/win/type_conversions.cc
@@ -171,7 +171,7 @@ std::vector<WEBAUTHN_CREDENTIAL> ToWinCredentialVector(
}
result.push_back(WEBAUTHN_CREDENTIAL{
WEBAUTHN_CREDENTIAL_CURRENT_VERSION,
- credential.id().size(),
+ DWORD(credential.id().size()),
const_cast<unsigned char*>(credential.id().data()),
WEBAUTHN_CREDENTIAL_TYPE_PUBLIC_KEY,
});
@@ -187,7 +187,7 @@ std::vector<WEBAUTHN_CREDENTIAL_EX> ToWinCredentialExVector(
continue;
}
result.push_back(WEBAUTHN_CREDENTIAL_EX{
- WEBAUTHN_CREDENTIAL_EX_CURRENT_VERSION, credential.id().size(),
+ WEBAUTHN_CREDENTIAL_EX_CURRENT_VERSION, DWORD(credential.id().size()),
const_cast<unsigned char*>(credential.id().data()),
WEBAUTHN_CREDENTIAL_TYPE_PUBLIC_KEY,
ToWinTransportsMask(credential.transports())});
diff --git a/chromium/device/fido/win/webauthn_api.cc b/chromium/device/fido/win/webauthn_api.cc
index b1483525ddd..16ee95dba7e 100644
--- a/chromium/device/fido/win/webauthn_api.cc
+++ b/chromium/device/fido/win/webauthn_api.cc
@@ -293,7 +293,7 @@ AuthenticatorMakeCredentialBlocking(WinWebAuthnApi* webauthn_api,
kWinWebAuthnTimeoutMilliseconds,
WEBAUTHN_CREDENTIALS{
0, nullptr}, // Ignored because pExcludeCredentialList is set.
- WEBAUTHN_EXTENSIONS{extensions.size(), extensions.data()},
+ WEBAUTHN_EXTENSIONS{DWORD(extensions.size()), extensions.data()},
authenticator_attachment,
request.resident_key_required,
ToWinUserVerificationRequirement(request.user_verification),
@@ -401,7 +401,7 @@ AuthenticatorGetAssertionBlocking(WinWebAuthnApi* webauthn_api,
// As a workaround, MS tells us to also set the CredentialList
// parameter with an accurate cCredentials count and some arbitrary
// pCredentials data.
- WEBAUTHN_CREDENTIALS{legacy_credentials.size(),
+ WEBAUTHN_CREDENTIALS{DWORD(legacy_credentials.size()),
legacy_credentials.data()},
WEBAUTHN_EXTENSIONS{0, nullptr},
authenticator_attachment,
diff --git a/chromium/device/gamepad/dualshock4_controller.cc b/chromium/device/gamepad/dualshock4_controller.cc
index 63fc079d377..3ee4c38abe2 100644
--- a/chromium/device/gamepad/dualshock4_controller.cc
+++ b/chromium/device/gamepad/dualshock4_controller.cc
@@ -233,8 +233,8 @@ void Dualshock4Controller::SetVibrationUsb(double strong_magnitude,
control_report.fill(0);
control_report[0] = kReportId05;
control_report[1] = 0x01; // motor only, don't update LEDs
- control_report[4] = uint8_t{weak_magnitude * kRumbleMagnitudeMax};
- control_report[5] = uint8_t{strong_magnitude * kRumbleMagnitudeMax};
+ control_report[4] = uint8_t(weak_magnitude * kRumbleMagnitudeMax);
+ control_report[5] = uint8_t(strong_magnitude * kRumbleMagnitudeMax);
writer_->WriteOutputReport(control_report);
}
@@ -252,8 +252,8 @@ void Dualshock4Controller::SetVibrationBluetooth(double strong_magnitude,
control_report[2] = 0x20; // unknown
control_report[3] = 0xf1; // motor only, don't update LEDs
control_report[4] = 0x04; // unknown
- control_report[6] = uint8_t{weak_magnitude * kRumbleMagnitudeMax};
- control_report[7] = uint8_t{strong_magnitude * kRumbleMagnitudeMax};
+ control_report[6] = uint8_t(weak_magnitude * kRumbleMagnitudeMax);
+ control_report[7] = uint8_t(strong_magnitude * kRumbleMagnitudeMax);
control_report[21] = 0x43; // volume left
control_report[22] = 0x43; // volume right
control_report[24] = 0x4d; // volume speaker
diff --git a/chromium/device/gamepad/gamepad_device_linux.cc b/chromium/device/gamepad/gamepad_device_linux.cc
index 0fea217fec2..1a7d7d1195d 100644
--- a/chromium/device/gamepad/gamepad_device_linux.cc
+++ b/chromium/device/gamepad/gamepad_device_linux.cc
@@ -393,7 +393,7 @@ bool GamepadDeviceLinux::ReadEvdevSpecialKeys(Gamepad* pad) {
ssize_t bytes_read;
while ((bytes_read = HANDLE_EINTR(
read(evdev_fd_.get(), &ev, sizeof(input_event)))) > 0) {
- if (size_t{bytes_read} < sizeof(input_event))
+ if (size_t(bytes_read) < sizeof(input_event))
break;
if (ev.type != EV_KEY)
continue;
diff --git a/chromium/device/gamepad/gamepad_uma.cc b/chromium/device/gamepad/gamepad_uma.cc
index eea53e55bd3..9fb930a1f41 100644
--- a/chromium/device/gamepad/gamepad_uma.cc
+++ b/chromium/device/gamepad/gamepad_uma.cc
@@ -19,7 +19,7 @@ void RecordConnectedGamepad(GamepadId gamepad_id) {
auto gamepad_id_as_underlying_type =
static_cast<std::underlying_type<GamepadId>::type>(gamepad_id);
base::UmaHistogramSparse("Gamepad.KnownGamepadConnectedWithId",
- int32_t{gamepad_id_as_underlying_type});
+ int32_t(gamepad_id_as_underlying_type));
}
void RecordUnknownGamepad(GamepadSource source) {
diff --git a/chromium/device/gamepad/nintendo_controller.cc b/chromium/device/gamepad/nintendo_controller.cc
index 66c0a0c8509..fc1558b9f61 100644
--- a/chromium/device/gamepad/nintendo_controller.cc
+++ b/chromium/device/gamepad/nintendo_controller.cc
@@ -1549,7 +1549,7 @@ void NintendoController::SubCommand(uint8_t sub_command,
// Serial subcommands also carry vibration data. Configure the vibration
// portion of the report for a neutral vibration effect (zero amplitude).
// https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/blob/master/bluetooth_hid_notes.md#output-0x12
- report_bytes[0] = uint8_t{output_report_counter_++ & 0xff};
+ report_bytes[0] = uint8_t(output_report_counter_++ & 0xff);
report_bytes[1] = 0x00;
report_bytes[2] = 0x01;
report_bytes[3] = 0x40;
@@ -1603,7 +1603,7 @@ void NintendoController::RequestVibration(double left_frequency,
FrequencyToHex(left_frequency, left_magnitude, &lhf, &llf, &lhfa, &llfa);
FrequencyToHex(right_frequency, right_magnitude, &rhf, &rlf, &rhfa, &rlfa);
std::vector<uint8_t> report_bytes(output_report_size_bytes_ - 1);
- uint8_t counter = uint8_t{output_report_counter_++ & 0x0f};
+ uint8_t counter = uint8_t(output_report_counter_++ & 0x0f);
report_bytes[0] = counter;
report_bytes[1] = lhf & 0xff;
report_bytes[2] = lhfa + ((lhf >> 8) & 0xff);
@@ -1630,11 +1630,11 @@ void NintendoController::RequestEnableUsbTimeout(bool enable) {
}
void NintendoController::RequestEnableImu(bool enable) {
- SubCommand(kSubCommandEnableImu, {enable ? 0x01 : 0x00});
+ SubCommand(kSubCommandEnableImu, {uint8_t(enable ? 0x01 : 0x00)});
}
void NintendoController::RequestEnableVibration(bool enable) {
- SubCommand(kSubCommandEnableVibration, {enable ? 0x01 : 0x00});
+ SubCommand(kSubCommandEnableVibration, {uint8_t(enable ? 0x01 : 0x00)});
}
void NintendoController::RequestSetPlayerLights(uint8_t light_pattern) {
@@ -1653,8 +1653,8 @@ void NintendoController::RequestSetHomeLight(
DCHECK_LE(cycle_count, 0xf);
if ((cycle_count > 0 && minicycle_count == 1) || minicycle_duration == 0)
minicycle_count = 0;
- std::vector<uint8_t> bytes = {(minicycle_count << 4) | minicycle_duration,
- (start_intensity << 4) | cycle_count};
+ std::vector<uint8_t> bytes = {uint8_t((minicycle_count << 4) | minicycle_duration),
+ uint8_t((start_intensity << 4) | cycle_count)};
bytes.insert(bytes.end(), minicycle_data.begin(), minicycle_data.end());
SubCommand(kSubCommandSetHomeLight, bytes);
}
@@ -1671,7 +1671,7 @@ void NintendoController::RequestSetHomeLightIntensity(double intensity) {
// 1x minicycle duration. Because |minicycle_count| and |cycle_count| are
// both zero, the device will transition to the 1st minicycle and then stay at
// |led_intensity|.
- RequestSetHomeLight(0, 1, led_intensity, 0, {led_intensity << 4, 0x00});
+ RequestSetHomeLight(0, 1, led_intensity, 0, {uint8_t(led_intensity << 4), 0x00});
}
void NintendoController::RequestSetImuSensitivity(
@@ -1694,7 +1694,7 @@ void NintendoController::ReadSpi(uint16_t address, size_t length) {
uint8_t address_high = (address >> 8) & 0xff;
uint8_t address_low = address & 0xff;
SubCommand(kSubCommandReadSpi,
- {address_low, address_high, 0x00, 0x00, uint8_t{length}});
+ {address_low, address_high, 0x00, 0x00, uint8_t(length)});
}
void NintendoController::RequestImuCalibration() {
diff --git a/chromium/device/gamepad/raw_input_gamepad_device_win.cc b/chromium/device/gamepad/raw_input_gamepad_device_win.cc
index 57473ca36e3..950845b3805 100644
--- a/chromium/device/gamepad/raw_input_gamepad_device_win.cc
+++ b/chromium/device/gamepad/raw_input_gamepad_device_win.cc
@@ -152,7 +152,7 @@ void RawInputGamepadDeviceWin::UpdateGamepad(RAWINPUT* input) {
uint16_t usage_page = usages[j].UsagePage;
uint16_t usage = usages[j].Usage;
if (usage_page == kButtonUsagePage && usage > 0) {
- size_t button_index = size_t{usage - 1};
+ size_t button_index = size_t(usage - 1);
if (button_index < Gamepad::kButtonsLengthCap)
buttons_[button_index] = true;
} else if (usage_page != kButtonUsagePage &&
@@ -428,8 +428,8 @@ void RawInputGamepadDeviceWin::QueryNormalButtonCapabilities(
uint16_t usage_max = button_caps[i].Range.UsageMax;
if (usage_min == 0 || usage_max == 0)
continue;
- size_t button_index_min = size_t{usage_min - 1};
- size_t button_index_max = size_t{usage_max - 1};
+ size_t button_index_min = size_t(usage_min - 1);
+ size_t button_index_max = size_t(usage_max - 1);
if (usage_page == kButtonUsagePage &&
button_index_min < Gamepad::kButtonsLengthCap) {
button_index_max =
diff --git a/chromium/device/gamepad/raw_input_gamepad_device_win.h b/chromium/device/gamepad/raw_input_gamepad_device_win.h
index 60a90b15826..5c4ce1c7d4b 100644
--- a/chromium/device/gamepad/raw_input_gamepad_device_win.h
+++ b/chromium/device/gamepad/raw_input_gamepad_device_win.h
@@ -128,7 +128,7 @@ class RawInputGamepadDeviceWin final : public AbstractHapticGamepad {
bool buttons_[Gamepad::kButtonsLengthCap];
// Keep track of which button indices are in use.
- std::vector<bool> button_indices_used_{Gamepad::kButtonsLengthCap, false};
+ std::vector<bool> button_indices_used_{(Gamepad::kButtonsLengthCap != 0), false};
// Bitfield to keep track of which axes indices are in use.
uint32_t axes_used_ = 0;
diff --git a/chromium/extensions/browser/blob_reader.cc b/chromium/extensions/browser/blob_reader.cc
index d311c704af1..5a0f73c540a 100644
--- a/chromium/extensions/browser/blob_reader.cc
+++ b/chromium/extensions/browser/blob_reader.cc
@@ -22,7 +22,7 @@ void BlobReader::Read(content::BrowserContext* browser_context,
CHECK_GT(length, 0);
CHECK_LE(offset, std::numeric_limits<int64_t>::max() - length);
- base::Optional<Range> range = Range{offset, length};
+ base::Optional<Range> range = Range{uint64_t(offset), uint64_t(length)};
Read(browser_context, blob_uuid, std::move(callback), std::move(range));
}
diff --git a/chromium/extensions/renderer/api/automation/automation_internal_custom_bindings.cc b/chromium/extensions/renderer/api/automation/automation_internal_custom_bindings.cc
index 298144b377e..465a092edb2 100644
--- a/chromium/extensions/renderer/api/automation/automation_internal_custom_bindings.cc
+++ b/chromium/extensions/renderer/api/automation/automation_internal_custom_bindings.cc
@@ -863,14 +863,14 @@ void AutomationInternalCustomBindings::AddRoutes() {
else
child_count = node->GetUnignoredChildCount();
- result.Set(v8::Integer::New(isolate, int32_t{child_count}));
+ result.Set(v8::Integer::New(isolate, int32_t(child_count)));
});
RouteNodeIDFunction(
"GetIndexInParent",
[](v8::Isolate* isolate, v8::ReturnValue<v8::Value> result,
AutomationAXTreeWrapper* tree_wrapper, ui::AXNode* node) {
result.Set(v8::Integer::New(
- isolate, int32_t{node->GetUnignoredIndexInParent()}));
+ isolate, int32_t(node->GetUnignoredIndexInParent())));
});
RouteNodeIDFunction(
"GetRole", [](v8::Isolate* isolate, v8::ReturnValue<v8::Value> result,
@@ -2259,10 +2259,10 @@ void AutomationInternalCustomBindings::GetChildIDAtIndex(
// Check for a child tree, which is guaranteed to always be the only child.
if (index == 0 && GetRootOfChildTree(&node, &tree_wrapper))
child_id = node->id();
- else if (index < 0 || size_t{index} >= node->GetUnignoredChildCount())
+ else if (index < 0 || size_t(index) >= node->GetUnignoredChildCount())
return;
else
- child_id = node->GetUnignoredChildAtIndex(size_t{index})->id();
+ child_id = node->GetUnignoredChildAtIndex(size_t(index))->id();
gin::DataObjectBuilder response(GetIsolate());
response.Set("treeId", tree_wrapper->GetTreeID().ToString());
diff --git a/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc b/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 5bc332abfa0..edb36bc442e 100644
--- a/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/chromium/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -15265,7 +15265,7 @@ error::Error GLES2DecoderImpl::HandleTexImage2D(uint32_t immediate_data_size,
texture_state_.tex_image_failed = true;
GLenum target = static_cast<GLenum>(c.target);
GLint level = static_cast<GLint>(c.level);
- GLint internal_format = static_cast<GLint>(c.internalformat);
+ GLenum internal_format = static_cast<GLenum>(c.internalformat);
GLsizei width = static_cast<GLsizei>(c.width);
GLsizei height = static_cast<GLsizei>(c.height);
GLint border = static_cast<GLint>(c.border);
@@ -15372,7 +15372,7 @@ error::Error GLES2DecoderImpl::HandleTexImage3D(uint32_t immediate_data_size,
texture_state_.tex_image_failed = true;
GLenum target = static_cast<GLenum>(c.target);
GLint level = static_cast<GLint>(c.level);
- GLint internal_format = static_cast<GLint>(c.internalformat);
+ GLenum internal_format = static_cast<GLenum>(c.internalformat);
GLsizei width = static_cast<GLsizei>(c.width);
GLsizei height = static_cast<GLsizei>(c.height);
GLsizei depth = static_cast<GLsizei>(c.depth);
diff --git a/chromium/gpu/vulkan/vulkan_swap_chain.cc b/chromium/gpu/vulkan/vulkan_swap_chain.cc
index dd51c61fb95..1c5b93e07dc 100644
--- a/chromium/gpu/vulkan/vulkan_swap_chain.cc
+++ b/chromium/gpu/vulkan/vulkan_swap_chain.cc
@@ -182,23 +182,21 @@ bool VulkanSwapChain::InitializeSwapChain(
VkDevice device = device_queue_->GetVulkanDevice();
VkResult result = VK_SUCCESS;
- VkSwapchainCreateInfoKHR swap_chain_create_info = {
- .sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR,
- .flags = use_protected_memory ? VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR : 0,
- .surface = surface,
- .minImageCount = min_image_count,
- .imageFormat = surface_format.format,
- .imageColorSpace = surface_format.colorSpace,
- .imageExtent = {image_size.width(), image_size.height()},
- .imageArrayLayers = 1,
- .imageUsage = image_usage_flags,
- .imageSharingMode = VK_SHARING_MODE_EXCLUSIVE,
- .preTransform = pre_transform,
- .compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR,
- .presentMode = VK_PRESENT_MODE_FIFO_KHR,
- .clipped = VK_TRUE,
- .oldSwapchain = VK_NULL_HANDLE,
- };
+ VkSwapchainCreateInfoKHR swap_chain_create_info = { VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR};
+ swap_chain_create_info.flags = use_protected_memory ? VK_SWAPCHAIN_CREATE_PROTECTED_BIT_KHR : 0;
+ swap_chain_create_info.surface = surface;
+ swap_chain_create_info.minImageCount = min_image_count;
+ swap_chain_create_info.imageFormat = surface_format.format;
+ swap_chain_create_info.imageColorSpace = surface_format.colorSpace;
+ swap_chain_create_info.imageExtent = {(uint32_t)image_size.width(), (uint32_t)image_size.height()};
+ swap_chain_create_info.imageArrayLayers = 1;
+ swap_chain_create_info.imageUsage = image_usage_flags;
+ swap_chain_create_info.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE;
+ swap_chain_create_info.preTransform = pre_transform;
+ swap_chain_create_info.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR;
+ swap_chain_create_info.presentMode = VK_PRESENT_MODE_FIFO_KHR;
+ swap_chain_create_info.clipped = VK_TRUE;
+ swap_chain_create_info.oldSwapchain = VK_NULL_HANDLE;
if (LIKELY(old_swap_chain)) {
base::AutoLock auto_lock(old_swap_chain->lock_);
diff --git a/chromium/media/mojo/common/mojo_shared_buffer_video_frame.cc b/chromium/media/mojo/common/mojo_shared_buffer_video_frame.cc
index 649be420285..5f7685e7381 100644
--- a/chromium/media/mojo/common/mojo_shared_buffer_video_frame.cc
+++ b/chromium/media/mojo/common/mojo_shared_buffer_video_frame.cc
@@ -61,7 +61,7 @@ MojoSharedBufferVideoFrame::CreateDefaultForTesting(
return Create(
format, coded_size, visible_rect, dimensions, std::move(handle),
allocation_size,
- {0 /* y_offset */, coded_size.GetArea(), coded_size.GetArea() * 5 / 4},
+ {0 /* y_offset */, uint32_t(coded_size.GetArea()), uint32_t(coded_size.GetArea() * 5 / 4)},
{coded_size.width(), coded_size.width() / 2, coded_size.width() / 2},
timestamp);
} else {
@@ -73,7 +73,7 @@ MojoSharedBufferVideoFrame::CreateDefaultForTesting(
// - UVplane, full width, half height (each pair represents a 2x2 block)
return Create(format, coded_size, visible_rect, dimensions,
std::move(handle), allocation_size,
- {0 /* y_offset */, coded_size.GetArea()},
+ {0 /* y_offset */, uint32_t(coded_size.GetArea())},
{coded_size.width(), coded_size.width()}, timestamp);
}
}
diff --git a/chromium/media/mojo/services/mojo_cdm_allocator.cc b/chromium/media/mojo/services/mojo_cdm_allocator.cc
index f0b6d97c91a..a6d41d80e8d 100644
--- a/chromium/media/mojo/services/mojo_cdm_allocator.cc
+++ b/chromium/media/mojo/services/mojo_cdm_allocator.cc
@@ -141,7 +141,7 @@ class MojoCdmVideoFrame final : public VideoFrameImpl {
natural_size, std::move(handle), buffer_size,
{PlaneOffset(cdm::kYPlane), PlaneOffset(cdm::kUPlane),
PlaneOffset(cdm::kVPlane)},
- {Stride(cdm::kYPlane), Stride(cdm::kUPlane), Stride(cdm::kVPlane)},
+ {int(Stride(cdm::kYPlane)), int(Stride(cdm::kUPlane)), int(Stride(cdm::kVPlane))},
base::TimeDelta::FromMicroseconds(Timestamp()));
// |frame| could fail to be created if the memory can't be mapped into
diff --git a/chromium/media/renderers/win/media_foundation_audio_stream.cc b/chromium/media/renderers/win/media_foundation_audio_stream.cc
index 68f4485e6c3..1e7b23445bb 100644
--- a/chromium/media/renderers/win/media_foundation_audio_stream.cc
+++ b/chromium/media/renderers/win/media_foundation_audio_stream.cc
@@ -170,7 +170,7 @@ HRESULT GetAacAudioType(const AudioDecoderConfig decoder_config,
aac_wave_format->wfx.nBlockAlign = 1;
size_t extra_size = wave_format_size - sizeof(WAVEFORMATEX);
- aac_wave_format->wfx.cbSize = WORD{extra_size};
+ aac_wave_format->wfx.cbSize = (WORD)extra_size;
aac_wave_format->wPayloadType = 0; // RAW AAC
aac_wave_format->wAudioProfileLevelIndication =
0xFE; // no audio profile specified
diff --git a/chromium/media/renderers/win/media_foundation_renderer.cc b/chromium/media/renderers/win/media_foundation_renderer.cc
index 97d50caf4dc..d186012ea16 100644
--- a/chromium/media/renderers/win/media_foundation_renderer.cc
+++ b/chromium/media/renderers/win/media_foundation_renderer.cc
@@ -600,7 +600,7 @@ void MediaFoundationRenderer::OnVideoNaturalSizeChange() {
<< hr;
native_video_size_ = {640, 320};
} else {
- native_video_size_ = {native_width, native_height};
+ native_video_size_ = {int(native_width), int(native_height)};
}
// TODO(frankli): Use actual dest rect provided by client instead of video
diff --git a/chromium/media/video/openh264_video_encoder.cc b/chromium/media/video/openh264_video_encoder.cc
index 05abf97b4f4..9195effd04b 100644
--- a/chromium/media/video/openh264_video_encoder.cc
+++ b/chromium/media/video/openh264_video_encoder.cc
@@ -37,8 +37,8 @@ Status SetUpOpenH264Params(const VideoEncoder::Options& options,
if (options.bitrate.has_value()) {
params->iRCMode = RC_BITRATE_MODE;
- params->iTargetBitrate = int{std::min(
- options.bitrate.value(), uint64_t{std::numeric_limits<int>::max()})};
+ params->iTargetBitrate = (int)std::min(
+ options.bitrate.value(), uint64_t{std::numeric_limits<int>::max()});
} else {
params->iRCMode = RC_OFF_MODE;
}
diff --git a/chromium/media/video/video_encode_accelerator_adapter.cc b/chromium/media/video/video_encode_accelerator_adapter.cc
index bdfa80bd994..120d3985b18 100644
--- a/chromium/media/video/video_encode_accelerator_adapter.cc
+++ b/chromium/media/video/video_encode_accelerator_adapter.cc
@@ -88,20 +88,20 @@ class VideoEncodeAcceleratorAdapter::SharedMemoryPool
// Suspiciously many buffers have been allocated already.
return false;
}
- *id = int32_t{regions_.size()} - 1;
+ *id = int32_t(regions_.size()) - 1;
return true;
}
void ReleaseBuffer(int32_t id) { free_buffer_ids_.push_back(id); }
base::WritableSharedMemoryMapping* GetMapping(int32_t buffer_id) {
- if (size_t{buffer_id} >= mappings_.size())
+ if (size_t(buffer_id) >= mappings_.size())
return nullptr;
return &mappings_[buffer_id];
}
base::UnsafeSharedMemoryRegion* GetRegion(int32_t buffer_id) {
- if (size_t{buffer_id} >= regions_.size())
+ if (size_t(buffer_id) >= regions_.size())
return nullptr;
return &regions_[buffer_id];
}
@@ -385,10 +385,10 @@ void VideoEncodeAcceleratorAdapter::ChangeOptionsOnAcceleratorThread(
std::min(options.bitrate.value_or(options.frame_size.width() *
options.frame_size.height() *
kVEADefaultBitratePerPixel),
- uint64_t{std::numeric_limits<uint32_t>::max()});
+ uint64_t(std::numeric_limits<uint32_t>::max()));
- uint32_t framerate = uint32_t{std::round(
- options.framerate.value_or(VideoEncodeAccelerator::kDefaultFramerate))};
+ uint32_t framerate = uint32_t(std::round(
+ options.framerate.value_or(VideoEncodeAccelerator::kDefaultFramerate)));
accelerator_->RequestEncodingParametersChange(bitrate, framerate);
options_ = options;
diff --git a/chromium/media/video/vpx_video_encoder.cc b/chromium/media/video/vpx_video_encoder.cc
index 41a37eba393..df06dcd4b91 100644
--- a/chromium/media/video/vpx_video_encoder.cc
+++ b/chromium/media/video/vpx_video_encoder.cc
@@ -71,7 +71,7 @@ Status SetUpVpxConfig(const VideoEncoder::Options& opts,
} else {
config->rc_end_usage = VPX_VBR;
config->rc_target_bitrate =
- double{opts.frame_size.GetCheckedArea().ValueOrDie()} / config->g_w /
+ double(opts.frame_size.GetCheckedArea().ValueOrDie()) / config->g_w /
config->g_h * config->rc_target_bitrate;
}
diff --git a/chromium/pdf/out_of_process_instance.cc b/chromium/pdf/out_of_process_instance.cc
index cbb4c353403..54a40644a9d 100644
--- a/chromium/pdf/out_of_process_instance.cc
+++ b/chromium/pdf/out_of_process_instance.cc
@@ -2317,11 +2317,11 @@ void OutOfProcessInstance::UserMetricsRecordAction(const std::string& action) {
pp::FloatPoint OutOfProcessInstance::BoundScrollOffsetToDocument(
const pp::FloatPoint& scroll_offset) {
float max_x = std::max(
- document_size_.width() * float{zoom_} - plugin_dip_size_.width(), 0.0f);
+ document_size_.width() * float(zoom_) - plugin_dip_size_.width(), 0.0f);
float x = base::ClampToRange(scroll_offset.x(), 0.0f, max_x);
float min_y = -top_toolbar_height_in_viewport_coords_;
float max_y = std::max(
- document_size_.height() * float{zoom_} - plugin_dip_size_.height(),
+ document_size_.height() * float(zoom_) - plugin_dip_size_.height(),
min_y);
float y = base::ClampToRange(scroll_offset.y(), min_y, max_y);
return pp::FloatPoint(x, y);
diff --git a/chromium/printing/print_settings_conversion.cc b/chromium/printing/print_settings_conversion.cc
index 686a2fa1ab4..c61b3857f75 100644
--- a/chromium/printing/print_settings_conversion.cc
+++ b/chromium/printing/print_settings_conversion.cc
@@ -91,7 +91,7 @@ PageRanges GetPageRangesFromJobSettings(const base::Value& job_settings) {
// Page numbers are 1-based in the dictionary.
// Page numbers are 0-based for the printing context.
- page_ranges.push_back(PageRange{from.value() - 1, to.value() - 1});
+ page_ranges.push_back(PageRange{uint32_t(from.value() - 1), uint32_t(to.value() - 1)});
}
}
return page_ranges;
diff --git a/chromium/services/device/public/cpp/hid/hid_collection.cc b/chromium/services/device/public/cpp/hid/hid_collection.cc
index 9520b7f6b22..f13e2f7e3e1 100644
--- a/chromium/services/device/public/cpp/hid/hid_collection.cc
+++ b/chromium/services/device/public/cpp/hid/hid_collection.cc
@@ -250,7 +250,7 @@ void HidCollection::GetMaxReportSizes(size_t* max_input_report_bits,
}
DCHECK_LE(report_bits, kMaxReasonableReportLengthBits);
entry.max_report_bits =
- std::max(entry.max_report_bits, size_t{report_bits});
+ std::max(entry.max_report_bits, size_t(report_bits));
}
}
}
diff --git a/chromium/services/device/public/cpp/hid/hid_item_state_table.cc b/chromium/services/device/public/cpp/hid/hid_item_state_table.cc
index 6acb2cbf852..fecd901767d 100644
--- a/chromium/services/device/public/cpp/hid/hid_item_state_table.cc
+++ b/chromium/services/device/public/cpp/hid/hid_item_state_table.cc
@@ -58,16 +58,16 @@ void HidItemStateTable::SetItemValue(HidReportDescriptorItem::Tag tag,
global.usage_page = value;
break;
case HidReportDescriptorItem::kTagLogicalMinimum:
- global.logical_minimum = int32_t{value};
+ global.logical_minimum = int32_t(value);
break;
case HidReportDescriptorItem::kTagLogicalMaximum:
- global.logical_maximum = int32_t{value};
+ global.logical_maximum = int32_t(value);
break;
case HidReportDescriptorItem::kTagPhysicalMinimum:
- global.physical_minimum = int32_t{value};
+ global.physical_minimum = int32_t(value);
break;
case HidReportDescriptorItem::kTagPhysicalMaximum:
- global.physical_maximum = int32_t{value};
+ global.physical_maximum = int32_t(value);
break;
case HidReportDescriptorItem::kTagUnitExponent:
global.unit_exponent = value;
diff --git a/chromium/storage/browser/blob/blob_impl.cc b/chromium/storage/browser/blob/blob_impl.cc
index 2d66abcc8a3..f6e384ce7f8 100644
--- a/chromium/storage/browser/blob/blob_impl.cc
+++ b/chromium/storage/browser/blob/blob_impl.cc
@@ -221,7 +221,7 @@ void BlobImpl::CaptureSnapshot(CaptureSnapshotCallback callback) {
}
struct SizeAndTime {
- uint64_t size;
+ int64_t size;
base::Optional<base::Time> time;
};
base::ThreadPool::PostTaskAndReplyWithResult(
diff --git a/chromium/third_party/blink/renderer/core/inspector/inspector_dom_snapshot_agent.cc b/chromium/third_party/blink/renderer/core/inspector/inspector_dom_snapshot_agent.cc
index 4f9894ede77..d40eb80c11e 100644
--- a/chromium/third_party/blink/renderer/core/inspector/inspector_dom_snapshot_agent.cc
+++ b/chromium/third_party/blink/renderer/core/inspector/inspector_dom_snapshot_agent.cc
@@ -60,7 +60,7 @@ std::unique_ptr<protocol::Array<double>> BuildRectForLayout(const int x,
const int width,
const int height) {
return std::make_unique<std::vector<double>, std::initializer_list<double>>(
- {x, y, width, height});
+ {double(x), double(y), double(width), double(height)});
}
Document* GetEmbeddedDocument(PaintLayer* layer) {
diff --git a/chromium/third_party/blink/renderer/core/layout/layout_block_flow_line.cc b/chromium/third_party/blink/renderer/core/layout/layout_block_flow_line.cc
index 9c921d1dff4..3e628c629fd 100644
--- a/chromium/third_party/blink/renderer/core/layout/layout_block_flow_line.cc
+++ b/chromium/third_party/blink/renderer/core/layout/layout_block_flow_line.cc
@@ -60,7 +60,7 @@ class ExpansionOpportunities {
unsigned opportunities_in_run;
if (text.Is8Bit()) {
opportunities_in_run = Character::ExpansionOpportunityCount(
- {text.Characters8() + run.start_, run.stop_ - run.start_},
+ {text.Characters8() + run.start_, size_t(run.stop_ - run.start_)},
run.box_->Direction(), is_after_expansion, text_justify);
} else if (run.line_layout_item_.IsCombineText()) {
// Justfication applies to before and after the combined text as if
@@ -70,7 +70,7 @@ class ExpansionOpportunities {
is_after_expansion = true;
} else {
opportunities_in_run = Character::ExpansionOpportunityCount(
- {text.Characters16() + run.start_, run.stop_ - run.start_},
+ {text.Characters16() + run.start_, size_t(run.stop_ - run.start_)},
run.box_->Direction(), is_after_expansion, text_justify);
}
runs_with_expansions_.push_back(opportunities_in_run);
diff --git a/chromium/third_party/blink/renderer/core/layout/line/abstract_inline_text_box.cc b/chromium/third_party/blink/renderer/core/layout/line/abstract_inline_text_box.cc
index 58258904b29..dc27cd040cc 100644
--- a/chromium/third_party/blink/renderer/core/layout/line/abstract_inline_text_box.cc
+++ b/chromium/third_party/blink/renderer/core/layout/line/abstract_inline_text_box.cc
@@ -174,7 +174,7 @@ unsigned LegacyAbstractInlineTextBox::TextOffsetInFormattingContext(
// return a more exact offset in our formatting context. Otherwise, we need to
// approximate the offset using our associated layout object.
if (node && node->IsTextNode()) {
- const Position position(node, int{offset_in_parent});
+ const Position position(node, int(offset_in_parent));
LayoutBlockFlow* formatting_context =
NGOffsetMapping::GetInlineFormattingContextOf(position);
// If "formatting_context" is not a Layout NG object, the offset mappings
@@ -244,7 +244,7 @@ void AbstractInlineTextBox::GetWordBoundaries(
TextBreakIterator* it = WordBreakIterator(text, 0, text.length());
base::Optional<int> word_start;
- for (int offset = 0; offset != kTextBreakDone && offset < int{text.length()};
+ for (int offset = 0; offset != kTextBreakDone && offset < int(text.length());
offset = it->following(offset)) {
// Unlike in ICU's WordBreakIterator, a word boundary is valid only if it is
// before, or immediately preceded by, an alphanumeric character, a series
diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_inline_text_box.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_inline_text_box.cc
index 2bbb0e49ed3..3d788c8ec04 100644
--- a/chromium/third_party/blink/renderer/modules/accessibility/ax_inline_text_box.cc
+++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_inline_text_box.cc
@@ -99,7 +99,7 @@ void AXInlineTextBox::TextCharacterOffsets(Vector<int>& offsets) const {
Vector<float> widths;
inline_text_box_->CharacterWidths(widths);
- DCHECK_EQ(int{widths.size()}, TextLength());
+ DCHECK_EQ(int(widths.size()), TextLength());
offsets.resize(TextLength());
float width_so_far = 0;
@@ -132,8 +132,8 @@ int AXInlineTextBox::TextOffsetInFormattingContext(int offset) const {
return 0;
// Retrieve the text offset from the start of the layout block flow ancestor.
- return int{inline_text_box_->TextOffsetInFormattingContext(
- static_cast<unsigned int>(offset))};
+ return int(inline_text_box_->TextOffsetInFormattingContext(
+ static_cast<unsigned int>(offset)));
}
int AXInlineTextBox::TextOffsetInContainer(int offset) const {
@@ -354,7 +354,7 @@ bool AXInlineTextBox::IsLineBreakingObject() const {
int AXInlineTextBox::TextLength() const {
if (IsDetached())
return 0;
- return int{inline_text_box_->Len()};
+ return int(inline_text_box_->Len());
}
} // namespace blink
diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_node_object.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
index cfc03288711..d2644e7343c 100644
--- a/chromium/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
+++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_node_object.cc
@@ -3165,7 +3165,7 @@ int AXNodeObject::TextOffsetInFormattingContext(int offset) const {
inline_offset_mapping->GetMappingUnitsForLayoutObject(*layout_obj);
if (mapping_units.empty())
return AXObject::TextOffsetInFormattingContext(offset);
- return int{mapping_units.front().TextContentStart()} + offset;
+ return int(mapping_units.front().TextContentStart()) + offset;
}
//
diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_object.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_object.cc
index a04debe9b6d..facc526d45e 100644
--- a/chromium/third_party/blink/renderer/modules/accessibility/ax_object.cc
+++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_object.cc
@@ -3076,7 +3076,7 @@ AXObject::InOrderTraversalIterator AXObject::GetInOrderTraversalIterator() {
}
int AXObject::ChildCountIncludingIgnored() const {
- return HasIndirectChildren() ? 0 : int{ChildrenIncludingIgnored().size()};
+ return HasIndirectChildren() ? 0 : int(ChildrenIncludingIgnored().size());
}
AXObject* AXObject::ChildAtIncludingIgnored(int index) const {
@@ -3295,12 +3295,12 @@ AXObject* AXObject::PreviousInPostOrderIncludingIgnored(
}
int AXObject::UnignoredChildCount() const {
- return int{UnignoredChildren().size()};
+ return int(UnignoredChildren().size());
}
AXObject* AXObject::UnignoredChildAt(int index) const {
const AXObjectVector unignored_children = UnignoredChildren();
- if (index < 0 || index >= int{unignored_children.size()})
+ if (index < 0 || index >= int(unignored_children.size()))
return nullptr;
return unignored_children[index];
}
@@ -3754,14 +3754,14 @@ int AXObject::AriaRowCount() const {
if (!HasAOMPropertyOrARIAAttribute(AOMIntProperty::kRowCount, row_count))
return 0;
- if (row_count > int{RowCount()})
+ if (row_count > int(RowCount()))
return row_count;
// Spec says that if all of the rows are present in the DOM, it is
// not necessary to set this attribute as the user agent can
// automatically calculate the total number of rows.
// It returns 0 in order not to set this attribute.
- if (row_count == int{RowCount()} || row_count != -1)
+ if (row_count == int(RowCount()) || row_count != -1)
return 0;
// In the spec, -1 explicitly means an unknown number of rows.
diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_position.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_position.cc
index 17268a2b41c..b351d17b6fe 100644
--- a/chromium/third_party/blink/renderer/modules/accessibility/ax_position.cc
+++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_position.cc
@@ -266,9 +266,9 @@ const AXPosition AXPosition::FromPosition(
// same formatting context.
int container_offset = container->TextOffsetInFormattingContext(0);
int text_offset =
- int{container_offset_mapping
+ int(container_offset_mapping
->GetTextContentOffset(parent_anchored_position)
- .value_or(static_cast<unsigned int>(container_offset))} -
+ .value_or(static_cast<unsigned int>(container_offset))) -
container_offset;
DCHECK_GE(text_offset, 0);
ax_position.text_offset_or_child_index_ = text_offset;
@@ -460,8 +460,8 @@ int AXPosition::MaxTextOffset() const {
container_offset_mapping->GetMappingUnitsForNode(*container_node);
if (mapping_units.empty())
return container_object_->ComputedName().length();
- return int{mapping_units.back().TextContentEnd() -
- mapping_units.front().TextContentStart()};
+ return int(mapping_units.back().TextContentEnd() -
+ mapping_units.front().TextContentStart());
}
TextAffinity AXPosition::Affinity() const {
diff --git a/chromium/third_party/blink/renderer/modules/accessibility/ax_selection.cc b/chromium/third_party/blink/renderer/modules/accessibility/ax_selection.cc
index ae9317419bf..91b669bbaac 100644
--- a/chromium/third_party/blink/renderer/modules/accessibility/ax_selection.cc
+++ b/chromium/third_party/blink/renderer/modules/accessibility/ax_selection.cc
@@ -158,13 +158,13 @@ AXSelection AXSelection::FromCurrentSelection(
const bool is_backward = (text_control.selectionDirection() == "backward");
const auto ax_base = AXPosition::CreatePositionInTextObject(
*ax_text_control,
- (is_backward ? int{text_control.selectionEnd()}
- : int{text_control.selectionStart()}),
+ (is_backward ? int(text_control.selectionEnd())
+ : int(text_control.selectionStart())),
base_affinity);
const auto ax_extent = AXPosition::CreatePositionInTextObject(
*ax_text_control,
- (is_backward ? int{text_control.selectionStart()}
- : int{text_control.selectionEnd()}),
+ (is_backward ? int(text_control.selectionStart())
+ : int(text_control.selectionEnd())),
extent_affinity);
if (!ax_base.IsValid() || !ax_extent.IsValid())
diff --git a/chromium/third_party/blink/renderer/modules/encoding/text_encoder_stream.cc b/chromium/third_party/blink/renderer/modules/encoding/text_encoder_stream.cc
index a5e3e38fda6..49b693515f3 100644
--- a/chromium/third_party/blink/renderer/modules/encoding/text_encoder_stream.cc
+++ b/chromium/third_party/blink/renderer/modules/encoding/text_encoder_stream.cc
@@ -102,7 +102,7 @@ class TextEncoderStream::Transformer final : public TransformStreamTransformer {
private:
static std::string ReplacementCharacterInUtf8() {
- constexpr char kRawBytes[] = {0xEF, 0xBF, 0xBD};
+ constexpr char kRawBytes[] = {(char)0xEF, (char)0xBF, (char)0xBD};
return std::string(kRawBytes, sizeof(kRawBytes));
}
diff --git a/chromium/third_party/blink/renderer/modules/exported/web_ax_object.cc b/chromium/third_party/blink/renderer/modules/exported/web_ax_object.cc
index cecb6b6eb61..680dfd00b12 100644
--- a/chromium/third_party/blink/renderer/modules/exported/web_ax_object.cc
+++ b/chromium/third_party/blink/renderer/modules/exported/web_ax_object.cc
@@ -248,7 +248,7 @@ WebAXObject WebAXObject::ChildAt(unsigned index) const {
if (IsDetached())
return WebAXObject();
- return WebAXObject(private_->ChildAtIncludingIgnored(int{index}));
+ return WebAXObject(private_->ChildAtIncludingIgnored(int(index)));
}
WebAXObject WebAXObject::ParentObject() const {
diff --git a/chromium/third_party/blink/renderer/modules/hid/hid_device.cc b/chromium/third_party/blink/renderer/modules/hid/hid_device.cc
index 8f05aab7277..2ad3d8ee522 100644
--- a/chromium/third_party/blink/renderer/modules/hid/hid_device.cc
+++ b/chromium/third_party/blink/renderer/modules/hid/hid_device.cc
@@ -142,7 +142,7 @@ int8_t UnitFactorExponentToInt(uint8_t unit_factor_exponent) {
DCHECK_LE(unit_factor_exponent, 0x0f);
// Values from 0x08 to 0x0f encode negative exponents.
if (unit_factor_exponent > 0x08)
- return int8_t{unit_factor_exponent} - 16;
+ return int8_t(unit_factor_exponent) - 16;
return unit_factor_exponent;
}
diff --git a/chromium/third_party/blink/renderer/modules/mediastream/input_device_info.cc b/chromium/third_party/blink/renderer/modules/mediastream/input_device_info.cc
index 40c6cf6da06..8e3523efb69 100644
--- a/chromium/third_party/blink/renderer/modules/mediastream/input_device_info.cc
+++ b/chromium/third_party/blink/renderer/modules/mediastream/input_device_info.cc
@@ -44,8 +44,8 @@ void InputDeviceInfo::SetVideoInputCapabilities(
max_height = std::max(max_height, format.frame_size.height());
max_frame_rate = std::max(max_frame_rate, format.frame_rate);
}
- platform_capabilities_.width = {1, max_width};
- platform_capabilities_.height = {1, max_height};
+ platform_capabilities_.width = {1U, uint32_t(max_width)};
+ platform_capabilities_.height = {1U, uint32_t(max_height)};
platform_capabilities_.aspect_ratio = {1.0 / max_height,
static_cast<double>(max_width)};
platform_capabilities_.frame_rate = {min_frame_rate, max_frame_rate};
diff --git a/chromium/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.cc b/chromium/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.cc
index 9f300df6d9f..4396a968bba 100644
--- a/chromium/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.cc
+++ b/chromium/third_party/blink/renderer/modules/mediastream/media_stream_constraints_util.cc
@@ -302,8 +302,8 @@ MediaStreamSource::Capabilities ComputeCapabilitiesForVideoSource(
max_height = std::max(max_height, format.frame_size.height());
max_frame_rate = std::max(max_frame_rate, format.frame_rate);
}
- capabilities.width = {1, max_width};
- capabilities.height = {1, max_height};
+ capabilities.width = {1, unsigned(max_width)};
+ capabilities.height = {1, unsigned(max_height)};
capabilities.aspect_ratio = {1.0 / max_height,
static_cast<double>(max_width)};
capabilities.frame_rate = {min_frame_rate, max_frame_rate};
diff --git a/chromium/third_party/blink/renderer/modules/webcodecs/decoder_template.cc b/chromium/third_party/blink/renderer/modules/webcodecs/decoder_template.cc
index 400c0fd80b8..17570733b1f 100644
--- a/chromium/third_party/blink/renderer/modules/webcodecs/decoder_template.cc
+++ b/chromium/third_party/blink/renderer/modules/webcodecs/decoder_template.cc
@@ -296,7 +296,7 @@ bool DecoderTemplate<Traits>::ProcessConfigureRequest(Request* request) {
}
if (pending_decodes_.size() + 1 >
- size_t{Traits::GetMaxDecodeRequests(*decoder_)}) {
+ size_t(Traits::GetMaxDecodeRequests(*decoder_))) {
// Try again after OnDecodeDone().
return false;
}
@@ -326,7 +326,7 @@ bool DecoderTemplate<Traits>::ProcessDecodeRequest(Request* request) {
}
if (pending_decodes_.size() + 1 >
- size_t{Traits::GetMaxDecodeRequests(*decoder_)}) {
+ size_t(Traits::GetMaxDecodeRequests(*decoder_))) {
// Try again after OnDecodeDone().
return false;
}
@@ -371,7 +371,7 @@ bool DecoderTemplate<Traits>::ProcessFlushRequest(Request* request) {
DCHECK(decoder_);
if (pending_decodes_.size() + 1 >
- size_t{Traits::GetMaxDecodeRequests(*decoder_)}) {
+ size_t(Traits::GetMaxDecodeRequests(*decoder_))) {
// Try again after OnDecodeDone().
return false;
}
diff --git a/chromium/third_party/blink/renderer/modules/webcodecs/video_encoder.cc b/chromium/third_party/blink/renderer/modules/webcodecs/video_encoder.cc
index c11c864312d..f4fc98f7147 100644
--- a/chromium/third_party/blink/renderer/modules/webcodecs/video_encoder.cc
+++ b/chromium/third_party/blink/renderer/modules/webcodecs/video_encoder.cc
@@ -82,7 +82,7 @@ std::unique_ptr<media::VideoEncoder> CreateAcceleratedVideoEncoder(
}
double max_supported_framerate =
- double{supported_profile.max_framerate_numerator} /
+ double(supported_profile.max_framerate_numerator) /
supported_profile.max_framerate_denominator;
if (options.framerate.has_value() &&
options.framerate.value() > max_supported_framerate) {
diff --git a/chromium/third_party/blink/renderer/modules/webcodecs/video_frame.cc b/chromium/third_party/blink/renderer/modules/webcodecs/video_frame.cc
index 9d165889061..ac7577161ef 100644
--- a/chromium/third_party/blink/renderer/modules/webcodecs/video_frame.cc
+++ b/chromium/third_party/blink/renderer/modules/webcodecs/video_frame.cc
@@ -158,7 +158,7 @@ VideoFrame* VideoFrame::Create(ImageBitmap* source,
SkIRect src_rect = SkIRect::MakeWH(source->width(), source->height());
sk_image->asyncRescaleAndReadPixelsYUV420(
kRec709_SkYUVColorSpace, sk_color_space, src_rect,
- {source->width(), source->height()}, SkImage::RescaleGamma::kSrc,
+ {int(source->width()), int(source->height())}, SkImage::RescaleGamma::kSrc,
kHigh_SkFilterQuality, &OnYUVReadbackDone, frame.get());
GrDirectContext* gr_context =
source->BitmapImage()->ContextProvider()->GetGrContext();
diff --git a/chromium/third_party/blink/renderer/modules/xr/xr_ray.cc b/chromium/third_party/blink/renderer/modules/xr/xr_ray.cc
index 8be9ce9e129..d73069bdb88 100644
--- a/chromium/third_party/blink/renderer/modules/xr/xr_ray.cc
+++ b/chromium/third_party/blink/renderer/modules/xr/xr_ray.cc
@@ -136,7 +136,7 @@ DOMFloat32Array* XRRay::matrix() {
TransformationMatrix matrix;
const blink::FloatPoint3D desiredRayDirection = {
- direction_->x(), direction_->y(), direction_->z()};
+ float(direction_->x()), float(direction_->y()), float(direction_->z())};
// Translation from 0 to |origin_| is simply translation by |origin_|.
// (implicit) Step 6: Let translation be the translation matrix with
diff --git a/chromium/third_party/blink/renderer/modules/xr/xr_session.cc b/chromium/third_party/blink/renderer/modules/xr/xr_session.cc
index e6c691c39dd..cfdd4a0536b 100644
--- a/chromium/third_party/blink/renderer/modules/xr/xr_session.cc
+++ b/chromium/third_party/blink/renderer/modules/xr/xr_session.cc
@@ -911,11 +911,11 @@ ScriptPromise XRSession::requestHitTestSourceForTransientInput(
: MakeGarbageCollected<XRRay>();
device::mojom::blink::XRRayPtr ray_mojo = device::mojom::blink::XRRay::New();
- ray_mojo->origin = {offsetRay->origin()->x(), offsetRay->origin()->y(),
- offsetRay->origin()->z()};
- ray_mojo->direction = {offsetRay->direction()->x(),
- offsetRay->direction()->y(),
- offsetRay->direction()->z()};
+ ray_mojo->origin = {float(offsetRay->origin()->x()), float(offsetRay->origin()->y()),
+ float(offsetRay->origin()->z())};
+ ray_mojo->direction = {float(offsetRay->direction()->x()),
+ float(offsetRay->direction()->y()),
+ float(offsetRay->direction()->z())};
auto* resolver = MakeGarbageCollected<ScriptPromiseResolver>(script_state);
ScriptPromise promise = resolver->Promise();
diff --git a/chromium/third_party/blink/renderer/platform/audio/dynamics_compressor_kernel.cc b/chromium/third_party/blink/renderer/platform/audio/dynamics_compressor_kernel.cc
index 83b1e63a6c8..1b16d87081f 100644
--- a/chromium/third_party/blink/renderer/platform/audio/dynamics_compressor_kernel.cc
+++ b/chromium/third_party/blink/renderer/platform/audio/dynamics_compressor_kernel.cc
@@ -62,8 +62,8 @@ DynamicsCompressorKernel::DynamicsCompressorKernel(float sample_rate,
Reset();
metering_release_k_ =
- float{audio_utilities::DiscreteTimeConstantForSampleRate(
- kMeteringReleaseTimeConstant, sample_rate)};
+ float(audio_utilities::DiscreteTimeConstantForSampleRate(
+ kMeteringReleaseTimeConstant, sample_rate));
}
void DynamicsCompressorKernel::SetNumberOfChannels(
diff --git a/chromium/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc b/chromium/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc
index 212ae08ce3c..0eebabd3383 100644
--- a/chromium/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc
+++ b/chromium/third_party/blink/renderer/platform/fonts/font_custom_platform_data.cc
@@ -120,7 +120,7 @@ FontPlatformData FontCustomPlatformData::GetFontPlatformData(
}
SkFontArguments font_args;
- font_args.setVariationDesignPosition({variation.data(), variation.size()});
+ font_args.setVariationDesignPosition({variation.data(), int(variation.size())});
sk_sp<SkTypeface> sk_variation_font(base_typeface_->makeClone(font_args));
if (sk_variation_font) {
diff --git a/chromium/third_party/blink/renderer/platform/fonts/opentype/open_type_math_support.cc b/chromium/third_party/blink/renderer/platform/fonts/opentype/open_type_math_support.cc
index 80d94665ab7..534c6d6885d 100644
--- a/chromium/third_party/blink/renderer/platform/fonts/opentype/open_type_math_support.cc
+++ b/chromium/third_party/blink/renderer/platform/fonts/opentype/open_type_math_support.cc
@@ -229,11 +229,11 @@ OpenTypeMathSupport::GetGlyphPartRecords(
auto converter =
base::BindRepeating([](hb_ot_math_glyph_part_t record)
-> OpenTypeMathStretchData::GlyphPartRecord {
- return {record.glyph,
+ return {blink::Glyph(record.glyph),
HarfBuzzUnitsToFloat(record.start_connector_length),
HarfBuzzUnitsToFloat(record.end_connector_length),
HarfBuzzUnitsToFloat(record.full_advance),
- record.flags & HB_MATH_GLYPH_PART_FLAG_EXTENDER};
+ bool(record.flags & HB_MATH_GLYPH_PART_FLAG_EXTENDER)};
});
Vector<OpenTypeMathStretchData::GlyphPartRecord> parts =
GetHarfBuzzMathRecord(
diff --git a/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.cc b/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.cc
index 24efa5bf803..bb029c901ac 100644
--- a/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.cc
+++ b/chromium/third_party/blink/renderer/platform/fonts/shaping/shape_result_view.cc
@@ -376,7 +376,7 @@ void ShapeResultView::GetRunFontData(
Vector<ShapeResult::RunFontData>* font_data) const {
for (const auto& part : RunsOrParts()) {
font_data->push_back(ShapeResult::RunFontData(
- {part.run_->font_data_.get(), part.end() - part.begin()}));
+ {part.run_->font_data_.get(), WTF::wtf_size_t(part.end() - part.begin())}));
}
}
diff --git a/chromium/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc b/chromium/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc
index e4cee28a769..ebdddecdac3 100644
--- a/chromium/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc
+++ b/chromium/third_party/blink/renderer/platform/image-decoders/avif/avif_image_decoder.cc
@@ -206,7 +206,7 @@ void YUVAToRGBA(const avifImage* image,
avifGetPixelFormatInfo(image->yuvFormat, &format_info);
gfx::Point3F pixel;
const int max_channel_i = (1 << image->depth) - 1;
- const float max_channel = float{max_channel_i};
+ const float max_channel = (float)max_channel_i;
for (uint32_t j = 0; j < image->height; ++j) {
const int uv_j = j >> format_info.chromaShiftY;
diff --git a/chromium/third_party/blink/renderer/platform/text/text_boundaries.cc b/chromium/third_party/blink/renderer/platform/text/text_boundaries.cc
index 9bb388a70e5..61dc36dfa7e 100644
--- a/chromium/third_party/blink/renderer/platform/text/text_boundaries.cc
+++ b/chromium/third_party/blink/renderer/platform/text/text_boundaries.cc
@@ -55,7 +55,7 @@ int StartOfLastWordBoundaryContext(const UChar* characters, int length) {
}
int FindNextWordForward(const UChar* chars, int len, int position) {
- TextBreakIterator* it = WordBreakIterator({chars, len});
+ TextBreakIterator* it = WordBreakIterator({chars, size_t(len)});
position = it->following(position);
while (position != kTextBreakDone) {
@@ -72,7 +72,7 @@ int FindNextWordForward(const UChar* chars, int len, int position) {
}
int FindNextWordBackward(const UChar* chars, int len, int position) {
- TextBreakIterator* it = WordBreakIterator({chars, len});
+ TextBreakIterator* it = WordBreakIterator({chars, size_t(len)});
position = it->preceding(position);
while (position != kTextBreakDone) {
@@ -95,7 +95,7 @@ std::pair<int, int> FindWordBackward(const UChar* chars,
DCHECK_LE(position, len);
if (len == 0)
return {0, 0};
- TextBreakIterator* it = WordBreakIterator({chars, len});
+ TextBreakIterator* it = WordBreakIterator({chars, size_t(len)});
const int start = it->preceding(position);
const int end = it->next();
if (start < 0) {
@@ -110,7 +110,7 @@ std::pair<int, int> FindWordForward(const UChar* chars, int len, int position) {
DCHECK_LE(position, len);
if (len == 0)
return {0, 0};
- TextBreakIterator* it = WordBreakIterator({chars, len});
+ TextBreakIterator* it = WordBreakIterator({chars, size_t(len)});
const int end = it->following(position);
const int start = it->previous();
if (end < 0) {
@@ -121,13 +121,13 @@ std::pair<int, int> FindWordForward(const UChar* chars, int len, int position) {
}
int FindWordStartBoundary(const UChar* chars, int len, int position) {
- TextBreakIterator* it = WordBreakIterator({chars, len});
+ TextBreakIterator* it = WordBreakIterator({chars, size_t(len)});
it->following(position);
return it->previous();
}
int FindWordEndBoundary(const UChar* chars, int len, int position) {
- TextBreakIterator* it = WordBreakIterator({chars, len});
+ TextBreakIterator* it = WordBreakIterator({chars, size_t(len)});
int end = it->following(position);
return end < 0 ? it->last() : end;
}
diff --git a/chromium/third_party/ced/src/compact_enc_det/compact_enc_det.cc b/chromium/third_party/ced/src/compact_enc_det/compact_enc_det.cc
index fcac75a9311..b6cd50f8e4a 100644
--- a/chromium/third_party/ced/src/compact_enc_det/compact_enc_det.cc
+++ b/chromium/third_party/ced/src/compact_enc_det/compact_enc_det.cc
@@ -1479,7 +1479,7 @@ void InitDetectEncodingState(DetectEncodingState* destatep) {
// {{0x6e,0x6c,0x5f,0x5f, 0x05,0xb2,0xae,0xa0,0x32,0xa1,0x36,0x31,0x42,0x39,0x3b,0x33,0x45,0x11,0x6f,0x00,}}, // "nl__"
// // ASCII-7-bit=178 Latin1=174 UTF8=160 GB=50 CP1252=161 BIG5=49 Latin2=66 CP1251=57 CP1256=59 CP1250=51 Latin5=69 ISO-8859-15=111 [top ASCII-7-bit]
-int ApplyCompressedProb(const char* iprob, int len,
+int ApplyCompressedProb(const unsigned char* iprob, int len,
int weight, DetectEncodingState* destatep) {
int* dst = &destatep->enc_prob[0];
int* dst2 = &destatep->hint_weight[0];
@@ -1528,7 +1528,7 @@ int ApplyCompressedProb(const char* iprob, int len,
// Returns subscript of largest (most probable) value [for unit test]
-int TopCompressedProb(const char* iprob, int len) {
+int TopCompressedProb(const unsigned char* iprob, int len) {
const uint8* prob = reinterpret_cast<const uint8*>(iprob);
const uint8* problimit = prob + len;
int next_prob_sub = 0;
diff --git a/chromium/third_party/ced/src/compact_enc_det/compact_enc_det_generated_tables.h b/chromium/third_party/ced/src/compact_enc_det/compact_enc_det_generated_tables.h
index 317afb66f48..471a20c6d17 100644
--- a/chromium/third_party/ced/src/compact_enc_det/compact_enc_det_generated_tables.h
+++ b/chromium/third_party/ced/src/compact_enc_det/compact_enc_det_generated_tables.h
@@ -165,7 +165,7 @@ static const Encoding kMapToEncoding[NUM_RANKEDENCODING] = {
// Massaged TLD or charset, followed by packed encoding probs
typedef struct {
- char key_prob[20];
+ unsigned char key_prob[20];
} HintEntry;
static const HintEntry kLangHintProbs[] = { // MaxRange 192
diff --git a/chromium/ui/accessibility/ax_language_detection.cc b/chromium/ui/accessibility/ax_language_detection.cc
index 8eed3f994ba..8ec3172e1d0 100644
--- a/chromium/ui/accessibility/ax_language_detection.cc
+++ b/chromium/ui/accessibility/ax_language_detection.cc
@@ -420,7 +420,7 @@ AXLanguageDetectionManager::GetLanguageAnnotationForStringAttribute(
if (node.HasStringAttribute(ax::mojom::StringAttribute::kLanguage)) {
// Use author-provided language if present.
language_annotation.push_back(AXLanguageSpan{
- 0 /* start_index */, attr_value.length() /* end_index */,
+ 0 /* start_index */, int(attr_value.length()) /* end_index */,
node.GetStringAttribute(
ax::mojom::StringAttribute::kLanguage) /* language */,
1 /* probability */});
diff --git a/chromium/ui/accessibility/ax_node.cc b/chromium/ui/accessibility/ax_node.cc
index 6fddfb98d71..b13b2a1e50e 100644
--- a/chromium/ui/accessibility/ax_node.cc
+++ b/chromium/ui/accessibility/ax_node.cc
@@ -611,14 +611,14 @@ base::Optional<int> AXNode::GetTableColCount() const {
const AXTableInfo* table_info = GetAncestorTableInfo();
if (!table_info)
return base::nullopt;
- return int{table_info->col_count};
+ return int(table_info->col_count);
}
base::Optional<int> AXNode::GetTableRowCount() const {
const AXTableInfo* table_info = GetAncestorTableInfo();
if (!table_info)
return base::nullopt;
- return int{table_info->row_count};
+ return int(table_info->row_count);
}
base::Optional<int> AXNode::GetTableAriaColCount() const {
@@ -657,11 +657,11 @@ AXNode* AXNode::GetTableCellFromIndex(int index) const {
return nullptr;
// There is a table but there is no cell with the given index.
- if (index < 0 || size_t{index} >= table_info->unique_cell_ids.size()) {
+ if (index < 0 || size_t(index) >= table_info->unique_cell_ids.size()) {
return nullptr;
}
- return tree_->GetFromId(table_info->unique_cell_ids[size_t{index}]);
+ return tree_->GetFromId(table_info->unique_cell_ids[size_t(index)]);
}
AXNode* AXNode::GetTableCaption() const {
@@ -678,13 +678,13 @@ AXNode* AXNode::GetTableCellFromCoords(int row_index, int col_index) const {
return nullptr;
// There is a table but the given coordinates are outside the table.
- if (row_index < 0 || size_t{row_index} >= table_info->row_count ||
- col_index < 0 || size_t{col_index} >= table_info->col_count) {
+ if (row_index < 0 || size_t(row_index) >= table_info->row_count ||
+ col_index < 0 || size_t(col_index) >= table_info->col_count) {
return nullptr;
}
return tree_->GetFromId(
- table_info->cell_ids[size_t{row_index}][size_t{col_index}]);
+ table_info->cell_ids[size_t(row_index)][size_t(col_index)]);
}
std::vector<AXNode::AXID> AXNode::GetTableColHeaderNodeIds() const {
@@ -709,10 +709,10 @@ std::vector<AXNode::AXID> AXNode::GetTableColHeaderNodeIds(
if (!table_info)
return std::vector<AXNode::AXID>();
- if (col_index < 0 || size_t{col_index} >= table_info->col_count)
+ if (col_index < 0 || size_t(col_index) >= table_info->col_count)
return std::vector<AXNode::AXID>();
- return std::vector<AXNode::AXID>(table_info->col_headers[size_t{col_index}]);
+ return std::vector<AXNode::AXID>(table_info->col_headers[(size_t)col_index]);
}
std::vector<AXNode::AXID> AXNode::GetTableRowHeaderNodeIds(
@@ -721,10 +721,10 @@ std::vector<AXNode::AXID> AXNode::GetTableRowHeaderNodeIds(
if (!table_info)
return std::vector<AXNode::AXID>();
- if (row_index < 0 || size_t{row_index} >= table_info->row_count)
+ if (row_index < 0 || size_t(row_index) >= table_info->row_count)
return std::vector<AXNode::AXID>();
- return std::vector<AXNode::AXID>(table_info->row_headers[size_t{row_index}]);
+ return std::vector<AXNode::AXID>(table_info->row_headers[(size_t)row_index]);
}
std::vector<AXNode::AXID> AXNode::GetTableUniqueCellIds() const {
@@ -763,7 +763,7 @@ base::Optional<int> AXNode::GetTableRowRowIndex() const {
const auto& iter = table_info->row_id_to_index.find(id());
if (iter == table_info->row_id_to_index.end())
return base::nullopt;
- return int{iter->second};
+ return int(iter->second);
}
std::vector<AXNode::AXID> AXNode::GetTableRowNodeIds() const {
@@ -825,7 +825,7 @@ base::Optional<int> AXNode::GetTableCellIndex() const {
const auto& iter = table_info->cell_id_to_index.find(id());
if (iter != table_info->cell_id_to_index.end())
- return int{iter->second};
+ return int(iter->second);
return base::nullopt;
}
@@ -838,7 +838,7 @@ base::Optional<int> AXNode::GetTableCellColIndex() const {
if (!index)
return base::nullopt;
- return int{table_info->cell_data_vector[*index].col_index};
+ return int(table_info->cell_data_vector[*index].col_index);
}
base::Optional<int> AXNode::GetTableCellRowIndex() const {
@@ -850,7 +850,7 @@ base::Optional<int> AXNode::GetTableCellRowIndex() const {
if (!index)
return base::nullopt;
- return int{table_info->cell_data_vector[*index].row_index};
+ return int(table_info->cell_data_vector[*index].row_index);
}
base::Optional<int> AXNode::GetTableCellColSpan() const {
@@ -888,7 +888,7 @@ base::Optional<int> AXNode::GetTableCellAriaColIndex() const {
if (!index)
return base::nullopt;
- return int{table_info->cell_data_vector[*index].aria_col_index};
+ return int(table_info->cell_data_vector[*index].aria_col_index);
}
base::Optional<int> AXNode::GetTableCellAriaRowIndex() const {
@@ -900,7 +900,7 @@ base::Optional<int> AXNode::GetTableCellAriaRowIndex() const {
if (!index)
return base::nullopt;
- return int{table_info->cell_data_vector[*index].aria_row_index};
+ return int(table_info->cell_data_vector[*index].aria_row_index);
}
std::vector<AXNode::AXID> AXNode::GetTableCellColHeaderNodeIds() const {
diff --git a/chromium/ui/accessibility/ax_node_position.cc b/chromium/ui/accessibility/ax_node_position.cc
index 798bc670cb9..4edcc33f6ba 100644
--- a/chromium/ui/accessibility/ax_node_position.cc
+++ b/chromium/ui/accessibility/ax_node_position.cc
@@ -69,7 +69,7 @@ void AXNodePosition::AnchorChild(int child_index,
child = child_tree_manager->GetRootAsAXNode();
*tree_id = child_tree_manager->GetTreeID();
} else {
- child = GetAnchor()->children()[size_t{child_index}];
+ child = GetAnchor()->children()[size_t(child_index)];
*tree_id = this->tree_id();
}
@@ -86,7 +86,7 @@ int AXNodePosition::AnchorChildCount() const {
if (child_tree_manager)
return 1;
- return int{GetAnchor()->children().size()};
+ return int(GetAnchor()->children().size());
}
int AXNodePosition::AnchorUnignoredChildCount() const {
@@ -97,7 +97,7 @@ int AXNodePosition::AnchorUnignoredChildCount() const {
}
int AXNodePosition::AnchorIndexInParent() const {
- return GetAnchor() ? int{GetAnchor()->index_in_parent()} : INVALID_INDEX;
+ return GetAnchor() ? int(GetAnchor()->index_in_parent()) : INVALID_INDEX;
}
int AXNodePosition::AnchorSiblingCount() const {
diff --git a/chromium/ui/accessibility/ax_position.h b/chromium/ui/accessibility/ax_position.h
index e68b38c435a..927eb0e2869 100644
--- a/chromium/ui/accessibility/ax_position.h
+++ b/chromium/ui/accessibility/ax_position.h
@@ -2101,13 +2101,13 @@ class AXPosition {
text_position->GetGraphemeIterator();
DCHECK_GE(text_position->text_offset_, 0);
DCHECK_LE(text_position->text_offset_,
- int{text_position->name_.length()});
+ int(text_position->name_.length()));
while (
!text_position->AtStartOfAnchor() &&
(!gfx::IsValidCodePointIndex(text_position->name_,
- size_t{text_position->text_offset_}) ||
+ size_t(text_position->text_offset_)) ||
(grapheme_iterator && !grapheme_iterator->IsGraphemeBoundary(
- size_t{text_position->text_offset_})))) {
+ size_t(text_position->text_offset_))))) {
--text_position->text_offset_;
}
return text_position;
@@ -2151,18 +2151,18 @@ class AXPosition {
//
// TODO(nektar): Remove this workaround as soon as the source of the bug
// is identified.
- if (text_position->text_offset_ > int{text_position->name_.length()})
+ if (text_position->text_offset_ > int(text_position->name_.length()))
return CreateNullPosition();
DCHECK_GE(text_position->text_offset_, 0);
DCHECK_LE(text_position->text_offset_,
- int{text_position->name_.length()});
+ int(text_position->name_.length()));
while (
!text_position->AtEndOfAnchor() &&
(!gfx::IsValidCodePointIndex(text_position->name_,
- size_t{text_position->text_offset_}) ||
+ size_t(text_position->text_offset_)) ||
(grapheme_iterator && !grapheme_iterator->IsGraphemeBoundary(
- size_t{text_position->text_offset_})))) {
+ size_t(text_position->text_offset_))))) {
++text_position->text_offset_;
}
@@ -2218,7 +2218,7 @@ class AXPosition {
++text_position->text_offset_;
} while (!text_position->AtEndOfAnchor() && grapheme_iterator &&
!grapheme_iterator->IsGraphemeBoundary(
- size_t{text_position->text_offset_}));
+ size_t(text_position->text_offset_)));
DCHECK_GT(text_position->text_offset_, 0);
DCHECK_LE(text_position->text_offset_, text_position->MaxTextOffset());
@@ -2281,7 +2281,7 @@ class AXPosition {
--text_position->text_offset_;
} while (!text_position->AtStartOfAnchor() && grapheme_iterator &&
!grapheme_iterator->IsGraphemeBoundary(
- size_t{text_position->text_offset_}));
+ size_t(text_position->text_offset_)));
DCHECK_GE(text_position->text_offset_, 0);
DCHECK_LT(text_position->text_offset_, text_position->MaxTextOffset());
@@ -3333,7 +3333,7 @@ class AXPosition {
virtual int MaxTextOffset() const {
if (IsNullPosition())
return INVALID_OFFSET;
- return int{GetText().length()};
+ return int(GetText().length());
}
protected:
diff --git a/chromium/ui/accessibility/ax_table_info.cc b/chromium/ui/accessibility/ax_table_info.cc
index a861036d688..13937f30b8c 100644
--- a/chromium/ui/accessibility/ax_table_info.cc
+++ b/chromium/ui/accessibility/ax_table_info.cc
@@ -297,12 +297,12 @@ void AXTableInfo::BuildCellDataVectorFromRowAndCellNodes(
if (aria_row_count != ax::mojom::kUnknownAriaColumnOrRowCount) {
aria_row_count =
std::max((aria_row_count),
- int{current_aria_row_index + cell_data.row_span - 1});
+ int(current_aria_row_index + cell_data.row_span - 1));
}
if (aria_col_count != ax::mojom::kUnknownAriaColumnOrRowCount) {
aria_col_count =
std::max((aria_col_count),
- int{current_aria_col_index + cell_data.col_span - 1});
+ int(current_aria_col_index + cell_data.col_span - 1));
}
// Update |current_col_index| to reflect the next available index after
// this cell including its colspan. The next column index in this row
@@ -478,7 +478,7 @@ void AXTableInfo::UpdateExtraMacColumnNodeAttributes(size_t col_index) {
data.int_attributes.clear();
// Update the column index.
- data.AddIntAttribute(IntAttribute::kTableColumnIndex, int32_t{col_index});
+ data.AddIntAttribute(IntAttribute::kTableColumnIndex, int32_t(col_index));
// Update the column header.
if (!col_headers[col_index].empty()) {
diff --git a/chromium/ui/accessibility/ax_text_utils.cc b/chromium/ui/accessibility/ax_text_utils.cc
index c48dd616e54..1355f3c5f3b 100644
--- a/chromium/ui/accessibility/ax_text_utils.cc
+++ b/chromium/ui/accessibility/ax_text_utils.cc
@@ -72,7 +72,7 @@ size_t FindAccessibleTextBoundary(const base::string16& text,
if (boundary == ax::mojom::TextBoundary::kLineStart) {
if (direction == ax::mojom::MoveDirection::kForward) {
for (int line_break : line_breaks) {
- size_t clamped_line_break = size_t{std::max(0, line_break)};
+ size_t clamped_line_break = (size_t)std::max(0, line_break);
if ((affinity == ax::mojom::TextAffinity::kDownstream &&
clamped_line_break > start_offset) ||
(affinity == ax::mojom::TextAffinity::kUpstream &&
diff --git a/chromium/ui/accessibility/platform/ax_platform_node_delegate_base.cc b/chromium/ui/accessibility/platform/ax_platform_node_delegate_base.cc
index ba49fe98b82..a2494ca685a 100644
--- a/chromium/ui/accessibility/platform/ax_platform_node_delegate_base.cc
+++ b/chromium/ui/accessibility/platform/ax_platform_node_delegate_base.cc
@@ -80,7 +80,7 @@ base::string16 AXPlatformNodeDelegateBase::GetValueForControl() const {
const AXTree::Selection AXPlatformNodeDelegateBase::GetUnignoredSelection()
const {
- return AXTree::Selection{-1, -1, -1, ax::mojom::TextAffinity::kDownstream};
+ return AXTree::Selection{true, -1, -1, ax::mojom::TextAffinity::kDownstream};
}
AXNodePosition::AXPositionInstance
diff --git a/chromium/ui/display/win/screen_win.cc b/chromium/ui/display/win/screen_win.cc
index d4cda28238a..660a0fd2703 100644
--- a/chromium/ui/display/win/screen_win.cc
+++ b/chromium/ui/display/win/screen_win.cc
@@ -60,7 +60,7 @@ base::Optional<int> GetPerMonitorDPI(HMONITOR monitor) {
return base::nullopt;
DCHECK_EQ(dpi_x, dpi_y);
- return int{dpi_x};
+ return int(dpi_x);
}
float GetScaleFactorForDPI(int dpi, bool include_accessibility) {
@@ -187,7 +187,7 @@ DisplaySettings GetDisplaySettingsForDevice(const wchar_t* device_name) {
if (!::EnumDisplaySettings(device_name, ENUM_CURRENT_SETTINGS, &mode))
return {Display::ROTATE_0, 0};
return {OrientationToRotation(mode.dmDisplayOrientation),
- mode.dmDisplayFrequency};
+ int(mode.dmDisplayFrequency)};
}
std::vector<DisplayInfo> FindAndRemoveTouchingDisplayInfos(
@@ -454,7 +454,7 @@ std::vector<DisplayInfo> GetDisplayInfosFromSystem() {
std::vector<DisplayInfo> display_infos;
EnumDisplayMonitors(nullptr, nullptr, EnumMonitorForDisplayInfoCallback,
reinterpret_cast<LPARAM>(&display_infos));
- DCHECK_EQ(::GetSystemMetrics(SM_CMONITORS), int{display_infos.size()});
+ DCHECK_EQ(::GetSystemMetrics(SM_CMONITORS), int(display_infos.size()));
return display_infos;
}
@@ -705,7 +705,7 @@ gfx::NativeWindow ScreenWin::GetLocalProcessWindowAtPoint(
}
int ScreenWin::GetNumDisplays() const {
- return int{screen_win_displays_.size()};
+ return int(screen_win_displays_.size());
}
const std::vector<Display>& ScreenWin::GetAllDisplays() const {
diff --git a/chromium/ui/display/win/uwp_text_scale_factor.cc b/chromium/ui/display/win/uwp_text_scale_factor.cc
index a5be273160b..95946a3aa15 100644
--- a/chromium/ui/display/win/uwp_text_scale_factor.cc
+++ b/chromium/ui/display/win/uwp_text_scale_factor.cc
@@ -163,7 +163,7 @@ class UwpTextScaleFactorImpl : public UwpTextScaleFactor {
// equal to 1. Let's make sure that's the case - if we don't, we could get
// bizarre behavior and divide-by-zeros later on.
DCHECK_GE(result, 1.0);
- return float{result};
+ return float(result);
}
private:
diff --git a/chromium/ui/gfx/color_utils.cc b/chromium/ui/gfx/color_utils.cc
index c4e41658b4e..4fd917d9865 100644
--- a/chromium/ui/gfx/color_utils.cc
+++ b/chromium/ui/gfx/color_utils.cc
@@ -293,7 +293,7 @@ SkColor AlphaBlend(SkColor foreground, SkColor background, float alpha) {
SkColor GetResultingPaintColor(SkColor foreground, SkColor background) {
return AlphaBlend(SkColorSetA(foreground, SK_AlphaOPAQUE), background,
- SkAlpha{SkColorGetA(foreground)});
+ SkAlpha(SkColorGetA(foreground)));
}
bool IsDark(SkColor color) {
diff --git a/chromium/ui/gfx/paint_throbber.cc b/chromium/ui/gfx/paint_throbber.cc
index e6f6f2082d0..9509d6b2112 100644
--- a/chromium/ui/gfx/paint_throbber.cc
+++ b/chromium/ui/gfx/paint_throbber.cc
@@ -174,8 +174,8 @@ void PaintThrobberSpinningAfterWaiting(Canvas* canvas,
// Blend the color between "waiting" and "spinning" states.
constexpr auto kColorFadeTime = base::TimeDelta::FromMilliseconds(900);
- const float color_progress = float{Tween::CalculateValue(
- Tween::LINEAR_OUT_SLOW_IN, std::min(elapsed_time / kColorFadeTime, 1.0))};
+ const float color_progress = (float)Tween::CalculateValue(
+ Tween::LINEAR_OUT_SLOW_IN, std::min(elapsed_time / kColorFadeTime, 1.0));
const SkColor blend_color =
color_utils::AlphaBlend(color, waiting_state->color, color_progress);
diff --git a/chromium/ui/gfx/system_fonts_win.cc b/chromium/ui/gfx/system_fonts_win.cc
index 58b498b8144..ae9c4295f7b 100644
--- a/chromium/ui/gfx/system_fonts_win.cc
+++ b/chromium/ui/gfx/system_fonts_win.cc
@@ -69,7 +69,7 @@ class SystemFonts {
LOGFONT* logfont) {
DCHECK_GT(font_adjustment.font_scale, 0.0);
LONG new_height =
- LONG{std::round(logfont->lfHeight * font_adjustment.font_scale)};
+ LONG(std::round(logfont->lfHeight * font_adjustment.font_scale));
if (logfont->lfHeight && !new_height)
new_height = logfont->lfHeight > 0 ? 1 : -1;
logfont->lfHeight = new_height;