Skip to content

Commit

Permalink
RemotingHost: Use base::fixed_flat_set for invalid_browsers
Browse files Browse the repository at this point in the history
This change uses a base::fixed_flat_set rather than a base::NoDestructor
of base::flat_set for the static set of invalid_browsers.

Bug: 1150744
Change-Id: I68aed5aa12cea76d4a55f89d62e67fe3b99c8fd7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3164259
Commit-Queue: Prakhar Shrivastav <p.shri@samsung.com>
Reviewed-by: Yuwei Huang <yuweih@chromium.org>
Cr-Commit-Position: refs/heads/main@{#922420}
  • Loading branch information
Prakhar Shrivastav authored and Chromium LUCI CQ committed Sep 17, 2021
1 parent ec678ac commit 14caf1b
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
#include <gtk/gtk.h>

#include "base/command_line.h"
#include "base/containers/flat_set.h"
#include "base/containers/fixed_flat_set.h"
#include "base/environment.h"
#include "base/logging.h"
#include "base/no_destructor.h"
#include "base/process/launch.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
Expand Down Expand Up @@ -47,8 +46,8 @@ void ShowMessageDialog(const std::string& message) {
}

bool IsBrowserValid(const std::string& browser) {
static const base::NoDestructor<base::flat_set<std::string>> invalid_browsers(
{
static constexpr auto invalid_browsers =
base::MakeFixedFlatSet<base::StringPiece>({
// This is the chromoting forwarder itself.
"crd-url-forwarder.desktop",

Expand All @@ -59,7 +58,7 @@ bool IsBrowserValid(const std::string& browser) {
if (browser.empty()) {
return false;
}
return !invalid_browsers->contains(browser);
return !invalid_browsers.contains(browser);
}

// Shows a window for the user to choose the fallback browser then sets it on
Expand Down

0 comments on commit 14caf1b

Please sign in to comment.