828 Commits

Author SHA1 Message Date
deadbeef
f33491ebaf Revert of Removing #defines previously used for building without BoringSSL/OpenSSL. (patchset #2 id:20001 of https://codereview.webrtc.org/2640513002/ )
Reason for revert:
Broke chromium build, due to a config being removed. Will add it back and remove the dependency in a chromium CL.

Original issue's description:
> Removing #defines previously used for building without BoringSSL/OpenSSL.
>
> These defines don't work any more, so they only cause confusion:
>
> FEATURE_ENABLE_SSL
> HAVE_OPENSSL_SSL_H
> SSL_USE_OPENSSL
>
> BUG=webrtc:7025
>
> Review-Url: https://codereview.webrtc.org/2640513002
> Cr-Commit-Position: refs/heads/master@{#16196}
> Committed: eaa826c2ee

TBR=kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:7025

Review-Url: https://codereview.webrtc.org/2648003003
Cr-Commit-Position: refs/heads/master@{#16197}
2017-01-21 01:01:45 +00:00
deadbeef
eaa826c2ee Removing #defines previously used for building without BoringSSL/OpenSSL.
These defines don't work any more, so they only cause confusion:

FEATURE_ENABLE_SSL
HAVE_OPENSSL_SSL_H
SSL_USE_OPENSSL

BUG=webrtc:7025

Review-Url: https://codereview.webrtc.org/2640513002
Cr-Commit-Position: refs/heads/master@{#16196}
2017-01-20 23:15:58 +00:00
deadbeef
7bcdb69957 Ignore ufrag/password in "a=candidate" lines in SDP.
These attributes should be parsed in candidate trickling, but when
parsing a full session description, only "a=ice-ufrag"/"a=ice-pwd"
should be used to communicate the ufrag/password.

BUG=chromium:681286

Review-Url: https://codereview.webrtc.org/2639183002
Cr-Commit-Position: refs/heads/master@{#16194}
2017-01-20 20:43:58 +00:00
hbos
f64941f1a5 RTCMediaStreamTrackStats.framesDecoded collected.
According to spec:
https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamtrackstats-framesdecoded

BUG=webrtc:6757, chromium:659137, chromium:627816

Review-Url: https://codereview.webrtc.org/2642713004
Cr-Commit-Position: refs/heads/master@{#16192}
2017-01-20 15:39:09 +00:00
hbos
fefe076789 RTCMediaStreamTrackStats.framesSent collected by RTCStatsCollector.
BUG=webrtc:6757, chromium:659137, chromium:627816

Review-Url: https://codereview.webrtc.org/2606033002
Cr-Commit-Position: refs/heads/master@{#16188}
2017-01-20 14:14:25 +00:00
hbos
2d4d653e1f Fix msan flake in rtcstats_integrationtest.cc.
This CL https://codereview.webrtc.org/2641763003 changed echo return
loss /...enhancement stats from being optional to being undefined
because that was the observed behavior (and a TODO was added to
investigate why).

It turns out that these stats are sometimes available, e.g. if the test
runs for a while like MSAN bot does, so this turned the test flaky.
Example failure:
https://build.chromium.org/p/client.webrtc/builders/Linux%20MSan/builds/8242

This CL reverts that change without reverting the rest of the CL which
other CLs depend on, and updates the TODO.

BUG=chromium:627816
TBR=hta@webrtc.org
NOTRY=True
NOPRESUBMIT=True

Review-Url: https://codereview.webrtc.org/2640743007
Cr-Commit-Position: refs/heads/master@{#16187}
2017-01-20 12:16:41 +00:00
hbos
42f6d2fb6c RTCMediaStreamTrackStats.framesReceived collected by RTCStatsCollector.
VideoReceiverInfo::frames_received added based on
VideoReceiveStream::Stats::frame_counts (.key_frames + .delta_frames).

BUG=webrtc:6757, chromium:659137, chromium:627816

Review-Url: https://codereview.webrtc.org/2607913002
Cr-Commit-Position: refs/heads/master@{#16185}
2017-01-20 11:56:50 +00:00
hbos
9e30274c03 RTCMediaStreamTrackStats collected on a per-attachment basis.
According to recent spec change:
https://github.com/w3c/webrtc-stats/pull/138/files

This establishes the relationship between tracks and
[Voice/Video][Sender/Receiver]Info(s). Follow-up CLs will easily be able
to collect more stats from them.

BUG=webrtc:6757, chromium:659137, chromium:627816

Review-Url: https://codereview.webrtc.org/2641763003
Cr-Commit-Position: refs/heads/master@{#16181}
2017-01-20 10:47:10 +00:00
zhihuang
b2cdd93fd6 Remove the dependency of TransportChannel and TransportChannelImpl.
DtlsTransportChannelWrapper is renamed to be DtlsTransport which inherits from
DtlsTransportInternal. There will be no concept of "channel" in p2p level.
Both P2PTransportChannel and DtlsTransport don't depend on TransportChannel
and TransportChannelImpl any more and they are removed in this CL.

BUG=none

Review-Url: https://codereview.webrtc.org/2606123002
Cr-Commit-Position: refs/heads/master@{#16173}
2017-01-20 00:54:25 +00:00
zhihuang
6ce9259cb0 Revert of make the DtlsTransportWrapper inherit form DtlsTransportInternal (patchset #11 id:320001 of https://codereview.webrtc.org/2606123002/ )
Reason for revert:
Failed the memory check.
May need to fix the memory leak.

Original issue's description:
> make the DtlsTransportWrapper inherit form DtlsTransportInternal
>
> BUG=none
>
> Review-Url: https://codereview.webrtc.org/2606123002
> Cr-Commit-Position: refs/heads/master@{#16160}
> Committed: 5aed06c8d3

TBR=deadbeef@webrtc.org,pthatcher@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=none

Review-Url: https://codereview.webrtc.org/2639203004
Cr-Commit-Position: refs/heads/master@{#16162}
2017-01-19 12:49:47 +00:00
zhihuang
5aed06c8d3 make the DtlsTransportWrapper inherit form DtlsTransportInternal
BUG=none

Review-Url: https://codereview.webrtc.org/2606123002
Cr-Commit-Position: refs/heads/master@{#16160}
2017-01-19 09:48:02 +00:00
deadbeef
d1c0998730 Adding OrtcFactory, and changing UdpTransport to match current plan.
The factory follows the same principles as PeerConnectionFactory;
various modules can be passed into its constructor but default
implementations are provided. Currently the only object the factory can
create is a UdpTransport (need to start somewhere).

UdpTransportChannel (renamed to UdpTransport)
will now accept a socket passed into its constructor,
relying on the factory to create the socket. This allows some
simplifications to be made, such as getting rid of "State" since the
only states are now "has destination set or doesn't".

BUG=webrtc:7013

Review-Url: https://codereview.webrtc.org/2632613002
Cr-Commit-Position: refs/heads/master@{#16154}
2017-01-18 23:16:37 +00:00
deadbeef
d99a200fad Adding some features to proxy.h, and restructuring the macros.
New features are:
- Invoke a destructor on the worker thread.
- Make proxy wrapper for a non-refcounted object.
- Ability to use unique_ptrs (as arguments or return values).

These features are needed by this CL:
https://codereview.webrtc.org/2632613002/

BUG=None

Review-Url: https://codereview.webrtc.org/2628343003
Cr-Commit-Position: refs/heads/master@{#16151}
2017-01-18 16:55:23 +00:00
nisse
c8ee882753 Replace use of ASSERT in test code.
In top level test functions, replaced with gtest ASSERT_*. In helper
methods in main test files, replaced with EXPECT_* or RTC_DCHECK on a
case-by-case basis.

In separate mock/fake classes used by tests (which might be of some
use also in tests of third-party applications), ASSERT was replaced
with RTC_CHECK, using

  git grep -l ' ASSERT(' | grep -v common.h | \
    xargs sed -i 's/ ASSERT(/ RTC_CHECK(/'

followed by additional includes of base/checks.h in affected files,
and git cl format.

BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2622413005
Cr-Commit-Position: refs/heads/master@{#16150}
2017-01-18 15:20:55 +00:00
nisse
6da303db1d Reland of Delete rtc::linked_ptr. (patchset #1 id:1 of https://codereview.webrtc.org/2579753002/ )
Only use, in statstypes.h, replaced by rtc::scoped_refptr.

Reason for revert:
Intend to switch from unique_ptr to scoped_refptr,
and then reland.

Original issue's description:
> Revert of Delete rtc::linked_ptr. Only use, in statstypes.h, replaced bu std::unique_ptr. (patchset #1 id:1 of https://codereview.webrtc.org/2581663002/ )
>
> Reason for revert:
> This change broke Chrome too. It's stats processing wants to make a copy of webrtc's stats mapping, which is no longer possible with std::unique_ptr.
>
> Original issue's description:
> > Reland of Delete rtc::linked_ptr. Only use, in statstypes.h, replaced bu std::unique_ptr. (patchset #1 id:1 of https://codereview.webrtc.org/2576673002/ )
> >
> > Reason for revert:
> > Downstream project fixed to not make copies while iterating over the stats mapping.
> >
> > Original issue's description:
> > > Revert of Delete rtc::linked_ptr. Only use, in statstypes.h, replaced bu std::unique_ptr. (patchset #1 id:1 of https://codereview.webrtc.org/2567143003/ )
> > >
> > > Reason for revert:
> > > The change from rtc::linked_ptr to std::unique_ptr broke a downstream project.
> > >
> > > Original issue's description:
> > > > Delete rtc::linked_ptr. Only use, in statstypes.h, replaced with std::unique_ptr.
> > > >
> > > > BUG=webrtc:6424
> > > >
> > > > Committed: https://crrev.com/36f74e55792cae19db8b222c29aa38d6e0eb1225
> > > > Cr-Commit-Position: refs/heads/master@{#15588}
> > >
> > > TBR=solenberg@webrtc.org,pthatcher@webrtc.org,hta@webrtc.org
> > > # Skipping CQ checks because original CL landed less than 1 days ago.
> > > NOPRESUBMIT=true
> > > NOTREECHECKS=true
> > > NOTRY=true
> > > BUG=webrtc:6424
> > >
> > > Committed: https://crrev.com/8afbc8cba65d99bb7a0feece8fb3055b144106b1
> > > Cr-Commit-Position: refs/heads/master@{#15589}
> >
> > TBR=solenberg@webrtc.org,pthatcher@webrtc.org,hta@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:6424
> >
> > Committed: https://crrev.com/06035cf53abad80b0525f286a3b81e388cc7ee00
> > Cr-Commit-Position: refs/heads/master@{#15627}
>
> TBR=solenberg@webrtc.org,pthatcher@webrtc.org,hta@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6424
>
> Committed: https://crrev.com/6a58f33450a46370039cd82537612040a91165b3
> Cr-Commit-Position: refs/heads/master@{#15629}

TBR=solenberg@webrtc.org,pthatcher@webrtc.org,hta@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2641793002
Cr-Commit-Position: refs/heads/master@{#16148}
2017-01-18 14:10:54 +00:00
nisse
e8abe3ef1b Revert of New method StatsObserver::OnCompleteReports, passing ownership. (patchset #2 id:20001 of https://codereview.webrtc.org/2584553002/ )
Reason for revert:
The new method doesn't work as intended.

It can't pass ownership, because the StatsReports is a vector of raw pointers to StatReport objects owned by the StatsCollector.

Original issue's description:
> New method StatsObserver::OnCompleteReports, passing ownership.
>
> The new name, OnCompleteReports rather than OnComplete, is needed
> because in C++ method lookup, overriding a method hides all otherwise
> inherited methods with the same name, even if they have a different
> signature. And here, the intention is that each subclass should
> override one or the other of the two methods, and inherit the method it
> doesn't override.
>
> This cl is a prerequisite for
> https://codereview.webrtc.org/2567143003/, because the Chrome glue
> code needs to retain the stats report after the OnComplete method has
> returned.
>
> Currently, Chrome makes a copy of the stats mapping (which breaks when
> changing ValuePtr from an rtc::linked_ptr to an std::unique_ptr). After
> this cl, Chrome can be fixed to take ownership and no longer needs to
> copy anything, unblocking cl 2567143003.
>
> BUG=webrtc:6424
>
> Review-Url: https://codereview.webrtc.org/2584553002
> Cr-Commit-Position: refs/heads/master@{#15708}
> Committed: b36ee8d498

TBR=solenberg@webrtc.org,magjed@webrtc.org,tkchin@webrtc.org,hbos@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2641783002
Cr-Commit-Position: refs/heads/master@{#16144}
2017-01-18 13:00:34 +00:00
deadbeef
bad5dadef3 More minor improvements to BaseChannel/transport code.
Mostly from late comments on this CL:
https://codereview.webrtc.org/2614263002/

Changes SetTransport to DCHECK instead of returning false.
Renames it to SetTransports.
Fixes some possible transport resource leaks.

BUG=None

Review-Url: https://codereview.webrtc.org/2637503003
Cr-Commit-Position: refs/heads/master@{#16130}
2017-01-18 02:32:35 +00:00
hbos
160e4a78e3 RTCMediaStreamTrackStats.kind added and collected.
Implements recent spec change:
https://github.com/w3c/webrtc-stats/pull/127

BUG=chromium:659137, chromium:627816

Review-Url: https://codereview.webrtc.org/2623513006
Cr-Commit-Position: refs/heads/master@{#16111}
2017-01-17 10:53:23 +00:00
henrik.lundin
04a057b432 Add missing if-clause for residual_echo_likelihood_recent_max
This is a follow-up to https://codereview.webrtc.org/2629563003/.

BUG=webrtc:6797
TBR=solenberg@webrtc.org

Review-Url: https://codereview.webrtc.org/2632243002
Cr-Commit-Position: refs/heads/master@{#16103}
2017-01-17 07:53:59 +00:00
hbos
7064d5929a RTCTransportStats.dtlsState replaces .activeConnection
In accordance with recent spec change:
https://github.com/w3c/webrtc-stats/pull/122

BUG=chromium:653873, chromium:627816

Review-Url: https://codereview.webrtc.org/2625993002
Cr-Commit-Position: refs/heads/master@{#16098}
2017-01-16 15:38:02 +00:00
hbos
84abeb1d37 RTC[In/Out]boundRTPStreamStats.mediaTrackId collected.
Based on the mapping between [Audio/Video]TrackInterface and
[Voice/Video][Sender/Receiver]Info.

The IDs of RTCMediaStreamTrackStats are updated to distinguish between
local and remote cases. Previously, if local and remote cases had the
same label only one of them would be included in the report (bug).

BUG=webrtc:6758, chromium:657854, chromium:657855, chromium:657856, chromium:627816

Review-Url: https://codereview.webrtc.org/2610843003
Cr-Commit-Position: refs/heads/master@{#16095}
2017-01-16 14:16:44 +00:00
hbos
1f8239ca6f TrackMediaInfoMap added.
This maps, in both directions, [Audio/Video]TrackInterface with
[Voice/Video][Sender/Receiver]Info.

This mapping is necessary for RTCStatsCollector to know the relationship
between RTCMediaStreamTrackStats and RTC[In/Out]boundRTPStreamStats, and
to be able to collect several RTCMediaStreamTrackStats stats.

BUG=webrtc:6757, chromium:659137, chromium:657854, chromium:627816

Review-Url: https://codereview.webrtc.org/2611983002
Cr-Commit-Position: refs/heads/master@{#16090}
2017-01-16 12:24:10 +00:00
ivoc
4e477a1d7b Added a new echo likelihood stat that reports the maximum value from a previous time period.
BUG=webrtc:6797

Review-Url: https://codereview.webrtc.org/2629563003
Cr-Commit-Position: refs/heads/master@{#16079}
2017-01-15 16:29:46 +00:00
deadbeef
fe0fd41bb9 Stop using deprecated constraints-based version of CreateAudioSource.
Also did some slight refactoring of the code that turns constraints
into rtc::Optionals. Used a template method to avoid code duplication,
and used the same pattern for "CopyConstraintsIntoAudioOptions" as was
being used for "CopyConstraintsIntoRtcConfiguration".

BUG=webrtc:6752

Review-Url: https://codereview.webrtc.org/2628523003
Cr-Commit-Position: refs/heads/master@{#16063}
2017-01-13 19:47:56 +00:00
nisse
a9dd4a1b11 Replace left-over ASSERTs in httpcommon.h and webrtcsession.cc.
BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2630553003
Cr-Commit-Position: refs/heads/master@{#16055}
2017-01-13 15:08:34 +00:00
deadbeef
ac22f70906 Refactoring of RTCP options in BaseChannel.
Previously, BaseChannel supported a "no RTCP" mode, which wasn't
being used any more and is being deleted.

Also, "RTCP mux required" previously worked by calling "ActivateRtcpMux"
after construction. Now it works by explicitly passing a
"require_rtcp_mux" parameter into the constructor.

BUG=None

Review-Url: https://codereview.webrtc.org/2622613004
Cr-Commit-Position: refs/heads/master@{#16045}
2017-01-13 05:59:29 +00:00
zhihuang
f5b251b816 Remove BaseChannel's dependency on TransportController.
The BaseChannel can set the transport directly without depending on
TransportController.

When initializing the network of the BaseChannel, the ChannelManager will
create TransportChannels with the TransportController.
When enabling bundling, WebRtcSession will get or create TransportChannels
with the TransportController.

When a TransportChannel of the BaseChannel needs to be destroyed, it will
fire a signal to notify the WebRtcSession.

BUG=none.

Review-Url: https://codereview.webrtc.org/2614263002
Cr-Commit-Position: refs/heads/master@{#16043}
2017-01-13 03:37:48 +00:00
nisse
ede5da4960 Replace ASSERT by RTC_DCHECK in all non-test code.
Bulk of the changes were produced using

  git grep -l ' ASSERT(' | grep -v test | grep -v 'common\.h' |\
    xargs -n1 sed -i 's/ ASSERT(/ RTC_DCHECK(/'

followed by additional includes of base/checks.h in affected files,
and git cl format.

Also had to do some tweaks to #if !defined(NDEBUG) logic in the
taskrunner code (webrtc/base/task.cc, webrtc/base/taskparent.cc,
webrtc/base/taskparent.h, webrtc/base/taskrunner.cc), replaced to
consistently use RTC_DCHECK_IS_ON, and some of the checks needed
additional #if protection.

Test code was excluded, because it should probably use RTC_CHECK
rather than RTC_DCHECK.

BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2620303003
Cr-Commit-Position: refs/heads/master@{#16030}
2017-01-12 13:15:36 +00:00
nisse
eb4ca4e823 Replace RTC_DCHECK(false) with RTC_NOTREACHED().
Bulk of changes done using

  git grep -l 'RTC_DCHECK(false)' | \
    xargs sed -i 's/RTC_DCHECK(false)/RTC_NOTREACHED()/'

peerconnection.cc also used RTC_DCHECK(false && "msg") in two places,
which were updated manually.

BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2623313004
Cr-Commit-Position: refs/heads/master@{#16026}
2017-01-12 10:24:27 +00:00
skvlad
1d3c7e0b16 Move MetricsObserverInterface out of peerconnectioninterface.h
This change moves the definition of the UMA MetricsObserverInterface from api/peerconnectioninterface.h into api/umametrics.h. This allows us to remove the unwanted dependency on peerconnectioninterface.h from files in webrtc/p2p.

This is a simple refactoring with no functional changes.

BUG=None

Review-Url: https://codereview.webrtc.org/2627093005
Cr-Commit-Position: refs/heads/master@{#16020}
2017-01-12 01:50:30 +00:00
deadbeef
293e926362 Reland of: Adding error output param to SetConfiguration, using new RTCError type.
Most notably, will return "INVALID_MODIFICATION" if a field in the
configuration was modified and modification of that field isn't supported.

Also changing RTCError to a class that wraps an enum type, because it will
eventually need to hold other information (like SDP line number), to match
the RTCError that was recently added to the spec:
https://github.com/w3c/webrtc-pc/pull/850

BUG=webrtc:6916

Review-Url: https://codereview.webrtc.org/2587133004
Cr-Original-Commit-Position: refs/heads/master@{#15777}
Committed: 7a5fa6cd61
Review-Url: https://codereview.webrtc.org/2587133004
Cr-Commit-Position: refs/heads/master@{#16016}
2017-01-11 20:28:30 +00:00
nisse
c80e741ad0 Replace ASSERT(false) by RTC_NOTREACHED().
This cl was produced by

  git grep -l 'ASSERT(false)' |\
    xargs -n1 sed -i 's/ASSERT(false)/RTC_NOTREACHED()/'

followed by additional includes of base/checks.h in affected files,
git cl format to adjust spacing in webrtc/base/transformadapter.cc.
Finally, to make presubmit happy, one unnamed TODO marker was deleted
in that file.

This is a step towards deletion of base/common.h.

BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2625003003
Cr-Commit-Position: refs/heads/master@{#16009}
2017-01-11 13:56:46 +00:00
hbos
bb377517cd RTCMediaStreamTrackStats.ssrcIds removed.
As per recent spec change:
https://github.com/w3c/webrtc-stats/pull/129

BUG=chromium:659137, chromium:627816

Review-Url: https://codereview.webrtc.org/2628573002
Cr-Commit-Position: refs/heads/master@{#16006}
2017-01-11 12:47:23 +00:00
nisse
af916899cc Move VideoFrame and related declarations to webrtc/api/video.
Moves webrtc/common_video/rotation.h and parts of
webrtc/common_video/include/video_frame_buffer.h and
webrtc/video_frame.h, and adds to a new GN target api:video_frame_api.

BUG=webrtc:5880

Review-Url: https://codereview.webrtc.org/2517173004
Cr-Commit-Position: refs/heads/master@{#15993}
2017-01-10 15:44:26 +00:00
magjed
48e779f31d Final removal of webrtc/api/android
External dependencies have been updated to use webrtc/sdk/android
instead, and we can remove the remaining files in webrtc/api/android.

BUG=webrtc:5882
TBR=tommi

Review-Url: https://codereview.webrtc.org/2628553003
Cr-Commit-Position: refs/heads/master@{#15985}
2017-01-10 11:43:21 +00:00
deadbeef
953c2cea5e Reland of: Separating SCTP code from BaseChannel/MediaChannel.
The BaseChannel code is geared around RTP; the presence of media engines,
send and receive streams, SRTP, SDP directional attribute negotiation, etc.
It doesn't make sense to use it for SCTP as well. This separation should make
future work both on BaseChannel and the SCTP code paths easier.

SctpDataEngine now becomes SctpTransport, and is used by WebRtcSession
directly. cricket::DataChannel is also renamed, to RtpDataChannel, so it
doesn't get confused with webrtc::DataChannel any more.

Beyond just moving code around, some consequences of this CL:
- We'll now stop using the worker thread for SCTP. Packets will be
  processed right on the network thread instead.
- The SDP directional attribute is ignored, as it's supposed to be.

BUG=None

Review-Url: https://codereview.webrtc.org/2564333002
Cr-Original-Commit-Position: refs/heads/master@{#15906}
Committed: 67b3bbe639
Review-Url: https://codereview.webrtc.org/2564333002
Cr-Commit-Position: refs/heads/master@{#15973}
2017-01-09 22:53:41 +00:00
hnsl
0483362377 Add disabled certificate check support to IceServer PeerConnection API.
Refactor "OPT_SSLTCP" renaming it to "OPT_TLS_FAKE", making it clear
that it's not actually some kind of SSL over TCP. Also making it clear
that it's mutually exclusive with OPT_TLS. Maintaining deprecated
backwards compatible support for "OPT_SSLTCP".

Add "OPT_TLS_INSECURE" that implements the new certificate-check
disabled TLS mode, which is also mutually exclusive with the other
TLS options.

PortAllocator: Add a new TLS policy enum TlsCertPolicy which defines
the new insecure mode and added it as a RelayCredentials member.

TurnPort: Add new TLS policy member with appropriate getter and setter
to avoid constructor bloat. Initialize it from the RelayCredentials
after the TurnPort is created.

Expose the new feature in the PeerConnection API via
IceServer.tls_certificate_policy as well as via the Android JNI
PeerConnection API.

For security reasons we ensure that:

	1) The policy is always explicitly initialized to secure.
        2) API users have to explicitly integrate with the feature to
           use it, and will otherwise get no change in behavior.
	3) The feature is not immediately exposed in non-native
	   contexts. For example, disabling of certificate validation
           is not implemented via URI parsing since this would
           immediately allow it to be used from a web page.

This is a second attempt of https://codereview.webrtc.org/2557803002/
which was rolled back in https://codereview.webrtc.org/2590153002/

BUG=webrtc:6840

Review-Url: https://codereview.webrtc.org/2594623002
Cr-Commit-Position: refs/heads/master@{#15967}
2017-01-09 16:35:45 +00:00
deadbeef
c0dad89bed Revert of Separating SCTP code from BaseChannel/MediaChannel. (patchset #14 id:240001 of https://codereview.webrtc.org/2564333002/ )
Reason for revert:
Hitting DCHECK in chromium's WebrtcTransportTest.TerminateDataChannel and WebrtcTransportTest.DataStreamLate. Will investigate and reland.

Original issue's description:
> Separating SCTP code from BaseChannel/MediaChannel.
>
> The BaseChannel code is geared around RTP; the presence of media engines,
> send and receive streams, SRTP, SDP directional attribute negotiation, etc.
> It doesn't make sense to use it for SCTP as well. This separation should make
> future work both on BaseChannel and the SCTP code paths easier.
>
> SctpDataEngine now becomes SctpTransport, and is used by WebRtcSession
> directly. cricket::DataChannel is also renamed, to RtpDataChannel, so it
> doesn't get confused with webrtc::DataChannel any more.
>
> Beyond just moving code around, some consequences of this CL:
> - We'll now stop using the worker thread for SCTP. Packets will be
>   processed right on the network thread instead.
> - The SDP directional attribute is ignored, as it's supposed to be.
>
> BUG=None
>
> Review-Url: https://codereview.webrtc.org/2564333002
> Cr-Commit-Position: refs/heads/master@{#15906}
> Committed: 67b3bbe639

TBR=pthatcher@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=None

Review-Url: https://codereview.webrtc.org/2614813003
Cr-Commit-Position: refs/heads/master@{#15908}
2017-01-05 04:28:21 +00:00
deadbeef
67b3bbe639 Separating SCTP code from BaseChannel/MediaChannel.
The BaseChannel code is geared around RTP; the presence of media engines,
send and receive streams, SRTP, SDP directional attribute negotiation, etc.
It doesn't make sense to use it for SCTP as well. This separation should make
future work both on BaseChannel and the SCTP code paths easier.

SctpDataEngine now becomes SctpTransport, and is used by WebRtcSession
directly. cricket::DataChannel is also renamed, to RtpDataChannel, so it
doesn't get confused with webrtc::DataChannel any more.

Beyond just moving code around, some consequences of this CL:
- We'll now stop using the worker thread for SCTP. Packets will be
  processed right on the network thread instead.
- The SDP directional attribute is ignored, as it's supposed to be.

BUG=None

Review-Url: https://codereview.webrtc.org/2564333002
Cr-Commit-Position: refs/heads/master@{#15906}
2017-01-05 02:38:02 +00:00
ehmaldonado
da8dcfb43e Refactor rtc_unittests into several targets.
Also fix some warnings.

NOTRY=True
BUG=webrtc:6954

Review-Url: https://codereview.webrtc.org/2611663002
Cr-Commit-Position: refs/heads/master@{#15900}
2017-01-04 15:11:23 +00:00
deadbeef
12771a1910 Relax parsing of a=bundle-only with a nonzero port.
This use of a=bundle-only is unspecified, but not disallowed, so it
should simply result in the attribute being ignored, not a parse
failure.

Note that older versions of Firefox may generate SDP with a=bundle-only
and a nonzero port, so this also fixes an interop issue. See:
https://bugzilla.mozilla.org/show_bug.cgi?id=1325991

BUG=webrtc:4674

Review-Url: https://codereview.webrtc.org/2609863003
Cr-Commit-Position: refs/heads/master@{#15890}
2017-01-03 21:53:47 +00:00
hbos
b4e426e8db RTCIceCandidateStats.transportId added and collected.
BUG=webrtc:6756, chromium:632723, chromium:627816

Review-Url: https://codereview.webrtc.org/2597963002
Cr-Commit-Position: refs/heads/master@{#15875}
2017-01-02 17:59:31 +00:00
pbos
c7c26a0e64 Reland of place basictypes.h with stdint.h for int_t types. (patchset #1 id:1 of https://codereview.webrtc.org/2603203003/ )
Reason for revert:
Doing a reland where systeminfo.cc includes basictypes.h so that CPU_X86 etc. are defined when they are checked/used.

Original issue's description:
> Revert of Replace basictypes.h with stdint.h for int_t types. (patchset #1 id:1 of https://codereview.webrtc.org/2604043002/ )
>
> Reason for revert:
> Very likely cause of Chromium import bot breakage (unused function '__cpuid'), TBD why.
>
> Original issue's description:
> > Replace basictypes.h with stdint.h for int_t types.
> >
> > Removes basictypes.h for types that only makes use of it for fixed-size-int
> > typedefs and replaces it with stdint.h.
> >
> > BUG=webrtc:6853
> > R=tommi@webrtc.org
> >
> > Review-Url: https://codereview.webrtc.org/2604043002
> > Cr-Commit-Position: refs/heads/master@{#15867}
> > Committed: 7fd1a75300
>
> TBR=tommi@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6853
>
> Review-Url: https://codereview.webrtc.org/2603203003
> Cr-Commit-Position: refs/heads/master@{#15869}
> Committed: 7eb0e23bcf

BUG=webrtc:6853
TBR=tommi@webrtc.org

Review-Url: https://codereview.webrtc.org/2609783002
Cr-Commit-Position: refs/heads/master@{#15873}
2017-01-02 16:42:32 +00:00
hbos
6769c49418 RTC[In/Out]boundRTPStreamStats: qpSum,framesDecoded,framesEncoded added.
Recently added to the spec:
RTCRTPStreamStats.qpSum - https://w3c.github.io/webrtc-stats/#dom-rtcrtpstreamstats-qpsum
RTCInboundRTPStreamStats.framesDecoded - https://w3c.github.io/webrtc-stats/#dom-rtcinboundrtpstreamstats-framesdecoded
RTCOutboundRTPStreamStats.framesEncoded - https://w3c.github.io/webrtc-stats/#dom-rtcoutboundrtpstreamstats-framesencoded

These are added and collected. However, the qpSum is only collected in
the outbound case. It should be collected in the inbound case before
closing crbug.com/657855

BUG=chromium:657854, chromium:657855, chromium:657856

Review-Url: https://codereview.webrtc.org/2588373005
Cr-Commit-Position: refs/heads/master@{#15872}
2017-01-02 16:35:13 +00:00
hbos
d17a5a7709 RTCIceCandidateStats.deleted = false added.
Since previously, only the deleted = false case is supported, but now
that stat is added. It's a recent addition to the spec:
https://w3c.github.io/webrtc-stats/#dom-rtcicecandidatestats-deleted

BUG=webrtc:6756, chromium:632723, chromium:627816

Review-Url: https://codereview.webrtc.org/2591963003
Cr-Commit-Position: refs/heads/master@{#15871}
2017-01-02 16:09:59 +00:00
hbos
06495bcbb7 RTCIceCandidatePairStats.[state/priority] added, ConnectionInfo updated.
State and priority added to ConnectionInfo. The Connection::State enum
is replaced by IceCandidatePairState enum class.

At P2PTransportChannel::GetStats, Connection::stats is called, producing
ConnectionInfo for the connection that is then filled in with additional
values from the Connection. This is refactored so that all values are
set by Connection::stats.

RTCStatsCollector is updated to surface the ConnectionInfo stats.

BUG=webrtc:6755, chromium:633550, chromium:627816

Review-Url: https://codereview.webrtc.org/2597423003
Cr-Commit-Position: refs/heads/master@{#15870}
2017-01-02 16:08:18 +00:00
pbos
7eb0e23bcf Revert of Replace basictypes.h with stdint.h for int_t types. (patchset #1 id:1 of https://codereview.webrtc.org/2604043002/ )
Reason for revert:
Very likely cause of Chromium import bot breakage (unused function '__cpuid'), TBD why.

Original issue's description:
> Replace basictypes.h with stdint.h for int_t types.
>
> Removes basictypes.h for types that only makes use of it for fixed-size-int
> typedefs and replaces it with stdint.h.
>
> BUG=webrtc:6853
> R=tommi@webrtc.org
>
> Review-Url: https://codereview.webrtc.org/2604043002
> Cr-Commit-Position: refs/heads/master@{#15867}
> Committed: 7fd1a75300

TBR=tommi@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6853

Review-Url: https://codereview.webrtc.org/2603203003
Cr-Commit-Position: refs/heads/master@{#15869}
2017-01-02 15:32:25 +00:00
pbos
7fd1a75300 Replace basictypes.h with stdint.h for int_t types.
Removes basictypes.h for types that only makes use of it for fixed-size-int
typedefs and replaces it with stdint.h.

BUG=webrtc:6853
R=tommi@webrtc.org

Review-Url: https://codereview.webrtc.org/2604043002
Cr-Commit-Position: refs/heads/master@{#15867}
2017-01-02 14:58:46 +00:00
hbos
23351197fb Improve rtcstats_integrationtest.cc by sanity checking values.
TestMemberIsPositive and TestMemberIsNonNegative added and used in test.

BUG=chromium:627816

Review-Url: https://codereview.webrtc.org/2593623002
Cr-Commit-Position: refs/heads/master@{#15866}
2017-01-02 14:52:19 +00:00
pbos
9baddf25b9 Replace basictypes.h with stddef.h for size_t.
Files only making use of size_t from basictypes.h are replaced with
stddef.h, except in cases where they already for instance use stdio.h or
stdlib.h that already provide size_t.

BUG=webrtc:6853
R=tommi@webrtc.org

Review-Url: https://codereview.webrtc.org/2605123002
Cr-Commit-Position: refs/heads/master@{#15865}
2017-01-02 14:44:41 +00:00