src/net/http/http_server_properties_manager.cc
// Takes in a base::Value representing a dictionary, and whether
// NetworkIsolationKeys are enabled for HttpServerProperties, and extracts the
// NetworkIsolationKey stored with the |kNetworkIsolationKey| in the dictionary,
// and writes it to |out_network_isolation_key|. Returns false if unable to load
// a NetworkIsolationKey, or the NetworkIsolationKey is non-empty, but
// |use_network_isolation_key| is false.
Takes in a base::Value representing a dictionary, and whether
NetworkIsolationKeys are enabled for HttpServerProperties, and extracts the
NetworkIsolationKey stored with the |kNetworkIsolationKey| in the dictionary,
and writes it to |out_network_isolation_key|. Returns false if unable to load
a NetworkIsolationKey, or the NetworkIsolationKey is non-empty, but
|use_network_isolation_key| is false.
Takes in a base :: Value representing a dictionary and whether NetworkIsolationKeys are enabled for HttpServerProperties and extracts the NetworkIsolationKey stored with the |kNetworkIsolationKey| in the dictionary and writes it to |out_network_isolation_key| . Returns false if unable to load a NetworkIsolationKey or the NetworkIsolationKey is non - empty but |use_network_isolation_key| is false .
bool GetNetworkIsolationKeyFromDict(
    const base::Value& dict,
    bool use_network_isolation_key,
    NetworkIsolationKey* out_network_isolation_key) {
  DCHECK(dict.is_dict());
  const base::Value* network_isolation_key_value =
      dict.FindKey(kNetworkIsolationKey);
  NetworkIsolationKey network_isolation_key;
  if (!network_isolation_key_value ||
      !NetworkIsolationKey::FromValue(*network_isolation_key_value,
                                      &network_isolation_key)) {
    return false;
  }
  if (!use_network_isolation_key && !network_isolation_key.IsEmpty())
    return false;
  *out_network_isolation_key = std::move(network_isolation_key);
  return true;
}
bool GetNetworkIsolationKeyFromDict ( const base :: Value & dict , bool use_network_isolation_key , NetworkIsolationKey * out_network_isolation_key ) { DCHECK ( dict . is_dict ( ) ) ; const base :: Value * network_isolation_key_value = dict . FindKey ( kNetworkIsolationKey ) ; NetworkIsolationKey network_isolation_key ; if ( ! network_isolation_key_value || ! NetworkIsolationKey :: FromValue ( * network_isolation_key_value , & network_isolation_key ) ) { return false ; } if ( ! use_network_isolation_key && ! network_isolation_key . IsEmpty ( ) ) return false ; * out_network_isolation_key = std :: move ( network_isolation_key ) ; return true ; }
Takes in a base::Value representing a dictionary, and whether
NetworkIsolationKeys are enabled for HttpServerProperties, and extracts the
NetworkIsolationKey stored with the |kNetworkIsolationKey| in the dictionary,
and writes it to |out_network_isolation_key|.
Takes in a base :: Value representing a dictionary and whether NetworkIsolationKeys are enabled for HttpServerProperties and extracts the NetworkIsolationKey stored with the |kNetworkIsolationKey| in the dictionary and writes it to |out_network_isolation_key| .
// Fail if NetworkIsolationKeys are disabled, but the entry has a non-empty // NetworkIsolationKey.