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

Side by Side Diff: webrtc/p2p/base/candidate.h

Issue 1291363005: Reland "Remove GICE (gone forever!) and PORTALLOCATOR_ENABLE_SHARED_UFRAG (enabled forever)." becau… (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: add comments Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 void set_protocol(const std::string & protocol) { protocol_ = protocol; } 71 void set_protocol(const std::string & protocol) { protocol_ = protocol; }
72 72
73 const rtc::SocketAddress & address() const { return address_; } 73 const rtc::SocketAddress & address() const { return address_; }
74 void set_address(const rtc::SocketAddress & address) { 74 void set_address(const rtc::SocketAddress & address) {
75 address_ = address; 75 address_ = address;
76 } 76 }
77 77
78 uint32 priority() const { return priority_; } 78 uint32 priority() const { return priority_; }
79 void set_priority(const uint32 priority) { priority_ = priority; } 79 void set_priority(const uint32 priority) { priority_ = priority; }
80 80
81 // void set_type_preference(uint32 type_preference) { 81 // TODO(pthatcher): Remove once Chromium's jingle/glue/utils.cc
82 // priority_ = GetPriority(type_preference); 82 // doesn't use it.
83 // }
84
85 // Maps old preference (which was 0.0-1.0) to match priority (which 83 // Maps old preference (which was 0.0-1.0) to match priority (which
86 // is 0-2^32-1) to to match RFC 5245, section 4.1.2.1. Also see 84 // is 0-2^32-1) to to match RFC 5245, section 4.1.2.1. Also see
87 // https://docs.google.com/a/google.com/document/d/ 85 // https://docs.google.com/a/google.com/document/d/
88 // 1iNQDiwDKMh0NQOrCqbj3DKKRT0Dn5_5UJYhmZO-t7Uc/edit 86 // 1iNQDiwDKMh0NQOrCqbj3DKKRT0Dn5_5UJYhmZO-t7Uc/edit
89 float preference() const { 87 float preference() const {
90 // The preference value is clamped to two decimal precision. 88 // The preference value is clamped to two decimal precision.
91 return static_cast<float>(((priority_ >> 24) * 100 / 127) / 100.0); 89 return static_cast<float>(((priority_ >> 24) * 100 / 127) / 100.0);
92 } 90 }
93 91
92 // TODO(pthatcher): Remove once Chromium's jingle/glue/utils.cc
93 // doesn't use it.
94 void set_preference(float preference) { 94 void set_preference(float preference) {
95 // Limiting priority to UINT_MAX when value exceeds uint32 max. 95 // Limiting priority to UINT_MAX when value exceeds uint32 max.
96 // This can happen for e.g. when preference = 3. 96 // This can happen for e.g. when preference = 3.
97 uint64 prio_val = static_cast<uint64>(preference * 127) << 24; 97 uint64 prio_val = static_cast<uint64>(preference * 127) << 24;
98 priority_ = 98 priority_ =
99 static_cast<uint32>(std::min(prio_val, static_cast<uint64>(UINT_MAX))); 99 static_cast<uint32>(std::min(prio_val, static_cast<uint64>(UINT_MAX)));
100 } 100 }
101 101
102 const std::string & username() const { return username_; } 102 const std::string & username() const { return username_; }
103 void set_username(const std::string & username) { username_ = username; } 103 void set_username(const std::string & username) { username_ = username; }
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 virtual ~CandidateTranslator() {} 235 virtual ~CandidateTranslator() {}
236 virtual bool GetChannelNameFromComponent( 236 virtual bool GetChannelNameFromComponent(
237 int component, std::string* channel_name) const = 0; 237 int component, std::string* channel_name) const = 0;
238 virtual bool GetComponentFromChannelName( 238 virtual bool GetComponentFromChannelName(
239 const std::string& channel_name, int* component) const = 0; 239 const std::string& channel_name, int* component) const = 0;
240 }; 240 };
241 241
242 } // namespace cricket 242 } // namespace cricket
243 243
244 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_ 244 #endif // WEBRTC_P2P_BASE_CANDIDATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698