Commit Graph

1118 Commits

Author SHA1 Message Date
eae4564cb7 Disable SIGPIPE for sockets created on iOS.
This can occur (and by default, terminates the process) for apps that
don't use the "voip" UIBackgroundMode.

We're already doing a similar thing on Linux (using MSG_NOSIGNAL for every
packet sent).

BUG=webrtc:7686

Review-Url: https://codereview.webrtc.org/2903313002
Cr-Commit-Position: refs/heads/master@{#18277}
2017-05-26 23:27:09 +00:00
d7fdb8014d Reland of Removes usage of native base::android::GetApplicationContext()
The change is now compatible with the old JVM::Initialize API. The
context is passed to the ContextUtils class when calling its deprecated
signature.

BUG=webrtc:7665
NOTRY=True # Only comment changes since the last patchset.

Review-Url: https://codereview.webrtc.org/2903253004
Cr-Commit-Position: refs/heads/master@{#18268}
2017-05-26 08:51:53 +00:00
aea9293fd4 Revert of Fixing potential AsyncInvoker deadlock that occurs for "reentrant" invocations. (patchset #3 id:40001 of https://codereview.webrtc.org/2885143006/ )
Reason for revert:
Causes a new TSan race warning. Will reland after fixing. Note this is the same race as will be fixed by https://codereview.webrtc.org/2876273002/.

Original issue's description:
> Fixing potential AsyncInvoker deadlock that occurs for "reentrant" invocations.
>
> The deadlock occurs if the AsyncInvoker is destroyed on thread A while
> a task on thread B is running, which AsyncInvokes a task back on thread
> A.
>
> This was causing pending_invocations_ to end up negative, because
> an AsyncClosure that's never added to a thread's message queue (due to
> the "destroying_" flag) caused the count to be decremented but not
> incremented.
>
> BUG=None
>
> Review-Url: https://codereview.webrtc.org/2885143006
> Cr-Commit-Position: refs/heads/master@{#18225}
> Committed: ef37ca5fb3

TBR=nisse@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/2904543003
Cr-Commit-Position: refs/heads/master@{#18248}
2017-05-23 19:55:03 +00:00
ef37ca5fb3 Fixing potential AsyncInvoker deadlock that occurs for "reentrant" invocations.
The deadlock occurs if the AsyncInvoker is destroyed on thread A while
a task on thread B is running, which AsyncInvokes a task back on thread
A.

This was causing pending_invocations_ to end up negative, because
an AsyncClosure that's never added to a thread's message queue (due to
the "destroying_" flag) caused the count to be decremented but not
incremented.

BUG=None

Review-Url: https://codereview.webrtc.org/2885143006
Cr-Commit-Position: refs/heads/master@{#18225}
2017-05-22 22:32:51 +00:00
633e22ebbe Land ContextUtils separately.
External dependencies need to be updated to call ContextUtils.initialize
before rest of the CL can be landed.

BUG=webrtc:7665

Review-Url: https://codereview.webrtc.org/2893933003
Cr-Commit-Position: refs/heads/master@{#18208}
2017-05-19 08:29:10 +00:00
40d224814a Revert of Removes usage of native base::android::GetApplicationContext() (patchset #6 id:120001 of https://codereview.webrtc.org/2888093004/ )
Reason for revert:
Breaks bot on chromium.webrtc.fyi.

Original issue's description:
> Removes usage of native base::android::GetApplicationContext()
>
> BUG=webrtc:7665
>
> Review-Url: https://codereview.webrtc.org/2888093004
> Cr-Commit-Position: refs/heads/master@{#18195}
> Committed: bc83e2ee69

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

Review-Url: https://codereview.webrtc.org/2894593002
Cr-Commit-Position: refs/heads/master@{#18196}
2017-05-18 13:44:20 +00:00
bc83e2ee69 Removes usage of native base::android::GetApplicationContext()
BUG=webrtc:7665

Review-Url: https://codereview.webrtc.org/2888093004
Cr-Commit-Position: refs/heads/master@{#18195}
2017-05-18 13:28:45 +00:00
b243ee91c3 Delete FilesystemInterface::DeleteFolderAndContents and related methods.
Additional methods deleted:

  DeleteFolderContents
  IsTemporaryPath
  GetAppTempFolder

Unused since cl https://codereview.webrtc.org/2872283002/

BUG=webrtc:7345,webrtc:6424

Review-Url: https://codereview.webrtc.org/2887093002
Cr-Commit-Position: refs/heads/master@{#18194}
2017-05-18 12:49:58 +00:00
57efb038bb Reland of reduce dependencies on rtc::FileSystem in FileRotatingStream tests... (patchset #1 id:1 of https://codereview.webrtc.org/2885393002/ )
Reason for revert:
Downstream project now fixed.

Original issue's description:
> Revert of Reduce dependencies on rtc::FileSystem in FileRotatingStream tests, adding helpers in webrtc::test:: (patchset #7 id:120001 of https://codereview.webrtc.org/2872283002/ )
>
> Reason for revert:
> Fails to compile successfully.
>
>
> Original issue's description:
> > Reduce dependencies on rtc::FileSystem in FileRotatingStream tests.
> >
> > Use webrtc::test::OutputPath instead of Filesystem::GetAppTempFolder.
> > Added functions RemoveFile and RemoveDir in the webrtc::test namespace,
> > to replace use of Filesystem::DeleteFolderAndContents.
> >
> > This makes Filesystem::DeleteFolderAndContents unused, to be deleted
> > together with related code in a followup cl.
> >
> > BUG=webrtc:7345
> >
> > Review-Url: https://codereview.webrtc.org/2872283002
> > Cr-Commit-Position: refs/heads/master@{#18173}
> > Committed: dd7b5f32b5
>
> TBR=pthatcher@webrtc.org,kjellander@webrtc.org,tommi@webrtc.org,nisse@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:7345
>
> Review-Url: https://codereview.webrtc.org/2885393002
> Cr-Commit-Position: refs/heads/master@{#18180}
> Committed: deaa33d2f5

TBR=pthatcher@webrtc.org,kjellander@webrtc.org,tommi@webrtc.org,ehmaldonado@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:7345

Review-Url: https://codereview.webrtc.org/2885413002
Cr-Commit-Position: refs/heads/master@{#18193}
2017-05-18 10:55:59 +00:00
577f5dc60b Add methods to change enabled events in PhysicalSocket.
This is in preparation for "epoll" integration where additional code needs to
run when the enabled events change.

BUG=webrtc:7585

Review-Url: https://codereview.webrtc.org/2893723002
Cr-Commit-Position: refs/heads/master@{#18189}
2017-05-17 23:32:26 +00:00
deaa33d2f5 Revert of Reduce dependencies on rtc::FileSystem in FileRotatingStream tests, adding helpers in webrtc::test:: (patchset #7 id:120001 of https://codereview.webrtc.org/2872283002/ )
Reason for revert:
Fails to compile successfully.

Original issue's description:
> Reduce dependencies on rtc::FileSystem in FileRotatingStream tests.
>
> Use webrtc::test::OutputPath instead of Filesystem::GetAppTempFolder.
> Added functions RemoveFile and RemoveDir in the webrtc::test namespace,
> to replace use of Filesystem::DeleteFolderAndContents.
>
> This makes Filesystem::DeleteFolderAndContents unused, to be deleted
> together with related code in a followup cl.
>
> BUG=webrtc:7345
>
> Review-Url: https://codereview.webrtc.org/2872283002
> Cr-Commit-Position: refs/heads/master@{#18173}
> Committed: dd7b5f32b5

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

Review-Url: https://codereview.webrtc.org/2885393002
Cr-Commit-Position: refs/heads/master@{#18180}
2017-05-17 12:22:14 +00:00
dd7b5f32b5 Reduce dependencies on rtc::FileSystem in FileRotatingStream tests.
Use webrtc::test::OutputPath instead of Filesystem::GetAppTempFolder.
Added functions RemoveFile and RemoveDir in the webrtc::test namespace,
to replace use of Filesystem::DeleteFolderAndContents.

This makes Filesystem::DeleteFolderAndContents unused, to be deleted
together with related code in a followup cl.

BUG=webrtc:7345

Review-Url: https://codereview.webrtc.org/2872283002
Cr-Commit-Position: refs/heads/master@{#18173}
2017-05-17 08:08:35 +00:00
98e186c71c Remove VirtualSocketServer's dependency on PhysicalSocketServer.
The only thing the physical socket server was used for was
"Wait"/"WakeUp", but it could be replaced by a simple rtc::Event.

So, removing this dependency makes things less confusing; the fact that
VirtualSocketServer takes a PhysicalSocketServer may lead someone to
think it uses real sockets internally, when it doesn't.

BUG=None

Review-Url: https://codereview.webrtc.org/2883313003
Cr-Commit-Position: refs/heads/master@{#18172}
2017-05-17 01:00:06 +00:00
c4a3173db0 Delete unused features of AsyncInvoke.
Also eliminates its dependency on callback.h.

BUG=None

Review-Url: https://codereview.webrtc.org/2871403003
Cr-Commit-Position: refs/heads/master@{#18163}
2017-05-16 12:51:29 +00:00
9a6f4d4316 Get tests working on systems that only support IPv6.
For every failing test, the solution was either to do a "has IPv4" check
before the test is run, or avoid depending on real network interfaces
altogether.

This specifically fixes rtc_unittests, peerconnection_unittests, and
webrtc_nonparallel_tests.

BUG=None

Review-Url: https://codereview.webrtc.org/2881973002
Cr-Commit-Position: refs/heads/master@{#18155}
2017-05-16 02:43:33 +00:00
9baa77981f Moving compile_assert_c.h to webrtc/base
This header was not tracked by a GN target and in the discussion on
https://bugs.chromium.org/p/webrtc/issues/detail?id=7617 we decided
to also move it under webrtc/base.

I checked in chromium code search and it seems safe to move it
without creating a stub header in webrtc/system_wrappers.

BUG=webrtc:7617

Review-Url: https://codereview.webrtc.org/2882673002
Cr-Commit-Position: refs/heads/master@{#18151}
2017-05-15 15:06:47 +00:00
d0ffa8615d Run clang-format on sigslot.h.
It's diverged enough from the original version that we no longer
benefit from keeping the old formatting.

BUG=NONE

Review-Url: https://codereview.webrtc.org/2854533002
Cr-Commit-Position: refs/heads/master@{#18129}
2017-05-13 05:52:51 +00:00
4483af35e9 Relanding #2: Fixing crash that can occur if signal is modified while firing.
The crash occurs if a slot causes the very next slot in iteration order
to be disconnected.

Relanding after fixing a race condition that this CL revealed. Previously
the race resulted in an invalidated iterator, but now it will result in the
iterator being modified, so TSan catches it.

BUG=webrtc:7527

Review-Url: https://codereview.webrtc.org/2846593005
Cr-Commit-Position: refs/heads/master@{#18124}
2017-05-12 15:44:38 +00:00
cdcc6b3fe6 Move test-only code to GN target rtc_base_test_utils.
VirtualSocketServer and Sha1Digest (from rtc_base)
md5.h and md5.cc (from rtc_base_approved, Md5Digest was moved earlier)

BUG=None

Review-Url: https://codereview.webrtc.org/2875933002
Cr-Commit-Position: refs/heads/master@{#18119}
2017-05-12 08:02:26 +00:00
423a288a12 Delete left-over declaration of AdjustCurrentProcessPrivilege.
Implementation was deleted in https://codereview.webrtc.org/2571763002.

BUG=webrtc:6424

Review-Url: https://codereview.webrtc.org/2872303002
Cr-Commit-Position: refs/heads/master@{#18082}
2017-05-10 13:04:45 +00:00
e077ee472a Deleted unused method EstimateMTU, and the WinPing class.
BUG=None

Review-Url: https://codereview.webrtc.org/2866183004
Cr-Commit-Position: refs/heads/master@{#18077}
2017-05-10 08:56:54 +00:00
966963ac7d Fixing invalid IPv6 address parsing stack underflow on Windows.
Occurred when parsing an address with more than 7 colons. For example:
1::2:3:4:5:6:7::8

BUG=webrtc:7592

Review-Url: https://codereview.webrtc.org/2867653002
Cr-Commit-Position: refs/heads/master@{#18054}
2017-05-08 18:35:56 +00:00
3f580e24cc Delete unused class SharedExclusiveLock.
Unused since cl https://codereview.webrtc.org/2828223002/

BUG=webrtc:7501

Review-Url: https://codereview.webrtc.org/2865083002
Cr-Commit-Position: refs/heads/master@{#18050}
2017-05-08 13:24:29 +00:00
7eaa4ea75f Delete method MessageQueue::set_socketserver
Instead, make the pointer to the associated socket server a
construction time const, and delete its lock.

Introduces a helper class AutoSocketServerThread for code
(mainly tests) which need a socket server associated with
the current thread.

BUG=webrtc:7501

Review-Url: https://codereview.webrtc.org/2828223002
Cr-Commit-Position: refs/heads/master@{#18047}
2017-05-08 12:25:41 +00:00
32f2505185 Refactor TestClient to use std::unique_ptr, and fix VirtualSocketServerTest leaks.
BUG=None

Review-Url: https://codereview.webrtc.org/2859373003
Cr-Commit-Position: refs/heads/master@{#18043}
2017-05-08 08:57:18 +00:00
610800baa7 Add myself as OWNER of webrtc/api/ and webrtc/base/
I'm already a root OWNER, but people tend to pick reviewers from the
most specific OWNERS file, so I should probably be in these two.

NOTRY=true
BUG=none

Review-Url: https://codereview.webrtc.org/2869443002
Cr-Commit-Position: refs/heads/master@{#18038}
2017-05-05 21:04:54 +00:00
41102775da fixing braces around initialization of subobject
BUG=chromium:717832
NOTRY=True

Review-Url: https://codereview.webrtc.org/2861533005
Cr-Commit-Position: refs/heads/master@{#18001}
2017-05-03 18:31:38 +00:00
0b16a6294b Adding virtualsocketserver to rtc_base sources
virtualsocketserver.h and virtualsocketserver.cc were excluded from the
sources list if build_with_chromium is true.
This causes a chromium compilation error because after [1] some deps are
explicit.

[1] - https://codereview.webrtc.org/2852663002

BUG=chromium:717832
NOTRY=True

Review-Url: https://codereview.webrtc.org/2855103003
Cr-Commit-Position: refs/heads/master@{#17989}
2017-05-03 12:22:35 +00:00
de1590919f Revert of Relanding: Fixing crash that can occur if signal is modified while firing. (patchset #4 id:60001 of https://codereview.webrtc.org/2846593005/ )
Reason for revert:
Breaks XmppConnectionTest in Chrome.

https://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_tsan_rel_ng/builds/65096

Original issue's description:
> Relanding: Fixing crash that can occur if signal is modified while firing.
>
> The crash occurs if a slot causes the very next slot in iteration order
> to be disconnected.
>
> Relanding after fixing a race condition that this CL revealed. Previously
> the race resulted in an invalidated iterator, but now it will result in the
> iterator being modified, so TSan catches it.
>
> BUG=webrtc:7527
>
> Review-Url: https://codereview.webrtc.org/2846593005
> Cr-Original-Commit-Position: refs/heads/master@{#17943}
> Committed: 961c2adf1e
> Review-Url: https://codereview.webrtc.org/2846593005
> Cr-Commit-Position: refs/heads/master@{#17965}
> Committed: fc1af01557

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

Review-Url: https://codereview.webrtc.org/2859443002
Cr-Commit-Position: refs/heads/master@{#17975}
2017-05-02 13:14:59 +00:00
fc1af01557 Relanding: Fixing crash that can occur if signal is modified while firing.
The crash occurs if a slot causes the very next slot in iteration order
to be disconnected.

Relanding after fixing a race condition that this CL revealed. Previously
the race resulted in an invalidated iterator, but now it will result in the
iterator being modified, so TSan catches it.

BUG=webrtc:7527

Review-Url: https://codereview.webrtc.org/2846593005
Cr-Original-Commit-Position: refs/heads/master@{#17943}
Committed: 961c2adf1e
Review-Url: https://codereview.webrtc.org/2846593005
Cr-Commit-Position: refs/heads/master@{#17965}
2017-05-02 05:24:20 +00:00
7311b24660 Disable CpuTimeTest on instrumented builds.
The test relies on the ability to run a thread for a controllable
duration of time, which is unreliable on instrumented builds (TSan,
etc.).

Also adding a minimal test which can still be run on instrumented builds, so
they at least still exercise the code.

BUG=webrtc:7542
TBR=kjellander@webrtc.org

Review-Url: https://codereview.webrtc.org/2856473002
Cr-Commit-Position: refs/heads/master@{#17961}
2017-05-01 17:43:39 +00:00
86746c475f Revert of Fixing crash that can occur if signal is modified while firing. (patchset #3 id:40001 of https://codereview.webrtc.org/2846593005/ )
Reason for revert:
Revealed a race condition (now reported by TSan), and breaks the scenario where a signal is deleted while firing.

Original issue's description:
> Fixing crash that can occur if signal is modified while firing.
>
> The crash occurs if a slot causes the very next slot in iteration order
> to be disconnected.
>
> BUG=webrtc:7527
>
> Review-Url: https://codereview.webrtc.org/2846593005
> Cr-Commit-Position: refs/heads/master@{#17943}
> Committed: 961c2adf1e

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

Review-Url: https://codereview.webrtc.org/2847243006
Cr-Commit-Position: refs/heads/master@{#17947}
2017-04-29 19:00:21 +00:00
961c2adf1e Fixing crash that can occur if signal is modified while firing.
The crash occurs if a slot causes the very next slot in iteration order
to be disconnected.

BUG=webrtc:7527

Review-Url: https://codereview.webrtc.org/2846593005
Cr-Commit-Position: refs/heads/master@{#17943}
2017-04-29 08:39:52 +00:00
8b1d862bfe Fixing sigslot copy constructors.
They used to work, but were broken by a somewhat recent refactoring of
sigslot.h.

It's reasonable for signals and slots to have copy constructors, since
a class that uses signals/slots may want to be copyable.

BUG=webrtc:7342

Review-Url: https://codereview.webrtc.org/2842423002
Cr-Commit-Position: refs/heads/master@{#17942}
2017-04-29 07:27:04 +00:00
148d5a2dca Reland of Enable GN check for webrtc/base (patchset #3 id:230001 of https://codereview.webrtc.org/2838683002/ )
Reason for revert:
Fourth attempt to land.

Waiting for https://codereview.webrtc.org/2845013003 to
avoid conflicts on webrtc/modules/audio_coding:neteq_unittest_tools.

Original issue's description:
> Revert of Enable GN check for webrtc/base (patchset #13 id:240001 of https://codereview.webrtc.org/2717083002/ )
>
> Reason for revert:
> Breaks Chromium because in Chromium we import WebRTC with rtc_include_tests=false (https://bugs.chromium.org/p/chromium/issues/detail?id=713179#c6).
>
> Chromium uses webrtc/test/fuzzers and this CL adds test dependencies to neteq_rtc_fuzzer.
>
> Original issue's description:
> > Enable GN check for webrtc/base
> >
> > It's not possible to enable it for the rtc_base_approved
> > target but since a larger refactoring is ongoing for webrtc/base
> > this CL doesn't attempt to fix that.
> >
> > Changes made:
> > * Move webrtc/system_wrappers/include/stringize_macros.h into
> >   webrtc/base:rtc_base_approved_unittests (and corresponding
> >   unit test to rtc_base_approved_unittests).
> > * Move md5digest.* from rtc_base_approved to rtc_base_test_utils target.
> > * Move webrtc/system_wrappers/include/stringize_macros.h (+test) into
> >   webrtc/base.
> > * Remove unused use include of webrtc/base/fileutils.h in
> >   webrtc/base/pathutils.cc
> >
> > BUG=webrtc:6828, webrtc:3806, webrtc:7480
> > NOTRY=True
> >
> > Review-Url: https://codereview.webrtc.org/2717083002
> > Cr-Commit-Position: refs/heads/master@{#17766}
> > Committed: ed754e71ae
>
> TBR=perkj@webrtc.org,tommi@webrtc.org,nisse@webrtc.org,kjellander@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:6828, webrtc:3806, webrtc:7480
> NOTRY=True
>
> Review-Url: https://codereview.webrtc.org/2838683002
> Cr-Commit-Position: refs/heads/master@{#17849}
> Committed: 11ed366c48

TBR=perkj@webrtc.org,tommi@webrtc.org,nisse@webrtc.org,kjellander@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6828, webrtc:3806, webrtc:7480

Review-Url: https://codereview.webrtc.org/2852663002
Cr-Commit-Position: refs/heads/master@{#17927}
2017-04-28 12:24:50 +00:00
7866cfe575 Move autowrap from ThreadManager constructor to Thread::Current.
This is in preparation for a WrapCurrentThread method,
or AutoThread constructor, taking a socket
server as argument, to eliminate the need for the
MessageQueue::set_socketserver method and its lock.

No intended change in behaviour; the ThreadManager constructor
records the calling thread id, and autowrap is still restricted to
that thread. Behavior when NO_MAIN_THREAD_WRAPPING is defined is
also unchanged.

Also makes the ThreadManager a singleton, with private constructor
and destructor. And marks its destructor as RTC_NOTREACHED, since
by the documentation for RTC_DEFINE_STATIC_LOCAL, the intention is to
leak the object and never destruct it.

BUG=webrtc:7501

Review-Url: https://codereview.webrtc.org/2833993003
Cr-Commit-Position: refs/heads/master@{#17879}
2017-04-26 08:45:31 +00:00
3d7b0e2fda Revert of Enable GN check for webrtc/base (patchset #9 id:350001 of https://codereview.webrtc.org/2840453004/ )
Reason for revert:
It causes a Chromium build error:

ERROR at //third_party/webrtc/test/BUILD.gn:113:5: Can't load input file.
    "//third_party/gflags",

Original issue's description:
> Reland of Enable GN check for webrtc/base (patchset #3 id:230001 of https://codereview.webrtc.org/2838683002/ )
>
> Reason for revert:
> Try to fix the webrtc/test/fuzzers issue and reland this CL because it
> contains lots of fixes for our BUILD.gn files.
>
> Original issue's description:
> > Revert of Enable GN check for webrtc/base (patchset #13 id:240001 of https://codereview.webrtc.org/2717083002/ )
> >
> > Reason for revert:
> > Breaks Chromium because in Chromium we import WebRTC with rtc_include_tests=false (https://bugs.chromium.org/p/chromium/issues/detail?id=713179#c6).
> >
> > Chromium uses webrtc/test/fuzzers and this CL adds test dependencies to neteq_rtc_fuzzer.
> >
> > Original issue's description:
> > > Enable GN check for webrtc/base
> > >
> > > It's not possible to enable it for the rtc_base_approved
> > > target but since a larger refactoring is ongoing for webrtc/base
> > > this CL doesn't attempt to fix that.
> > >
> > > Changes made:
> > > * Move webrtc/system_wrappers/include/stringize_macros.h into
> > >   webrtc/base:rtc_base_approved_unittests (and corresponding
> > >   unit test to rtc_base_approved_unittests).
> > > * Move md5digest.* from rtc_base_approved to rtc_base_test_utils target.
> > > * Move webrtc/system_wrappers/include/stringize_macros.h (+test) into
> > >   webrtc/base.
> > > * Remove unused use include of webrtc/base/fileutils.h in
> > >   webrtc/base/pathutils.cc
> > >
> > > BUG=webrtc:6828, webrtc:3806, webrtc:7480
> > > NOTRY=True
> > >
> > > Review-Url: https://codereview.webrtc.org/2717083002
> > > Cr-Commit-Position: refs/heads/master@{#17766}
> > > Committed: ed754e71ae
> >
> > TBR=perkj@webrtc.org,tommi@webrtc.org,nisse@webrtc.org,kjellander@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=webrtc:6828, webrtc:3806, webrtc:7480
> > NOTRY=True
> >
> > Review-Url: https://codereview.webrtc.org/2838683002
> > Cr-Commit-Position: refs/heads/master@{#17849}
> > Committed: 11ed366c48
>
> TBR=perkj@webrtc.org,tommi@webrtc.org,nisse@webrtc.org,kjellander@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=webrtc:6828, webrtc:3806, webrtc:7480
>
> Review-Url: https://codereview.webrtc.org/2840453004
> Cr-Commit-Position: refs/heads/master@{#17876}
> Committed: 7054085e59

TBR=perkj@webrtc.org,tommi@webrtc.org,nisse@webrtc.org,kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6828, webrtc:3806, webrtc:7480

Review-Url: https://codereview.webrtc.org/2846483002
Cr-Commit-Position: refs/heads/master@{#17877}
2017-04-26 07:38:48 +00:00
7054085e59 Reland of Enable GN check for webrtc/base (patchset #3 id:230001 of https://codereview.webrtc.org/2838683002/ )
Reason for revert:
Try to fix the webrtc/test/fuzzers issue and reland this CL because it
contains lots of fixes for our BUILD.gn files.

Original issue's description:
> Revert of Enable GN check for webrtc/base (patchset #13 id:240001 of https://codereview.webrtc.org/2717083002/ )
>
> Reason for revert:
> Breaks Chromium because in Chromium we import WebRTC with rtc_include_tests=false (https://bugs.chromium.org/p/chromium/issues/detail?id=713179#c6).
>
> Chromium uses webrtc/test/fuzzers and this CL adds test dependencies to neteq_rtc_fuzzer.
>
> Original issue's description:
> > Enable GN check for webrtc/base
> >
> > It's not possible to enable it for the rtc_base_approved
> > target but since a larger refactoring is ongoing for webrtc/base
> > this CL doesn't attempt to fix that.
> >
> > Changes made:
> > * Move webrtc/system_wrappers/include/stringize_macros.h into
> >   webrtc/base:rtc_base_approved_unittests (and corresponding
> >   unit test to rtc_base_approved_unittests).
> > * Move md5digest.* from rtc_base_approved to rtc_base_test_utils target.
> > * Move webrtc/system_wrappers/include/stringize_macros.h (+test) into
> >   webrtc/base.
> > * Remove unused use include of webrtc/base/fileutils.h in
> >   webrtc/base/pathutils.cc
> >
> > BUG=webrtc:6828, webrtc:3806, webrtc:7480
> > NOTRY=True
> >
> > Review-Url: https://codereview.webrtc.org/2717083002
> > Cr-Commit-Position: refs/heads/master@{#17766}
> > Committed: ed754e71ae
>
> TBR=perkj@webrtc.org,tommi@webrtc.org,nisse@webrtc.org,kjellander@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=webrtc:6828, webrtc:3806, webrtc:7480
> NOTRY=True
>
> Review-Url: https://codereview.webrtc.org/2838683002
> Cr-Commit-Position: refs/heads/master@{#17849}
> Committed: 11ed366c48

TBR=perkj@webrtc.org,tommi@webrtc.org,nisse@webrtc.org,kjellander@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=webrtc:6828, webrtc:3806, webrtc:7480

Review-Url: https://codereview.webrtc.org/2840453004
Cr-Commit-Position: refs/heads/master@{#17876}
2017-04-26 07:28:08 +00:00
7885d3f5c6 Add SafeMin() and SafeMax(), which accept args of different types
Specifically, they handle all combinations of two integer and two
floating-point arguments by picking a result type that is guaranteed
to be able to hold the result. This means callers no longer have to
deal with potentially dangerous casting to make all the arguments have
the same type, like they have to with std::min() and std::max().

Also, they're constexpr.

Mostly for illustrative purposes, this CL replaces a few std::min()
and std::max() calls with SafeMin() and SafeMax().

BUG=webrtc:7459

Review-Url: https://codereview.webrtc.org/2810483002
Cr-Commit-Position: refs/heads/master@{#17869}
2017-04-25 19:35:07 +00:00
e0629c045e GN: Tighten up test target visibility + refactorings
Make all rtc_source_test target that contains tests that
are included in a test executable only be visible to the
rtc_test target. Doing this exposed a couple of errors and
dependency problems that were resolved. Having this could
have prevented duplicated execution of tests like the case that
was recently fixed by deadbeef@ in
https://codereview.webrtc.org/2820263004

New targets:
* //webrtc/modules/rtp_rtcp:fec_test_helper
* //webrtc/modules/rtp_rtcp:mock_rtp_rtcp
* //webrtc/modules/remote_bitrate_estimator:mock_remote_bitrate_observer

The mock files and targets should probably be moved into webrtc/test in
the future, but that's out of the scope of this CL.

BUG=webrtc:5716
NOTRY=True

Review-Url: https://codereview.webrtc.org/2828793003
Cr-Commit-Position: refs/heads/master@{#17863}
2017-04-25 11:04:50 +00:00
30cba07bd1 Delete unused class ComThread.
BUG=None

Review-Url: https://codereview.webrtc.org/2835893003
Cr-Commit-Position: refs/heads/master@{#17857}
2017-04-25 07:09:15 +00:00
11ed366c48 Revert of Enable GN check for webrtc/base (patchset #13 id:240001 of https://codereview.webrtc.org/2717083002/ )
Reason for revert:
Breaks Chromium because in Chromium we import WebRTC with rtc_include_tests=false (https://bugs.chromium.org/p/chromium/issues/detail?id=713179#c6).

Chromium uses webrtc/test/fuzzers and this CL adds test dependencies to neteq_rtc_fuzzer.

Original issue's description:
> Enable GN check for webrtc/base
>
> It's not possible to enable it for the rtc_base_approved
> target but since a larger refactoring is ongoing for webrtc/base
> this CL doesn't attempt to fix that.
>
> Changes made:
> * Move webrtc/system_wrappers/include/stringize_macros.h into
>   webrtc/base:rtc_base_approved_unittests (and corresponding
>   unit test to rtc_base_approved_unittests).
> * Move md5digest.* from rtc_base_approved to rtc_base_test_utils target.
> * Move webrtc/system_wrappers/include/stringize_macros.h (+test) into
>   webrtc/base.
> * Remove unused use include of webrtc/base/fileutils.h in
>   webrtc/base/pathutils.cc
>
> BUG=webrtc:6828, webrtc:3806, webrtc:7480
> NOTRY=True
>
> Review-Url: https://codereview.webrtc.org/2717083002
> Cr-Commit-Position: refs/heads/master@{#17766}
> Committed: ed754e71ae

TBR=perkj@webrtc.org,tommi@webrtc.org,nisse@webrtc.org,kjellander@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=webrtc:6828, webrtc:3806, webrtc:7480
NOTRY=True

Review-Url: https://codereview.webrtc.org/2838683002
Cr-Commit-Position: refs/heads/master@{#17849}
2017-04-24 19:26:27 +00:00
44d305a806 Remove the expat and jsoncpp dependencies to reduce binary size.
The dependency on third_party/expat/ is removed.

The dependency on third_party/jsoncpp is removed from
libjingle_peerconnection while peerconnection_client still
depends on it.

BUG=webrtc:7516

Review-Url: https://codereview.webrtc.org/2832283002
Cr-Commit-Position: refs/heads/master@{#17848}
2017-04-24 19:05:06 +00:00
7914b8cb41 Negotiate the same SRTP crypto suites for every DTLS association formed.
Before this CL, we would negotiate:
- No crypto suites for data m= sections.
- A full set for audio m= sections.
- The full set, minus SRTP_AES128_CM_SHA1_32 for video m= sections.

However, this doesn't make sense with BUNDLE, since any DTLS
association could end up being used for any type of media. If
video is "bundled on" the audio transport (which is typical), it
will actually end up using SRTP_AES128_CM_SHA1_32.

So, this CL moves the responsibility of deciding SRTP crypto suites out
of BaseChannel and into DtlsTransport. The only two possibilities are
now "normal set" or "normal set + GCM", if enabled by the PC factory
options.

This fixes an issue (see linked bug) that was occurring when audio/video
were "bundled onto" the data transport. Since the data transport
wasn't negotiating any SRTP crypto suites, none were available to use
for audio/video, so the application would get black video/no audio.

This CL doesn't affect the SDES SRTP crypto suite negotiation;
it only affects the negotiation in the DLTS handshake, through
the use_srtp extension.

BUG=chromium:711243

Review-Url: https://codereview.webrtc.org/2815513012
Cr-Commit-Position: refs/heads/master@{#17810}
2017-04-21 10:23:33 +00:00
b9c2f7ceeb Reland of Delete class ScopedPtrCollection. Replaced with vector of unique_ptr. (patchset #1 id:1 of https://codereview.webrtc.org/2812553002/ )
Reason for revert:
Downstream project updated.

Original issue's description:
> Revert of Delete class ScopedPtrCollection. Replaced with vector of unique_ptr. (patchset #1 id:1 of https://codereview.webrtc.org/2808463002/ )
>
> Reason for revert:
> Deleting scopedptrcollection.h broke an internal project.
>
> Original issue's description:
> > Delete class ScopedPtrCollection. Replaced with vector of unique_ptr.
> >
> > BUG=None
> >
> > Review-Url: https://codereview.webrtc.org/2808463002
> > Cr-Commit-Position: refs/heads/master@{#17605}
> > Committed: 188596f20f
>
> TBR=pthatcher@webrtc.org,kwiberg@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/2812553002
> Cr-Commit-Position: refs/heads/master@{#17607}
> Committed: 2042c16be0

TBR=pthatcher@webrtc.org,kwiberg@webrtc.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=None

Review-Url: https://codereview.webrtc.org/2814693002
Cr-Commit-Position: refs/heads/master@{#17781}
2017-04-20 09:23:08 +00:00
ed754e71ae Enable GN check for webrtc/base
It's not possible to enable it for the rtc_base_approved
target but since a larger refactoring is ongoing for webrtc/base
this CL doesn't attempt to fix that.

Changes made:
* Move webrtc/system_wrappers/include/stringize_macros.h into
  webrtc/base:rtc_base_approved_unittests (and corresponding
  unit test to rtc_base_approved_unittests).
* Move md5digest.* from rtc_base_approved to rtc_base_test_utils target.
* Move webrtc/system_wrappers/include/stringize_macros.h (+test) into
  webrtc/base.
* Remove unused use include of webrtc/base/fileutils.h in
  webrtc/base/pathutils.cc

BUG=webrtc:6828, webrtc:3806, webrtc:7480
NOTRY=True

Review-Url: https://codereview.webrtc.org/2717083002
Cr-Commit-Position: refs/heads/master@{#17766}
2017-04-19 15:37:36 +00:00
d0d81485f2 base/testutils.h: Use namespace webrtc::testing instead of plain testing
We shouldn't pollute the global namespace.

BUG=webrtc:7484

Review-Url: https://codereview.webrtc.org/2819473004
Cr-Commit-Position: refs/heads/master@{#17735}
2017-04-18 10:18:22 +00:00
282d49f0ca Reland of Android Logging.java: Load native library only when needed (patchset #1 id:1 of https://codereview.webrtc.org/2814133002/ )
Reason for revert:
Fix bug in original CL.

Original issue's description:
> Revert of Android Logging.java: Load native library only when needed (patchset #2 id:2 of https://codereview.webrtc.org/2817593003/ )
>
> Reason for revert:
> Change in Logging.java breaking compilation (incorrect reference to enum)
>
> Original issue's description:
> > Reland of Android Logging.java: Load native library only when needed (patchset #1 id:1 of https://codereview.webrtc.org/2816753002/ )
> >
> > Reason for revert:
> > Fix bug in original CL.
> >
> > Original issue's description:
> > > Revert of Android Logging.java: Load native library only when needed (patchset #3 id:40001 of https://codereview.webrtc.org/2803203002/ )
> > >
> > > Reason for revert:
> > > Breaks C++ logs in Java apps.
> > >
> > > Original issue's description:
> > > > Android Logging.java: Load native library only when needed
> > > >
> > > > Logging.java currently always tries to load jingle_peerconnection_so in
> > > > the static section, but some clients don't want to use it. This CL loads
> > > > jingle_peerconnection_so only when a client requests it by calling one
> > > > of:
> > > >  * Logging.enableLogThreads
> > > >  * Logging.enableLogTimeStamps
> > > >  * Logging.enableTracing
> > > >  * Logging.enableLogToDebugOutput
> > > >
> > > > BUG=b/36410678
> > > >
> > > > Review-Url: https://codereview.webrtc.org/2803203002
> > > > Cr-Commit-Position: refs/heads/master@{#17647}
> > > > Committed: dee5eb14e1
> > >
> > > TBR=sakal@webrtc.org,glaznev@webrtc.org,noahric@chromium.org,magjed@webrtc.org
> > > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > > BUG=b/36410678
> > >
> > > Review-Url: https://codereview.webrtc.org/2816753002
> > > Cr-Commit-Position: refs/heads/master@{#17676}
> > > Committed: 6e4a4427dc
> >
> > TBR=sakal@webrtc.org,glaznev@webrtc.org,noahric@chromium.org,brandtr@webrtc.org
> > # Skipping CQ checks because original CL landed less than 1 days ago.
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> > BUG=b/36410678
> >
> > Review-Url: https://codereview.webrtc.org/2817593003
> > Cr-Commit-Position: refs/heads/master@{#17677}
> > Committed: 297714619f
>
> TBR=sakal@webrtc.org,glaznev@webrtc.org,noahric@chromium.org,brandtr@webrtc.org,magjed@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=b/36410678
>
> Review-Url: https://codereview.webrtc.org/2814133002
> Cr-Commit-Position: refs/heads/master@{#17678}
> Committed: 06034c7d64

TBR=sakal@webrtc.org,glaznev@webrtc.org,noahric@chromium.org,brandtr@webrtc.org,lliuu@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
BUG=b/36410678

Review-Url: https://codereview.webrtc.org/2813363004
Cr-Commit-Position: refs/heads/master@{#17694}
2017-04-13 11:17:02 +00:00
06034c7d64 Revert of Android Logging.java: Load native library only when needed (patchset #2 id:2 of https://codereview.webrtc.org/2817593003/ )
Reason for revert:
Change in Logging.java breaking compilation (incorrect reference to enum)

Original issue's description:
> Reland of Android Logging.java: Load native library only when needed (patchset #1 id:1 of https://codereview.webrtc.org/2816753002/ )
>
> Reason for revert:
> Fix bug in original CL.
>
> Original issue's description:
> > Revert of Android Logging.java: Load native library only when needed (patchset #3 id:40001 of https://codereview.webrtc.org/2803203002/ )
> >
> > Reason for revert:
> > Breaks C++ logs in Java apps.
> >
> > Original issue's description:
> > > Android Logging.java: Load native library only when needed
> > >
> > > Logging.java currently always tries to load jingle_peerconnection_so in
> > > the static section, but some clients don't want to use it. This CL loads
> > > jingle_peerconnection_so only when a client requests it by calling one
> > > of:
> > >  * Logging.enableLogThreads
> > >  * Logging.enableLogTimeStamps
> > >  * Logging.enableTracing
> > >  * Logging.enableLogToDebugOutput
> > >
> > > BUG=b/36410678
> > >
> > > Review-Url: https://codereview.webrtc.org/2803203002
> > > Cr-Commit-Position: refs/heads/master@{#17647}
> > > Committed: dee5eb14e1
> >
> > TBR=sakal@webrtc.org,glaznev@webrtc.org,noahric@chromium.org,magjed@webrtc.org
> > # Not skipping CQ checks because original CL landed more than 1 days ago.
> > BUG=b/36410678
> >
> > Review-Url: https://codereview.webrtc.org/2816753002
> > Cr-Commit-Position: refs/heads/master@{#17676}
> > Committed: 6e4a4427dc
>
> TBR=sakal@webrtc.org,glaznev@webrtc.org,noahric@chromium.org,brandtr@webrtc.org
> # Skipping CQ checks because original CL landed less than 1 days ago.
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=b/36410678
>
> Review-Url: https://codereview.webrtc.org/2817593003
> Cr-Commit-Position: refs/heads/master@{#17677}
> Committed: 297714619f

TBR=sakal@webrtc.org,glaznev@webrtc.org,noahric@chromium.org,brandtr@webrtc.org,magjed@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=b/36410678

Review-Url: https://codereview.webrtc.org/2814133002
Cr-Commit-Position: refs/heads/master@{#17678}
2017-04-12 17:13:21 +00:00
297714619f Reland of Android Logging.java: Load native library only when needed (patchset #1 id:1 of https://codereview.webrtc.org/2816753002/ )
Reason for revert:
Fix bug in original CL.

Original issue's description:
> Revert of Android Logging.java: Load native library only when needed (patchset #3 id:40001 of https://codereview.webrtc.org/2803203002/ )
>
> Reason for revert:
> Breaks C++ logs in Java apps.
>
> Original issue's description:
> > Android Logging.java: Load native library only when needed
> >
> > Logging.java currently always tries to load jingle_peerconnection_so in
> > the static section, but some clients don't want to use it. This CL loads
> > jingle_peerconnection_so only when a client requests it by calling one
> > of:
> >  * Logging.enableLogThreads
> >  * Logging.enableLogTimeStamps
> >  * Logging.enableTracing
> >  * Logging.enableLogToDebugOutput
> >
> > BUG=b/36410678
> >
> > Review-Url: https://codereview.webrtc.org/2803203002
> > Cr-Commit-Position: refs/heads/master@{#17647}
> > Committed: dee5eb14e1
>
> TBR=sakal@webrtc.org,glaznev@webrtc.org,noahric@chromium.org,magjed@webrtc.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=b/36410678
>
> Review-Url: https://codereview.webrtc.org/2816753002
> Cr-Commit-Position: refs/heads/master@{#17676}
> Committed: 6e4a4427dc

TBR=sakal@webrtc.org,glaznev@webrtc.org,noahric@chromium.org,brandtr@webrtc.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=b/36410678

Review-Url: https://codereview.webrtc.org/2817593003
Cr-Commit-Position: refs/heads/master@{#17677}
2017-04-12 17:03:32 +00:00