fix: -Wunsafe-buffer-usage warnings in WebFrameRenderer::ExecuteJavaScript() (#44075)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
This commit is contained in:
trop[bot] 2024-10-01 13:51:06 -05:00 committed by GitHub
parent 8af5c6d130
commit 0646cbfba6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,6 +9,7 @@
#include <utility>
#include <vector>
#include "base/containers/span.h"
#include "base/memory/memory_pressure_listener.h"
#include "base/strings/utf_string_conversions.h"
#include "components/spellcheck/renderer/spellcheck.h"
@ -653,7 +654,7 @@ class WebFrameRenderer final : public gin::Wrappable<WebFrameRenderer>,
std::move(completion_callback));
render_frame->GetWebFrame()->RequestExecuteScript(
blink::DOMWrapperWorld::kMainWorldId, base::make_span(&source, 1u),
blink::DOMWrapperWorld::kMainWorldId, base::span_from_ref(source),
has_user_gesture ? blink::mojom::UserActivationOption::kActivate
: blink::mojom::UserActivationOption::kDoNotActivate,
blink::mojom::EvaluationTiming::kSynchronous,