Files
platform-external-webrtc/webrtc/base/helpers.h
deadbeef 5def7b9fde Revert of Adding the ability to create an RtpSender without a track. (patchset #3 id:300001 of https://codereview.webrtc.org/1413983004/ )
Reason for revert:
Still breaking CallAndModifyStream. Chromium CL intended to fix it (https://codereview.chromium.org/1435713002/) wasn't sufficient, because I forgot to call addStream/removeStream on the second connection.

Original issue's description:
> Reland of Adding the ability to create an RtpSender without a track. (patchset #1 id:1 of https://codereview.webrtc.org/1426443007/ )
>
> Reason for revert:
> Relanding, after changing the expectations of WebRtcBrowserTest.CallAndModifyStream.
>
> Original issue's description:
> > Revert of Adding the ability to create an RtpSender without a track. (patchset #8 id:140001 of https://codereview.webrtc.org/1413713003/ )
> >
> > Reason for revert:
> > Causing a compiler warning, and causing WebRtcBrowserTest.CallAndModifyStream to fail.
> >
> > Original issue's description:
> > > Adding the ability to create an RtpSender without a track.
> > >
> > > This CL also changes AddStream to immediately create a sender, rather
> > > than waiting until the track is seen in SDP. And the PeerConnection now
> > > builds the list of "send streams" from the list of senders, rather than
> > > the collection of local media streams.
> > >
> > > Committed: https://crrev.com/ac9d92ccbe2b29590c53f702e11dc625820480d5
> > > Cr-Commit-Position: refs/heads/master@{#10414}
> >
> > TBR=pthatcher@webrtc.org,pthatcher@chromium.org
> > NOPRESUBMIT=true
> > NOTREECHECKS=true
> > NOTRY=true
> >
> > Committed: https://crrev.com/8f46c63f6f764254892f4111b54aa1cc8f32eeeb
> > Cr-Commit-Position: refs/heads/master@{#10417}
>
> TBR=pthatcher@webrtc.org,pthatcher@chromium.org
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
>
> Committed: https://crrev.com/6834fa10f142bf5e2275142acb834898911d09ae
> Cr-Commit-Position: refs/heads/master@{#10730}

TBR=pthatcher@webrtc.org,pthatcher@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.webrtc.org/1460323002

Cr-Commit-Position: refs/heads/master@{#10732}
2015-11-20 19:43:27 +00:00

57 lines
1.8 KiB
C++

/*
* Copyright 2004 The WebRTC Project Authors. All rights reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef WEBRTC_BASE_HELPERS_H_
#define WEBRTC_BASE_HELPERS_H_
#include <string>
#include "webrtc/base/basictypes.h"
namespace rtc {
// For testing, we can return predictable data.
void SetRandomTestMode(bool test);
// Initializes the RNG, and seeds it with the specified entropy.
bool InitRandom(int seed);
bool InitRandom(const char* seed, size_t len);
// Generates a (cryptographically) random string of the given length.
// We generate base64 values so that they will be printable.
// WARNING: could silently fail. Use the version below instead.
std::string CreateRandomString(size_t length);
// Generates a (cryptographically) random string of the given length.
// We generate base64 values so that they will be printable.
// Return false if the random number generator failed.
bool CreateRandomString(size_t length, std::string* str);
// Generates a (cryptographically) random string of the given length,
// with characters from the given table. Return false if the random
// number generator failed.
bool CreateRandomString(size_t length, const std::string& table,
std::string* str);
// Generates a random id.
uint32_t CreateRandomId();
// Generates a 64 bit random id.
uint64_t CreateRandomId64();
// Generates a random id > 0.
uint32_t CreateRandomNonZeroId();
// Generates a random double between 0.0 (inclusive) and 1.0 (exclusive).
double CreateRandomDouble();
} // namespace rtc
#endif // WEBRTC_BASE_HELPERS_H_