Cleaning up compiler warnings for nICEr. Major highlights:
- set _WINSOCK_DEPRECATED_NO_WARNINGS define in nicer.gyp for Windows
builds of nICEr to avoid warnings about inet_addr use in ice_ctx.c:102,
ice_ctx.c:297, ice_parser.c:465, and transport_addr_reg.c:143.
- move nr_ice_accumulate_count from ice_ctx.{h|c} to stun_util.{h|c}
as nr_accumulate_count to quiet warnings in turn_client_ctx.c and
stun_client_ctx.c.
- stun_msg.{h|c} - change nr_stun_attr_data_.length,
nr_stun_message_attribute.encoding_length and nr_stun_message_.length
from int to UINT2 (not size_t since other lengths in this header are
UINT2).
- stun_codec.{h|c} - lengths and offsets changed from int to UINT2 to
match changes in stun_msg.{h|c}
- r_data.{h|c} - change Data.len from int to size_t
- nr_crypto.{h|c} - change nr_ice_crypto_vtbl_ lengths from int to size_t
MozReview-Commit-ID: EF5v79RpqbI
--HG--
extra : rebase_source : ead30e2359ea6a6aada4dd222137302ba86fb972
This makes the code nicer. In particular, it removes many getter_Copies()
calls. The patch also converts a lot of nsCStrings to nsAutoCString, which will
avoid heap allocation in the common case.
The patch also renames PREF_CopyCharPref() as PREF_GetCStringPref(), because
it's actually getting a string, not a char, and that matches the existing
GetCString() and GetDefaultCString() methods. Correspondingly, it also renames
PREF_SetCharPref() as PREF_SetCStringPref().
The |aPrefName| arguments in nsIPrefBranch.idl remain as |string| because they
almost always involve passing in C string literals, and passing "foo" is much
nicer than passing NS_LITERAL_CSTRING("foo").
It's worth noting that early versions of this patch used |AUTF8String| instead
of |ACString|. But it turns out that libpref stores prefs internally as Latin1.
And |ACString| is compatible with Latin1 but |AUTF8String| isn't, because
non-ASCII Latin1 strings are not valid UTF-8!
MozReview-Commit-ID: D3f7a1Vl1oE
--HG--
extra : rebase_source : e6e4b15d6d210cfd93686f96400281f02bd1d06b
In the case of e10s, the ctx flags for default route only (and less
importantly in this case, proxy only) were not set on the ice ctx
when SetStunAddrs was called in PeerConnectionMedia.
MozReview-Commit-ID: CldUpJfaaH3
--HG--
extra : rebase_source : 6223722275d4741519890d4d2b8436b05ca43155
Two new calls are added to NrIceCtx.
1) A static call to allow StunAddrsRequestParent to get stun addrs from the main
process.
2) A call to allow StunAddrsRequestChild to pass the new stun addrs back to
PeerConnectionMedia on the content process.
PeerConnectionMedia, when running in e10s mode, sets up the StunAddrsRequestChild
and makes the async request to get the stun addrs. When they are returned, it
sets the stun addrs in NrIceCtx avoid the network calls that would otherwise
cause a further restricted sandbox to fail.
MozReview-Commit-ID: C2hYBzm6WNv
--HG--
extra : rebase_source : 4c71056850c418efdc0f709f4d838a3e0bf4bee2
No WebRTC session statistics will be saved until all PeerConnections
in private browsing window end. In addition, the shared
WebRTC ICE signalling log for that e10s process is disabled until the
private session close.
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout. The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.
CLOSED TREE makes big refactorings like this a piece of cake.
# The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
xargs perl -p -i -e '
s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
s/nsRefPtr ?</RefPtr</g; # handle declarations and variables
'
# Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h
# Handle nsRefPtr.h itself, a couple places that define constructors
# from nsRefPtr, and code generators specially. We do this here, rather
# than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
# things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
mfbt/nsRefPtr.h \
xpcom/glue/nsCOMPtr.h \
xpcom/base/OwningNonNull.h \
ipc/ipdl/ipdl/lower.py \
ipc/ipdl/ipdl/builtin.py \
dom/bindings/Codegen.py \
python/lldbutils/lldbutils/utils.py
# In our indiscriminate substitution above, we renamed
# nsRefPtrGetterAddRefs, the class behind getter_AddRefs. Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'
if [ -d .git ]; then
git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi
--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h