mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1239870 - Part 2: Split out NrIceCtx initialization. r=bwc
This splits NrIceCtx initialization into its own function so that the tests can initialize without having to create a dummy instance.
This commit is contained in:
parent
6964ea6946
commit
aac78e2895
@ -396,15 +396,10 @@ void NrIceCtx::trickle_cb(void *arg, nr_ice_ctx *ice_ctx,
|
||||
s->SignalCandidate(s, candidate_str);
|
||||
}
|
||||
|
||||
RefPtr<NrIceCtx> NrIceCtx::Create(const std::string& name,
|
||||
bool offerer,
|
||||
bool allow_loopback,
|
||||
bool tcp_enabled,
|
||||
bool allow_link_local,
|
||||
bool hide_non_default,
|
||||
Policy policy) {
|
||||
RefPtr<NrIceCtx> ctx = new NrIceCtx(name, offerer, policy);
|
||||
|
||||
void NrIceCtx::Init(bool allow_loopback,
|
||||
bool tcp_enabled,
|
||||
bool allow_link_local)
|
||||
{
|
||||
// Initialize the crypto callbacks and logging stuff
|
||||
if (!initialized) {
|
||||
NR_reg_init(NR_REG_MODE_LOCAL);
|
||||
@ -477,6 +472,19 @@ RefPtr<NrIceCtx> NrIceCtx::Create(const std::string& name,
|
||||
NR_reg_set_string((char *)NR_ICE_REG_PREF_FORCE_INTERFACE_NAME, const_cast<char*>(flat.get()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RefPtr<NrIceCtx> NrIceCtx::Create(const std::string& name,
|
||||
bool offerer,
|
||||
bool allow_loopback,
|
||||
bool tcp_enabled,
|
||||
bool allow_link_local,
|
||||
bool hide_non_default,
|
||||
Policy policy) {
|
||||
RefPtr<NrIceCtx> ctx = new NrIceCtx(name, offerer, policy);
|
||||
|
||||
// Initialize the crypto callbacks and logging stuff
|
||||
Init(allow_loopback, tcp_enabled, allow_link_local);
|
||||
|
||||
// Create the ICE context
|
||||
int r;
|
||||
|
@ -215,6 +215,10 @@ class NrIceCtx {
|
||||
ICE_POLICY_ALL
|
||||
};
|
||||
|
||||
static void Init(bool allow_loopback = false,
|
||||
bool tcp_enabled = true,
|
||||
bool allow_link_local = false);
|
||||
|
||||
// TODO(ekr@rtfm.com): Too many bools here. Bug 1193437.
|
||||
static RefPtr<NrIceCtx> Create(const std::string& name,
|
||||
bool offerer,
|
||||
|
Loading…
Reference in New Issue
Block a user