mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-03 18:47:53 +00:00
f0c929ff2d
PStunAddrsRequest.ipdl defines the new IPC protocol to get stun addrs on the main process. StunAddrsRequestChild requests the stun addrs from the parent. StunAddrsRequestParent uses a static method on NrIceCtx to get the stun addrs from the STS thead and sends the addrs back to the child process. NrIceStunAddr (nricestunaddr.{cpp|h}) wraps nr_local_addr and makes it easier to serialize/deserialize over IPC. NrIceStunAddrMessageUtils follows the pattern used by other Necko IPC classes to define top-level serialization/deserialization calls used by the IPC framework. Modifications under netwerk/ipc are to connect the new IPC protocol to get stun addrs to PNecko since it is a network related IPC protocol. MozReview-Commit-ID: GyEapBe5krl --HG-- extra : rebase_source : c650d6aa4f7928bcae6032424303869074a755d4
38 lines
1011 B
C++
38 lines
1011 B
C++
/* 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 nricestunaddr_h__
|
|
#define nricestunaddr_h__
|
|
|
|
#include "nsError.h" // for nsresult
|
|
|
|
typedef struct nr_local_addr_ nr_local_addr;
|
|
|
|
namespace mozilla {
|
|
|
|
class NrIceStunAddr {
|
|
public:
|
|
NrIceStunAddr(); // needed for IPC deserialization
|
|
explicit NrIceStunAddr(const nr_local_addr* addr);
|
|
NrIceStunAddr(const NrIceStunAddr& rhs);
|
|
|
|
~NrIceStunAddr();
|
|
|
|
const nr_local_addr& localAddr() const { return *localAddr_; }
|
|
|
|
// serialization/deserialization helper functions for use
|
|
// in media/mtransport/ipc/NrIceStunAddrMessagUtils.h
|
|
size_t SerializationBufferSize() const;
|
|
nsresult Serialize(char* buffer, size_t buffer_size) const;
|
|
nsresult Deserialize(const char* buffer, size_t buffer_size);
|
|
|
|
private:
|
|
nr_local_addr* localAddr_;
|
|
|
|
};
|
|
|
|
} // namespace mozilla
|
|
|
|
#endif // nricestunaddr_h__
|