Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Unified Diff: webrtc/p2p/base/turnserver.cc

Issue 1362503003: Use suffixed {uint,int}{8,16,32,64}_t types. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase + revert basictypes.h (to be landed separately just in case of a revert due to unexpected us… Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/turnport.cc ('k') | webrtc/p2p/client/basicportallocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/base/turnserver.cc
diff --git a/webrtc/p2p/base/turnserver.cc b/webrtc/p2p/base/turnserver.cc
index 7d82d55c5d8489cfef56741f0a74cf3d8bfebd06..8d40a9030c43260f00e54a88029e3878c904664a 100644
--- a/webrtc/p2p/base/turnserver.cc
+++ b/webrtc/p2p/base/turnserver.cc
@@ -40,7 +40,7 @@ static const size_t kNonceSize = 40;
static const size_t TURN_CHANNEL_HEADER_SIZE = 4U;
// TODO(mallinath) - Move these to a common place.
-inline bool IsTurnChannelData(uint16 msg_type) {
+inline bool IsTurnChannelData(uint16_t msg_type) {
// The first two bits of a channel data message are 0b01.
return ((msg_type & 0xC000) == 0x4000);
}
@@ -200,7 +200,7 @@ void TurnServer::OnInternalPacket(rtc::AsyncPacketSocket* socket,
InternalSocketMap::iterator iter = server_sockets_.find(socket);
ASSERT(iter != server_sockets_.end());
TurnServerConnection conn(addr, iter->second, socket);
- uint16 msg_type = rtc::GetBE16(data);
+ uint16_t msg_type = rtc::GetBE16(data);
if (!IsTurnChannelData(msg_type)) {
// This is a STUN message.
HandleStunMessage(&conn, data, size);
@@ -394,7 +394,7 @@ void TurnServer::HandleAllocateRequest(TurnServerConnection* conn,
std::string TurnServer::GenerateNonce() const {
// Generate a nonce of the form hex(now + HMAC-MD5(nonce_key_, now))
- uint32 now = rtc::Time();
+ uint32_t now = rtc::Time();
std::string input(reinterpret_cast<const char*>(&now), sizeof(now));
std::string nonce = rtc::hex_encode(input.c_str(), input.size());
nonce += rtc::ComputeHmac(rtc::DIGEST_MD5, nonce_key_, input);
@@ -409,7 +409,7 @@ bool TurnServer::ValidateNonce(const std::string& nonce) const {
}
// Decode the timestamp.
- uint32 then;
+ uint32_t then;
char* p = reinterpret_cast<char*>(&then);
size_t len = rtc::hex_decode(p, sizeof(then),
nonce.substr(0, sizeof(then) * 2));
@@ -761,7 +761,7 @@ void TurnServerAllocation::HandleChannelBindRequest(const TurnMessage* msg) {
void TurnServerAllocation::HandleChannelData(const char* data, size_t size) {
// Extract the channel number from the data.
- uint16 channel_id = rtc::GetBE16(data);
+ uint16_t channel_id = rtc::GetBE16(data);
Channel* channel = FindChannel(channel_id);
if (channel) {
// Send the data to the peer address.
@@ -784,7 +784,7 @@ void TurnServerAllocation::OnExternalPacket(
// There is a channel bound to this address. Send as a channel message.
rtc::ByteBuffer buf;
buf.WriteUInt16(channel->id());
- buf.WriteUInt16(static_cast<uint16>(size));
+ buf.WriteUInt16(static_cast<uint16_t>(size));
buf.WriteBytes(data, size);
server_->Send(&conn_, buf);
} else if (HasPermission(addr.ipaddr())) {
@@ -806,7 +806,7 @@ void TurnServerAllocation::OnExternalPacket(
int TurnServerAllocation::ComputeLifetime(const TurnMessage* msg) {
// Return the smaller of our default lifetime and the requested lifetime.
- uint32 lifetime = kDefaultAllocationTimeout / 1000; // convert to seconds
+ uint32_t lifetime = kDefaultAllocationTimeout / 1000; // convert to seconds
const StunUInt32Attribute* lifetime_attr = msg->GetUInt32(STUN_ATTR_LIFETIME);
if (lifetime_attr && lifetime_attr->value() < lifetime) {
lifetime = lifetime_attr->value();
« no previous file with comments | « webrtc/p2p/base/turnport.cc ('k') | webrtc/p2p/client/basicportallocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698