mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: replace base::EndsWith() with std::ends_with() (#41937)
This commit is contained in:
@@ -1545,8 +1545,7 @@ gin::Handle<Session> Session::FromPartition(v8::Isolate* isolate,
|
||||
if (partition.empty()) {
|
||||
browser_context =
|
||||
ElectronBrowserContext::From("", false, std::move(options));
|
||||
} else if (base::StartsWith(partition, kPersistPrefix,
|
||||
base::CompareCase::SENSITIVE)) {
|
||||
} else if (partition.starts_with(kPersistPrefix)) {
|
||||
std::string name = partition.substr(8);
|
||||
browser_context =
|
||||
ElectronBrowserContext::From(name, false, std::move(options));
|
||||
|
||||
@@ -106,12 +106,9 @@ bool Browser::IsDefaultProtocolClient(const std::string& protocol,
|
||||
const std::vector<std::string> argv = {kXdgSettings, "check",
|
||||
kXdgSettingsDefaultSchemeHandler,
|
||||
protocol, desktop_name};
|
||||
const auto output = GetXdgAppOutput(argv);
|
||||
if (!output)
|
||||
return false;
|
||||
|
||||
// Allow any reply that starts with "yes".
|
||||
return base::StartsWith(output.value(), "yes", base::CompareCase::SENSITIVE);
|
||||
const std::optional<std::string> output = GetXdgAppOutput(argv);
|
||||
return output && output->starts_with("yes");
|
||||
}
|
||||
|
||||
// Todo implement
|
||||
|
||||
Reference in New Issue
Block a user