Commit Graph

297 Commits

Author SHA1 Message Date
6bbeb080b8 Extract rtc_base/base64.h and rtc_base/base64.cc into separate target.
Extract rtc_base/base64.h and rtc_base/base64.cc into separate target
to prepare to move them into third_party

Bug: webrtc:8366
Change-Id: I477e6da2b9d09307439b3272261f31042f479d74
Reviewed-on: https://webrtc-review.googlesource.com/83980
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23645}
2018-06-18 16:44:47 +00:00
ae1888629a Disable new RTC_CHECK unittest
For some reason this test fails on g3. The

TBR=kwiberg

No-Try: true
Bug: webrtc:8982
Change-Id: I6c6a78bab36eab0972e2fa24344d3cca63daa3b3
Reviewed-on: https://webrtc-review.googlesource.com/83940
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23639}
2018-06-18 09:34:08 +00:00
f8e5c110ee Refactor checks to use a copy of the new logging backend.
As a bonus, this shrinks the android release version of libjingle_peerconnection_so.so by ~25k in local tests.

We could try to unify the backend with the logging one, but that turns out to be surprisingly tricky due to dependency loops and chromium overrides.

Bug: webrtc:8982
Change-Id: I66854dd333f568d9b2a5f46bbead14b2e31179be
Reviewed-on: https://webrtc-review.googlesource.com/79623
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23634}
2018-06-15 13:48:25 +00:00
394b4ebe38 Delete unused methods on rtc::Pathname.
Deleted methods Normalize(), clear(), empty(), folder(), parent_folder().

Bug: webrtc:6424
Change-Id: I7a7096b23f4ba675305de1728988d2cfb48f135f
Reviewed-on: https://webrtc-review.googlesource.com/80520
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23623}
2018-06-15 09:25:35 +00:00
9eb38866cd Adds field trial parser.
Bug: webrtc:9346
Change-Id: Ibd07a1753feaa40d4be4d465d61f55bc8a8a9325
Reviewed-on: https://webrtc-review.googlesource.com/80263
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23615}
2018-06-14 16:02:38 +00:00
671cae2c7c Handle FileRotatingStreams with long file names
Bug: webrtc:9392
Change-Id: I7b42b1a6ed1b646c244bc64f1bad92a2f38e5539
Reviewed-on: https://webrtc-review.googlesource.com/83162
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23608}
2018-06-14 08:21:48 +00:00
d294c85b36 LogMessage::UpdateMinLogSeverity: Don't ignore all but the last stream
Bug reported by andrey.semashev@gmail.com.

Bug: webrtc:9364
Change-Id: I49ef8969afc5bcd55d9e5ecbe644fe190a436c7b
Reviewed-on: https://webrtc-review.googlesource.com/83124
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23578}
2018-06-12 10:56:21 +00:00
39da65b24d remove unused UNSHIPPED trace macros
Bug: webrtc:9387
Change-Id: Id8d80b5187f836dba42510910cfad24685fe6b18
Reviewed-on: https://webrtc-review.googlesource.com/82940
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23575}
2018-06-12 07:53:47 +00:00
1127fb9856 Re-enabling SanitizerTest.MsanUninitialized.
Using EXPECT_DEATH instead of __msan_set_expect_umr.

Bug: webrtc:9116
Change-Id: I40222e920cd213d3d1366629023d4d1c4fbc35f9
Reviewed-on: https://webrtc-review.googlesource.com/79661
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23532}
2018-06-07 11:39:15 +00:00
ac1501acd9 Throw exception in Java if log tag or message is null
Change-Id: If1d2cefcdf5441381bd6c06416cab24883d31481
Bug: webrtc:9357
Reviewed-on: https://webrtc-review.googlesource.com/80963
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Magnus Jedvert <magjed@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23510}
2018-06-04 14:58:09 +00:00
5abd78b40a Revert "Reland "Injectable logging""
This reverts commit 21219a0e43446701810236fb9fdd59be072c12df.

Reason for revert: No tags are written when routing logs to a file - b/86953692

Original change's description:
> Reland "Injectable logging"
> 
> Any injected loggable or NativeLogger would be deleted if PCFactory
> was reinitialized without calling setInjectableLogger. Now native
> logging is not implemented as a Loggable, so it will remain active
> unless a Loggable is injected.
> 
> This is a reland of 59216ec4a4151b1ba5478c8f2b5c9f01f4683d7f
> 
> Original change's description:
> > Injectable logging
> >
> > Allows passing a Loggable to PCFactory.initializationOptions, which
> > is then injected to Logging.java and logging.h. Future log messages
> > in both Java and native will then be passed to this Loggable.
> >
> > Bug: webrtc:9225
> > Change-Id: I2ff693380639448301a78a93dc11d3a0106f0967
> > Reviewed-on: https://webrtc-review.googlesource.com/73243
> > Commit-Queue: Paulina Hensman <phensman@webrtc.org>
> > Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> > Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> > Cr-Commit-Position: refs/heads/master@{#23241}
> 
> Bug: webrtc:9225
> Change-Id: I2fe3fbc8c323814284bb62e43fe1870bdab581ee
> TBR: kwiberg
> Reviewed-on: https://webrtc-review.googlesource.com/77140
> Commit-Queue: Paulina Hensman <phensman@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23310}

TBR=magjed@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org,phensman@webrtc.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: webrtc:9225
Change-Id: I4d0a5990b5f742cc1a96afde3ca97fad9143d2d4
Reviewed-on: https://webrtc-review.googlesource.com/80641
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Commit-Queue: Alex Glaznev <glaznev@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23498}
2018-06-01 20:10:26 +00:00
a7087e37f1 Unify the build define to enable or disable built in ssl root certificates.
The current approach for enabling or disabling built in ssl root certificates
was a bit confusing. This changeset unifies everything to a common define.

Bug: webrtc:9332
Change-Id: I7a0c18410d05df4b786741c3b9196d97fbb8d7b6
Reviewed-on: https://webrtc-review.googlesource.com/79746
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23495}
2018-06-01 18:42:27 +00:00
392f8d0fa9 Add JoinFilename to testsupport code, replacing use of rtc::Pathname.
This is a partial revert of https://codereview.webrtc.org/2533213005,
deleting rtc::File methods accepting an rtc::Pathname argument.

Bug: webrtc:6424
Change-Id: Ib16bdc7294dbddfa12ba9ae206c024ff97e529a4
Reviewed-on: https://webrtc-review.googlesource.com/80180
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23489}
2018-06-01 11:36:51 +00:00
3b8d48b87f Fix the build with OpenSSL.
CL https://webrtc-review.googlesource.com/c/src/+/66941/ removed a list of typedef which is not needed for BoringSSL but it is crucial for OpenSSL to compile. This CL add back on of those.

Bug: webrtc:9330
Change-Id: I32557bd437f71024af42d555382727de387e8d5f
Reviewed-on: https://webrtc-review.googlesource.com/79741
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23444}
2018-05-30 09:44:33 +00:00
b06b0a689f Delete rtc_base/basictypes.h
Only remaining user was rtc_base/byteorder.h, which is changed to use
rtc_base/system/arch.h.

Bug: webrtc:6853
Change-Id: If3b21831adc60adfd989061027d661867c938a0f
Reviewed-on: https://webrtc-review.googlesource.com/78740
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23406}
2018-05-28 09:08:59 +00:00
55378f48b1 Remove some streams from rtc_base/
Bug: webrtc:8982
Change-Id: Id372dde980fae493debf20873b6aeee8a7f1b045
Reviewed-on: https://webrtc-review.googlesource.com/78781
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23396}
2018-05-25 09:36:48 +00:00
d7b9131de4 Move socklen_t definition for windows to win32.h.
Bug: webrtc:6853
Change-Id: Ie73cd959707b32b928acdabd46329830b2bb2c27
Reviewed-on: https://webrtc-review.googlesource.com/78720
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23381}
2018-05-24 11:17:30 +00:00
14682a3c5f Delete macro RTC_DEFINE_STATIC_LOCAL.
Code using the macro change to a plain declaration+init of a local
variable.

Also delete includes of <stdint.h> and <stddef.h> from basictypes.h.

Bug: webrtc:6853
Change-Id: I5ffceb449c1bf8f5badb595d5a343a47b0c6deae
Reviewed-on: https://webrtc-review.googlesource.com/78460
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23377}
2018-05-24 08:10:35 +00:00
9d4e840617 Change how we get the current cert in SSLVerifyCallback when using OpenSSL.
Use X509_STORE_CTX_get0_cert instead of SSL_get_peer_certificate.
In OpenSSL SSL_get_peer_certificate can only be used after the TLS session is established. Use X509_STORE_CTX_get0_cert instead.

https://bugs.chromium.org/p/webrtc/issues/detail?id=9272


Bug: webrtc:9272
Change-Id: I1f3288748c2ef8f50249713805bedffe59433961
Reviewed-on: https://webrtc-review.googlesource.com/78640
Reviewed-by: David Benjamin <davidben@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Commit-Queue: Jiawei Ou <ouj@fb.com>
Cr-Commit-Position: refs/heads/master@{#23376}
2018-05-24 05:56:45 +00:00
cefc46517e RTC_LOG_* macros: Implement argument passing with a single variadic call
Instead of making multiple calls to the std::stringstream << operator,
collect all the arguments and make a single printf-like variadic call
under the hood.

Besides reducing our reliance on iostreams, this makes each RTC_LOG_*
call site smaller; in aggregate, this reduces the size of
libjingle_peerconnection_so.so by 28-32 kB.

A quick benchmark indicates that this change makes log statements
a few percent slower.

Bug: webrtc:8982, webrtc:9185
Change-Id: I3137a4dd8ac510e8d910acccb0c97ce4fffb61c9
Reviewed-on: https://webrtc-review.googlesource.com/75440
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23375}
2018-05-23 23:15:04 +00:00
500e75b467 Remove typedefs.h from webrtc/ root (part 1)
Bug: webrtc:6854
Change-Id: Iadbc73d1913a507c0097ade82b6e406cbfa30a64
Reviewed-on: https://webrtc-review.googlesource.com/78062
Reviewed-by: Niels Moller <nisse@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23362}
2018-05-23 12:07:10 +00:00
434327376b Don't assume that RTC_LOG's << operator is std::ostream
Bug: webrtc:8982, webrtc:9185
Change-Id: I8a88c10725508f7ea8a7f46e8bcdac4afdb2c617
Reviewed-on: https://webrtc-review.googlesource.com/77681
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Oskar Sundbom <ossu@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23359}
2018-05-23 10:07:20 +00:00
a041f92abf Removing warning suppression flags from rtc_base.
Bug: webrtc:9251
Change-Id: I9dd3b153ef0b8f6f371c7438551d3a6933fc23b0
Reviewed-on: https://webrtc-review.googlesource.com/77668
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23358}
2018-05-23 09:44:40 +00:00
6e9c3df4d0 Added additional SSL certificate verification tests.
This changeset adds some additional tests to validate that the SSLAdapter
behaves as intended when used with a Custom SSL Certificate Verifier. It
validates the following scenarios:
1. Handshake succeeds on TLS handshakes if certificate verifier returns true.
2. Handshake fails on TLS handshakes if certificate verifier returns false.
3. Handshake succeeds on DTLS handshakes if certificate verifier returns true.
4. Handshake fails on DTLS handshakes if certificate verifier returns false.
5. Handshake succeeds on TLS transfers if certificate verifier returns true.
6. Handshake succeeds on DTLS transfers if certificate verifier returns true.

Bug: webrtc:9258
Change-Id: I48b72c9762a7023ece12d882ac4a05d9881bf9e6
Reviewed-on: https://webrtc-review.googlesource.com/75720
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23355}
2018-05-23 02:47:49 +00:00
7502a9e6f5 Delete ALIGNP macro, and use thereof in MemoryStream.
Deletes the ALIGNP and RTC_ALIGNED_P macros from basictypes.h.

ALIGNP was used by MemoryStream, supposedly to make it more efficient.
If it really provided an efficiency improvement is unclear, and in any
case, MemoryStream is used for tests only, and doesn't need high
performance.

Bug: webrtc:6853
Change-Id: If835e881e3857dcc22c7a544491b92829a81d1b3
Reviewed-on: https://webrtc-review.googlesource.com/78021
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23350}
2018-05-22 14:41:18 +00:00
2cf9c55f35 Use monotonic clock for rtc::Event::Wait on linux and android.
Unfortunately, pthread_condattr_setclock is lacking in the
versions of MacOS and iOS we support, and we have to stay
with gettimeofday on those platforms.

Bug: webrtc:9269
Change-Id: I8554e56496cc7b6948cb9b8a4c0bcf886c3544be
Reviewed-on: https://webrtc-review.googlesource.com/77122
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23349}
2018-05-22 13:14:48 +00:00
0beed5d69f Move SampleCounter from ReceiveStatisticsProxy to rtc_base/numerics
This class will be used in upcoming VideoQualiyObserver.

Bug: none
Change-Id: I7d79a6caf3040a3f707ed8700842dea1de81e0a6
Reviewed-on: https://webrtc-review.googlesource.com/77724
Reviewed-by: Erik Språng <sprang@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Ilya Nikolaevskiy <ilnik@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23343}
2018-05-22 11:22:48 +00:00
65ec0fc81e Delete unneeded includes of basictypes.h.
This is a kitchen-sink header, some pieces should be moved to
byteorder.h, the rest likely deleted.

Delete most includes of basictypes.h. In leaf headers,
include stddef.h and stdint.h explicitly where needed.

Bug: webrtc:6853
Change-Id: Ibc809936a8f94d418e4eb650da1e89c1b9142073
Reviewed-on: https://webrtc-review.googlesource.com/77721
Commit-Queue: Niels Moller <nisse@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23333}
2018-05-21 19:35:08 +00:00
0ce868c60e Recognize additional adapter types on Windows
Specifically, Ethernet, Wi-Fi and cellular interfaces.

Note that this only affects native applications, as chromium already
has its own code for this:
https://cs.chromium.org/chromium/src/net/base/network_interfaces_win.cc?l=29&rcl=568ba7132833eea41fc863dd41c377928f49fa51

Which WebRTC accesses through "IpcNetworkManager".

Bug: webrtc:3149, webrtc:6588
Change-Id: I347f2734d95ea24cea3f89e6ed5bf2d135a9fc77
Reviewed-on: https://webrtc-review.googlesource.com/76622
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23332}
2018-05-21 18:03:26 +00:00
3ca48a69fd Ports base::win:OSInfo from Chrome to rtc_win in WebRTC.
Enables us to do stuff like:

TEST(WindowsVersion, GetVersionGlobalScopeAccessor) {
  if (GetVersion() < VERSION_WIN10) {
    MethodNotSupportedOnWin10AndLater();
  } else {
    MethodSupportedOnWin10AndLater();
  }
}

which is useful when working with Windows.

Note that, I also port a limited part of base::win::RegKey but only
those parts that are needed to implement OSInfo. Hence, I don't expose
any RegKey APIs.

NOTRY=TRUE

No-Presubmit: True
Bug: webrtc:9265
Change-Id: Ia2fc0963f24044ffaad954aa21d28df9c32b3ee7
Reviewed-on: https://webrtc-review.googlesource.com/77723
Commit-Queue: Henrik Andreassson <henrika@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23326}
2018-05-21 13:27:46 +00:00
80d02ad93f Suppress warning about exit in destructor, because it intended.
BUG=None

Change-Id: I35323234382aad4f952b2c39a4eecd93ad81e017
Reviewed-on: https://webrtc-review.googlesource.com/77666
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Reviewed-by: Tommi <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23324}
2018-05-21 12:36:55 +00:00
dfce03af6e Allows injection of network controller factory into peer connection factory.
Bug: webrtc:9155
Change-Id: I0a17024042f154297aba20f5d2dc766feb27f3f7
Reviewed-on: https://webrtc-review.googlesource.com/73123
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Reviewed-by: Stefan Holmer <stefan@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23313}
2018-05-18 17:07:16 +00:00
21219a0e43 Reland "Injectable logging"
Any injected loggable or NativeLogger would be deleted if PCFactory
was reinitialized without calling setInjectableLogger. Now native
logging is not implemented as a Loggable, so it will remain active
unless a Loggable is injected.

This is a reland of 59216ec4a4151b1ba5478c8f2b5c9f01f4683d7f

Original change's description:
> Injectable logging
>
> Allows passing a Loggable to PCFactory.initializationOptions, which
> is then injected to Logging.java and logging.h. Future log messages
> in both Java and native will then be passed to this Loggable.
>
> Bug: webrtc:9225
> Change-Id: I2ff693380639448301a78a93dc11d3a0106f0967
> Reviewed-on: https://webrtc-review.googlesource.com/73243
> Commit-Queue: Paulina Hensman <phensman@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23241}

Bug: webrtc:9225
Change-Id: I2fe3fbc8c323814284bb62e43fe1870bdab581ee
TBR: kwiberg
Reviewed-on: https://webrtc-review.googlesource.com/77140
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23310}
2018-05-18 15:04:16 +00:00
4c8811b255 Delete some obsolete forward declarations
Bug: None
Change-Id: I3a9b59bf3dd63c206854ab949cf2d606046182c9
Reviewed-on: https://webrtc-review.googlesource.com/77427
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23292}
2018-05-18 07:29:25 +00:00
10a0e516bf Improve text logs in the network stack.
1) Network info is appended with its network ID assigned by the network
manager so that we can cross-reference networks by IDs in the log.
2) The local network info is added to the candidate pair string
representation so that we do not need the cross reference to the
logs of candidate gathering to find out the network where the local
candidate is from.
3) A flag is added to the candidate pair string representation to
indicate if this pair is the selected one.
4) Sorting of candidate pairs is logged with the reason of sorting
request.
5) Network filtering that takes place in the port allocator is
explicitly logged.

Bug: None
Change-Id: Iaa337394cad803515e26e254814aa04ed2213eab
Reviewed-on: https://webrtc-review.googlesource.com/72522
Commit-Queue: Qingsi Wang <qingsi@google.com>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23266}
2018-05-16 23:46:22 +00:00
81ae9c850e Removing clang-cl warning suppression flags in rtc_base.
Bug: webrtc:9251
Change-Id: I06112d1d683a65b1555b5201deb236928dd8d196
Reviewed-on: https://webrtc-review.googlesource.com/77002
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23259}
2018-05-16 10:00:22 +00:00
4f81038a52 Revert "Injectable logging"
This reverts commit 59216ec4a4151b1ba5478c8f2b5c9f01f4683d7f.

Reason for revert:  forces all logs to have identical tag

Original change's description:
> Injectable logging
> 
> Allows passing a Loggable to PCFactory.initializationOptions, which
> is then injected to Logging.java and logging.h. Future log messages
> in both Java and native will then be passed to this Loggable.
> 
> Bug: webrtc:9225
> Change-Id: I2ff693380639448301a78a93dc11d3a0106f0967
> Reviewed-on: https://webrtc-review.googlesource.com/73243
> Commit-Queue: Paulina Hensman <phensman@webrtc.org>
> Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
> Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
> Cr-Commit-Position: refs/heads/master@{#23241}

TBR=magjed@webrtc.org,sakal@webrtc.org,kwiberg@webrtc.org,phensman@webrtc.org

Change-Id: I27c9587238325b69b26166434740869021b7db8a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: webrtc:9225
Reviewed-on: https://webrtc-review.googlesource.com/76885
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Commit-Queue: Alex Glaznev <glaznev@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23253}
2018-05-15 22:33:53 +00:00
59216ec4a4 Injectable logging
Allows passing a Loggable to PCFactory.initializationOptions, which
is then injected to Logging.java and logging.h. Future log messages
in both Java and native will then be passed to this Loggable.

Bug: webrtc:9225
Change-Id: I2ff693380639448301a78a93dc11d3a0106f0967
Reviewed-on: https://webrtc-review.googlesource.com/73243
Commit-Queue: Paulina Hensman <phensman@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23241}
2018-05-15 12:36:01 +00:00
e53ac0463d Add Ethernet and loopback entries to GetAdapterTypeFromName.
GetAdapterTypeFromName determines the adapter type of a network
interface based on the string matching of the interface name. It however
does not have an entry to map the well-known "eth" name to the common
Ethernet type. This introduces subtle bugs when GetAdapterTypeFromName
is used as the only method to determine a network type and Ethernet is
thus identified as an unknown network, which affects the network
filtering and network path selection that rely on the network type.

Bug: webrtc:9235
Change-Id: Ifc3269d191382f3b3a041de1c9755c09994b31b2
Reviewed-on: https://webrtc-review.googlesource.com/74263
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#23195}
2018-05-10 00:18:11 +00:00
d6f86e8fca This changeset adds dependency injection support for SSL Root Certs.
This extends the API surface so that
custom certificates can be provided by an API user in both the standalone and
factory creation paths for the OpenSSLAdapter. Prior to this change the SSL
roots were hardcoded in a header file and directly included into
openssladapter.cc. This forces the 100 kilobytes of certificates to always be
compiled into the library. This is undesirable in certain linking cases where
these certificates can be shared from another binary that already has an
equivalent set of trusted roots hard coded into the binary.

Support for removing the hard coded SSL roots has also been added through a new
build flag. By default the hard coded SSL roots will be included and will be
used if no other trusted root certificates are provided.

The main goal of this CL is to reduce total binary size requirements of WebRTC
by about 100kb in certain applications where adding these certificates is
redundant.

Change-Id: Ifd36d92b5cb32d1b3098a61ddfc244d76df8f30f

Bug: chromium:526260
Change-Id: Ifd36d92b5cb32d1b3098a61ddfc244d76df8f30f
Reviewed-on: https://webrtc-review.googlesource.com/64841
Commit-Queue: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23180}
2018-05-09 00:24:05 +00:00
03b41483c1 Removing warning suppression -Wno-missing-braces.
Bug: webrtc:9251
Change-Id: Ie32a052738d260364a7543e83e8b46ee3d34df59
Reviewed-on: https://webrtc-review.googlesource.com/75200
Reviewed-by: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23175}
2018-05-08 13:39:52 +00:00
5f83cf0c6d Replacing rtc::TimeDelta with webrtc::TimeDelta.
This removes the redundant type and replaces all usages. A slight change
in behavior is that we no longer get nanosecond resolution. This should
not matter since no current code requires nanosecond resolution.

Bug: webrtc:9155
Change-Id: I04334e08c686d95731621a6c8a7e40400d0ae3b2
Reviewed-on: https://webrtc-review.googlesource.com/71163
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23174}
2018-05-08 13:22:53 +00:00
6fae6ec2ee Moves network unit types to API.
This prepares for being able to inject network congestion controllers.
And makes it easier to use the units in other parts of the code.

Bug: webrtc:9155
Change-Id: Ib8f9c1c97b06d791a01c3376046933d576ae46f9
Reviewed-on: https://webrtc-review.googlesource.com/70201
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23168}
2018-05-08 11:46:22 +00:00
31e5bf59e0 Remove deprecated SocketFactory overrides.
Bug: webrtc:9198
Change-Id: I0ec3e4120e936fefa76e6cef968d7f615f568aa8
Reviewed-on: https://webrtc-review.googlesource.com/73964
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Steve Anton <steveanton@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23156}
2018-05-07 20:03:27 +00:00
1ffb3747bd RTC_LOG(): Internally, pass logging severity as template argument
When the logging severity is statically known, passing it as a
template argument instead of as a function argument saves space at the
call site.

Because this is a constructor, it's not possible to pass template
arguments explicitly---they need to be deduced. So we pass a dummy
function argument whose type encodes the logging severity, and because
the dummy is an empty struct, the ABI generally specifies that this is
a no-op with no runtime cost.

In aggregate, this reduces the size of libjingle_peerconnection_so.so
by 4 kB.

Bug: webrtc:9185
Change-Id: I8118f39dc2aed3be34b2979a239fc0d3dffa969f
Reviewed-on: https://webrtc-review.googlesource.com/74582
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23136}
2018-05-07 09:08:14 +00:00
c816ffc0a5 Fix VerifyPeerCertMatchesHost tests.
The original test did not properly test the bugs it fixed (SAN vs. CN)
and violated BoringSSL invariants:

- That SSL_get_peer_certificate works on the pending session before the
  handshake is a weird OpenSSL quirk that may later get fixed in
  BoringSSL. Calling code should not rely on this.

- SSL_SESSION is a private struct and may not be accessed directly by
  callers.

- Caller especially may not mutate private structs. The tests did not
  keep the SSL_SESSION's X509 and CRYPTO_BUFFER fields in sync.

Instead, make an actual connected SSL object and better test the SAN vs.
CN case.

Bug: webrtc:8888
Change-Id: I773508c676e47be12e52a1bd6bd71562f474e09c
Reviewed-on: https://webrtc-review.googlesource.com/73900
Commit-Queue: David Benjamin <davidben@webrtc.org>
Reviewed-by: Benjamin Wright <benwright@webrtc.org>
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23129}
2018-05-04 17:14:14 +00:00
ee10ea8a41 RTC_LOG(): Internally, pass logging severity as template argument
When the logging severity is statically known, passing it as a
template argument instead of as a function argument saves space at the
call site.

In aggregate, this reduces the size of libjingle_peerconnection_so.so
by 8 kB.

Bug: webrtc:9185
Change-Id: I9ca363845216370e97b230952c86e6d07719962f
Reviewed-on: https://webrtc-review.googlesource.com/74480
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23121}
2018-05-04 14:38:34 +00:00
ab4f1c1bce Be more clever when passing default arguments in log statements
Default argument values are taken care of at the call site. If we
switch to a separate overload, all of those call sites won't have to
pass the default values, saving a few instructions each time.

In aggregate, this reduces the size of libjingle_peerconnection_so.so
by 12 kB.

Bug: webrtc:9185
Change-Id: I8c792c7c6e5b230376dd129d16d9ed2541444d88
Reviewed-on: https://webrtc-review.googlesource.com/74440
Reviewed-by: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23112}
2018-05-04 09:22:34 +00:00
7ba22b8eea Break out the part of the iSAC codec that's used for Voice Activity Detection
The audio processing code is using parts of the iSAC codec to do voice
activity detection (VAD), but it's undesirable for it to pull in the
entire iSAC codec as a dependency. So this CL factors out the parts of
iSAC that's needed for VAD to a separate build target.

Bug: webrtc:8396
Change-Id: I884e25d8fd0bc815fca664352b0573b4b173880e
Reviewed-on: https://webrtc-review.googlesource.com/69640
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Karl Wiberg <kwiberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23110}
2018-05-04 08:53:34 +00:00
88c99562b6 Remove internal media/base/ stringstream usages
The %f -> %g changes are there to make the SimpleStringBuilder behave like stringstream/cout and friends. With %f it prints e.g. 2.2 as 2.200000. This change also makes it use scientific notation for numbers > 1000000, like the other streams.

Bug: webrtc:8982
Change-Id: Id174b02c5776460607f48efc196a08673b67eeb0
Reviewed-on: https://webrtc-review.googlesource.com/67080
Commit-Queue: Jonas Olsson <jonasolsson@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Fredrik Solenberg <solenberg@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23094}
2018-05-03 11:03:21 +00:00