chore: replace absl::optional<T> with std::optional<T> (#40928)

* chore: replace absl::optional<T> with std::optional<T>

* IWYU
This commit is contained in:
Milan Burda 2024-01-10 23:23:35 +01:00 committed by GitHub
parent fac964ac0d
commit 892c9d78a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
129 changed files with 419 additions and 397 deletions

View file

@ -6,6 +6,7 @@
#include <algorithm>
#include <memory>
#include <optional>
#include <utility>
#include <vector>
@ -31,7 +32,6 @@
#include "content/public/browser/render_process_host.h"
#include "gpu/command_buffer/client/gl_helper.h"
#include "media/base/video_frame.h"
#include "third_party/abseil-cpp/absl/types/optional.h"
#include "third_party/blink/public/common/input/web_input_event.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/compositor/compositor.h"
@ -355,7 +355,7 @@ void OffScreenRenderWidgetHostView::SetBackgroundColor(SkColor color) {
}
}
absl::optional<SkColor> OffScreenRenderWidgetHostView::GetBackgroundColor() {
std::optional<SkColor> OffScreenRenderWidgetHostView::GetBackgroundColor() {
return background_color_;
}
@ -508,9 +508,9 @@ gfx::Rect OffScreenRenderWidgetHostView::GetBoundsInRootWindow() {
return gfx::Rect(size_);
}
absl::optional<content::DisplayFeature>
std::optional<content::DisplayFeature>
OffScreenRenderWidgetHostView::GetDisplayFeature() {
return absl::nullopt;
return std::nullopt;
}
void OffScreenRenderWidgetHostView::SetDisplayFeatureForTesting(
@ -530,8 +530,8 @@ OffScreenRenderWidgetHostView::CreateSyntheticGestureTarget() {
void OffScreenRenderWidgetHostView::ImeCompositionRangeChanged(
const gfx::Range&,
const absl::optional<std::vector<gfx::Rect>>& character_bounds,
const absl::optional<std::vector<gfx::Rect>>& line_bounds) {}
const std::optional<std::vector<gfx::Rect>>& character_bounds,
const std::optional<std::vector<gfx::Rect>>& line_bounds) {}
gfx::Size OffScreenRenderWidgetHostView::GetCompositorViewportPixelSize() {
return gfx::ScaleToCeiledSize(GetRequestedRendererSize(),

View file

@ -95,7 +95,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
gfx::Size GetVisibleViewportSize() override;
void SetInsets(const gfx::Insets&) override;
void SetBackgroundColor(SkColor color) override;
absl::optional<SkColor> GetBackgroundColor() override;
std::optional<SkColor> GetBackgroundColor() override;
void UpdateBackgroundColor() override;
blink::mojom::PointerLockResult LockMouse(
bool request_unadjusted_movement) override;
@ -141,7 +141,7 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
display::ScreenInfo GetScreenInfo() const override;
void TransformPointToRootSurface(gfx::PointF* point) override;
gfx::Rect GetBoundsInRootWindow(void) override;
absl::optional<content::DisplayFeature> GetDisplayFeature() override;
std::optional<content::DisplayFeature> GetDisplayFeature() override;
void SetDisplayFeatureForTesting(
const content::DisplayFeature* display_feature) override;
void NotifyHostAndDelegateOnWasShown(
@ -154,8 +154,8 @@ class OffScreenRenderWidgetHostView : public content::RenderWidgetHostViewBase,
CreateSyntheticGestureTarget() override;
void ImeCompositionRangeChanged(
const gfx::Range&,
const absl::optional<std::vector<gfx::Rect>>& character_bounds,
const absl::optional<std::vector<gfx::Rect>>& line_bounds) override;
const std::optional<std::vector<gfx::Rect>>& character_bounds,
const std::optional<std::vector<gfx::Rect>>& line_bounds) override;
gfx::Size GetCompositorViewportPixelSize() override;
ui::Compositor* GetCompositor() override;

View file

@ -128,7 +128,7 @@ void OffScreenVideoConsumer::OnFrameCaptured(
new FramePinner{std::move(mapping), callbacks_remote.Unbind()});
bitmap.setImmutable();
absl::optional<gfx::Rect> update_rect = info->metadata.capture_update_rect;
std::optional<gfx::Rect> update_rect = info->metadata.capture_update_rect;
if (!update_rect.has_value() || update_rect->IsEmpty()) {
update_rect = content_rect;
}