These classes were hoisted and renamed. This has been replaced in Chromium as well. This is a mechanical change for Brave, done with the following script. ``` git grep -lw 'Value::List' | xargs sed -i 's/\bValue::List\b/ListValue/g' git grep -lw 'Value::Dict' | xargs sed -i 's/\bValue::Dict\b/DictValue/g' git cl format ``` Chromium changes: https://chromium.googlesource.com/chromium/src/+/6bc468d481835992696083e99e556516fb7f5f80 ``` commit 6bc468d481835992696083e99e556516fb7f5f80 Author: Avi Drissman <avi@chromium.org> Date: Thu Jan 29 22:14:50 2026 -0800 Remove aliases for base::DictValue and base::ListValue This removes a few last stragglers as well. Fixed: 478100525 Cq-Include-Trybots: luci.chromium.try:win-official,mac-official,linux-official,android-official,android-desktop-x64-official Change-Id: If92142b8ab0562a82c609b71c6b2a7665cea6ec6 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7513889 Auto-Submit: Avi Drissman <avi@chromium.org> Commit-Queue: Daniel Cheng <dcheng@chromium.org> Owners-Override: Daniel Cheng <dcheng@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Cr-Commit-Position: refs/heads/main@{#1577038} ``` Issue: https://github.com/brave/brave-browser/issues/52435
66 lines
1.9 KiB
C++
66 lines
1.9 KiB
C++
/* Copyright (c) 2021 The Brave Authors. All rights reserved.
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef BRAVE_COMPONENTS_TOR_TOR_UTILS_H_
|
|
#define BRAVE_COMPONENTS_TOR_TOR_UTILS_H_
|
|
|
|
#include <map>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "base/values.h"
|
|
|
|
class PrefService;
|
|
|
|
namespace tor {
|
|
|
|
struct BridgesConfig {
|
|
// This enum is used in prefs & UI. Be careful when editing.
|
|
// UI reference: brave_tor_subpage.js
|
|
enum class Usage {
|
|
kNotUsed = 0,
|
|
kBuiltIn = 1,
|
|
kRequest = 2,
|
|
kProvide = 3,
|
|
};
|
|
|
|
// This enum is used in prefs & UI. Be careful when editing.
|
|
// UI reference: brave_tor_subpage.js
|
|
enum class BuiltinType {
|
|
kSnowflake = 0,
|
|
kObfs4 = 1,
|
|
kMeekAzure = 2,
|
|
};
|
|
|
|
BridgesConfig();
|
|
BridgesConfig(BridgesConfig&&) noexcept;
|
|
BridgesConfig(const BridgesConfig&) = delete;
|
|
~BridgesConfig();
|
|
|
|
BridgesConfig& operator=(BridgesConfig&&) noexcept;
|
|
BridgesConfig& operator=(const BridgesConfig&) = delete;
|
|
|
|
const std::vector<std::string>& GetBuiltinBridges() const;
|
|
void UpdateBuiltinBridges(const base::DictValue& dict);
|
|
|
|
static std::optional<BridgesConfig> FromDict(const base::DictValue& dict);
|
|
static std::optional<BridgesConfig> FromValue(const base::Value* v);
|
|
base::DictValue ToDict(bool include_builtin = true) const;
|
|
base::Value ToValue(bool include_builtin = true) const;
|
|
|
|
Usage use_bridges = Usage::kNotUsed;
|
|
BuiltinType use_builtin = BuiltinType::kObfs4;
|
|
std::map<BuiltinType, std::vector<std::string>> builtin_bridges;
|
|
std::vector<std::string> requested_bridges;
|
|
std::vector<std::string> provided_bridges;
|
|
};
|
|
|
|
void MigrateLastUsedProfileFromLocalStatePrefs(PrefService* local_state);
|
|
|
|
} // namespace tor
|
|
|
|
#endif // BRAVE_COMPONENTS_TOR_TOR_UTILS_H_
|