mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09:00
LibWebView: Use Vector for arguments to WebContent
In a future commit will add some more conditional arguments to the array and so it's easier to have it be a Vector.
This commit is contained in:
parent
00e446facd
commit
af26b76e0a
Notes:
sideshowbarker
2024-07-16 23:05:02 +09:00
Author: https://github.com/martinfalisse
Commit: af26b76e0a
Pull-request: https://github.com/SerenityOS/serenity/pull/18677
Reviewed-by: https://github.com/awesomekling
1 changed files with 3 additions and 4 deletions
|
@ -152,7 +152,7 @@ ErrorOr<NonnullRefPtr<WebView::WebContentClient>> ViewImplementation::launch_web
|
||||||
ErrorOr<void> result;
|
ErrorOr<void> result;
|
||||||
for (auto const& path : candidate_web_content_paths) {
|
for (auto const& path : candidate_web_content_paths) {
|
||||||
constexpr auto callgrind_prefix_length = 3;
|
constexpr auto callgrind_prefix_length = 3;
|
||||||
auto arguments_with_callgrind_prefix = Array {
|
auto arguments = Vector {
|
||||||
"valgrind"sv,
|
"valgrind"sv,
|
||||||
"--tool=callgrind"sv,
|
"--tool=callgrind"sv,
|
||||||
"--instr-atstart=no"sv,
|
"--instr-atstart=no"sv,
|
||||||
|
@ -160,11 +160,10 @@ ErrorOr<NonnullRefPtr<WebView::WebContentClient>> ViewImplementation::launch_web
|
||||||
"--webcontent-fd-passing-socket"sv,
|
"--webcontent-fd-passing-socket"sv,
|
||||||
webcontent_fd_passing_socket_string
|
webcontent_fd_passing_socket_string
|
||||||
};
|
};
|
||||||
auto arguments = arguments_with_callgrind_prefix.span();
|
|
||||||
if (enable_callgrind_profiling == EnableCallgrindProfiling::No)
|
if (enable_callgrind_profiling == EnableCallgrindProfiling::No)
|
||||||
arguments = arguments.slice(callgrind_prefix_length);
|
arguments.remove(0, callgrind_prefix_length);
|
||||||
|
|
||||||
result = Core::System::exec(arguments[0], arguments, Core::System::SearchInPath::Yes);
|
result = Core::System::exec(arguments[0], arguments.span(), Core::System::SearchInPath::Yes);
|
||||||
if (!result.is_error())
|
if (!result.is_error())
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue