diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index d25171ea116f..e062b7a1aff8 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -242,7 +242,7 @@ template <> struct Converter { static v8::Local ToV8(v8::Isolate* isolate, WindowOpenDisposition val) { - std::string disposition = "other"; + std::string_view disposition = "other"; switch (val) { case WindowOpenDisposition::CURRENT_TAB: disposition = "default"; @@ -303,7 +303,7 @@ struct Converter { static v8::Local ToV8(v8::Isolate* isolate, electron::api::WebContents::Type val) { using Type = electron::api::WebContents::Type; - std::string type; + std::string_view type; switch (val) { case Type::kBackgroundPage: type = "backgroundPage"; diff --git a/shell/common/platform_util_linux.cc b/shell/common/platform_util_linux.cc index dea72f7a370b..87c3d6fbda33 100644 --- a/shell/common/platform_util_linux.cc +++ b/shell/common/platform_util_linux.cc @@ -430,7 +430,7 @@ std::optional GetDesktopName() { std::string GetXdgAppId() { if (std::optional desktop_file_name = GetDesktopName()) { - const std::string kDesktopExtension{".desktop"}; + constexpr std::string_view kDesktopExtension = ".desktop"; if (base::EndsWith(*desktop_file_name, kDesktopExtension, base::CompareCase::INSENSITIVE_ASCII)) { desktop_file_name->resize(desktop_file_name->size() -