1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set sw=2 ts=8 et tw=80 ft=cpp : */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5  * You can obtain one at http://mozilla.org/MPL/2.0/. */
6 
7 #include "nr_socket_proxy_config.h"
8 
9 #include "mozilla/dom/ipc/IdType.h"
10 #include "mozilla/net/NeckoChannelParams.h"
11 #include "mozilla/net/WebrtcProxyConfig.h"
12 
13 namespace mozilla {
14 
15 class NrSocketProxyConfig::Private {
16  public:
17   net::WebrtcProxyConfig mProxyConfig;
18 };
19 
NrSocketProxyConfig(const net::WebrtcProxyConfig & aProxyConfig)20 NrSocketProxyConfig::NrSocketProxyConfig(
21     const net::WebrtcProxyConfig& aProxyConfig)
22     : mPrivate(new Private({aProxyConfig})) {}
23 
NrSocketProxyConfig(NrSocketProxyConfig && aOrig)24 NrSocketProxyConfig::NrSocketProxyConfig(NrSocketProxyConfig&& aOrig)
25     : mPrivate(std::move(aOrig.mPrivate)) {}
26 
27 NrSocketProxyConfig::~NrSocketProxyConfig() = default;
28 
GetConfig() const29 const net::WebrtcProxyConfig& NrSocketProxyConfig::GetConfig() const {
30   return mPrivate->mProxyConfig;
31 }
32 
GetForceProxy() const33 bool NrSocketProxyConfig::GetForceProxy() const {
34   return mPrivate->mProxyConfig.forceProxy();
35 }
36 }  // namespace mozilla
37