Rebase webrtc/base 6163:6216 (svn diff -r 6163:6216 http://webrtc.googlecode.com/svn/trunk/talk/base, apply diff manually)

BUG=3379
TBR=wu@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/17619004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6217 4adac7df-926f-26a2-2b94-8c16560cd09d
Switch to using base/constructormagic.h and remove system_wrappers/interface/constructor_magic.h.

Same as https://webrtc-codereview.appspot.com/19519004. The issue in
http://chromegw.corp.google.com/i/internal.chromium.webrtc.fyi/builders/Linux...
is solved by this change
http://src.chromium.org/viewvc/chrome/trunk/src/third_party/libjingle/libjing...
(tested locally).

BUG=3380
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/17619005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6218 4adac7df-926f-26a2-2b94-8c16560cd09d
Connect SignalDestroyed in AllocationSequence after TURN ports are destroyed
when TURN ports are using shared socket with UDP port.

This is required as AllocationSequence maintains a map of turn ports. If the
ports are destroyed without the knowledge of AllocationSequence, sequence will
try to deliver packets to the destoyed ports.

R=jiayl@webrtc.org
BUG=https://code.google.com/p/chromium/issues/detail?id=368877

Review URL: https://webrtc-codereview.appspot.com/14569007

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6219 4adac7df-926f-26a2-2b94-8c16560cd09d
WebRTCDemo: move the deletion of CritSect to end of the dtor to fix a crash in Android video renderer.

BUG=3368
TEST=Manual Test

Review URL: https://webrtc-codereview.appspot.com/21519005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6220 4adac7df-926f-26a2-2b94-8c16560cd09d
Adds missing include of assert header.

BUG=3380
R=sergeyu@chromium.org

Review URL: https://webrtc-codereview.appspot.com/14569008

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6221 4adac7df-926f-26a2-2b94-8c16560cd09d
Bump WebRTC version number to 3.54
TBR=wu@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/17619006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6222 4adac7df-926f-26a2-2b94-8c16560cd09d
Remove the restriction to allow having both webrtc and talk changes in the same cl.

This restriction is no longer needed as the auto sync script can handle changes to both folder in same commit correctly.

BUG=
R=andrew@webrtc.org, henrike@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/15479006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6225 4adac7df-926f-26a2-2b94-8c16560cd09d
Suppress webrtc trace races detected by tsan.

BUG=3372
R=kjellander@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/17579004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6226 4adac7df-926f-26a2-2b94-8c16560cd09d
Added mirror of gtest-parallel.

gtest-parallel is a Python script that runs gtest binaries in parallel.

R=andrew@webrtc.org, kjellander@webrtc.org, mflodman@webrtc.org
BUG=

Review URL: https://webrtc-codereview.appspot.com/11309004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6227 4adac7df-926f-26a2-2b94-8c16560cd09d
Fix deadlock in RegisterPreDecodeImageCallback.

Fixes lock-order inversion between ViEChannel::callback_cs_ and
VideoReceiver::_receiveCritSect detected on DrMemory Full which
exhibited different timing behavior.

Also removes most of the suppressions on DrMemory Full as they're able
to run again without deadlocking.

BUG=3336,3375
TEST=Run DrMemory Full trybots.
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/20499004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6228 4adac7df-926f-26a2-2b94-8c16560cd09d
Remove VideoSendStreamInput::PutFrame.

PutFrame just copies the frame before swapping it, if it's required that
can easily be done outside this API before swapping the frame.

BUG=
R=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/14529006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6229 4adac7df-926f-26a2-2b94-8c16560cd09d
Revert "Remove VideoSendStreamInput::PutFrame."

This reverts r6229.

Test WebRtcVideoChannel2BaseTest.MuteStream fails after r6229.

BUG=
R=stefan@webrtc.org
TBR=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/19529005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6230 4adac7df-926f-26a2-2b94-8c16560cd09d
Revert "Revert "Remove VideoSendStreamInput::PutFrame.""

This reverts commit r6230 to re-land r6229.

ViECapturer::SwapFrame now resets timestamps.

BUG=
R=stefan@webrtc.org
TBR=mflodman@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/13529004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6231 4adac7df-926f-26a2-2b94-8c16560cd09d
Fix uninitialized reads in IsDefaultBrowserFirefox

BUG=
TEST=Local DrMemory.
R=tommi@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/19529006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6232 4adac7df-926f-26a2-2b94-8c16560cd09d
1. Make a clear distinction between codec internal FEC and RED, confusing mentioning of FEC in the old codes is replaced by RED

2. Add two new APIs to configure codec internal FEC

3. Add a test and listened to results. This is based modifying EncodeDecodeTest and deriving a new class from it.

New ACM gives good result.
Old ACM does not use NetEq 4, so FEC won't be decoded.

BUG=
R=tina.legrand@webrtc.org, turaj@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/11759004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6233 4adac7df-926f-26a2-2b94-8c16560cd09d
Avoid reading uninitialized values (outside baundary) in DFT arithmatic decoder of iSAC-fix.

Arithmetic encoder does not right the last 2 or 3 bytes of |streamval| when terminating the bit-stream. Perhaps the last bytes makes no difference in decoding the stream. However, the decoder reads full |streamval| (int16_t) going out of boundary and reading uninitialized values. This avoids this problem. by inserting zero-bytes whenever decoder intends to read outside boundary.

BUG=1353,chrome373312,b/13468260
R=tina.legrand@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/16499005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6234 4adac7df-926f-26a2-2b94-8c16560cd09d
PRESUBMIT.py: accept variants on the copyright message that are present in the codebase.

Example files that this makes ok instead of flagging include:
  talk/base/signalthread_unittest.cc
  talk/base/thread_unittest.cc
  webrtc/base/signalthread_unittest.cc
  webrtc/base/thread.cc
  webrtc/base/thread.h
  webrtc/base/thread_unittest.cc

BUG=1027
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/19539006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6235 4adac7df-926f-26a2-2b94-8c16560cd09d
Thread: delete racy API (Release()) and fix racy code (started()).

- Thread::Release() wrote a local variable on the calling thread but read it on
  another thread, with no synchronization.  Happily it has no non-test callers
  so deleting it instead of trying to fix it (see bug for details).
- Thread::started_ similarly was racily being written to; replaced with a
  running_ Event, and hid the accessor except for tests & legacy callers,
  with a note about why it's a bad idea.

webrtc/base patched with:
git diff origin --relative=talk/base | patch -p1 -dwebrtc/base
followed by manual merge of 3 thunks that ran afoul of naming differences
between talk/base and webrtc/base.

BUG=3388
R=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/14589005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6236 4adac7df-926f-26a2-2b94-8c16560cd09d
(Auto)update libjingle 67848628-> 67848776

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6237 4adac7df-926f-26a2-2b94-8c16560cd09d
Disable ChannelManagerTest.StartupShutdownOnUnstartedThread
The test is testing a scenario that shouldn't happen.

BUG=3388
TBR=andrew@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/21509005

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6238 4adac7df-926f-26a2-2b94-8c16560cd09d