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

Side by Side Diff: webrtc/base/httpcommon-inl.h

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 unified diff | Download patch
« no previous file with comments | « webrtc/base/httpcommon.cc ('k') | webrtc/base/ipaddress.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 void Url<CTYPE>::do_set_address(const CTYPE* val, size_t len) { 45 void Url<CTYPE>::do_set_address(const CTYPE* val, size_t len) {
46 if (const CTYPE* at = strchrn(val, len, static_cast<CTYPE>('@'))) { 46 if (const CTYPE* at = strchrn(val, len, static_cast<CTYPE>('@'))) {
47 // Everything before the @ is a user:password combo, so skip it. 47 // Everything before the @ is a user:password combo, so skip it.
48 len -= at - val + 1; 48 len -= at - val + 1;
49 val = at + 1; 49 val = at + 1;
50 } 50 }
51 if (const CTYPE* colon = strchrn(val, len, static_cast<CTYPE>(':'))) { 51 if (const CTYPE* colon = strchrn(val, len, static_cast<CTYPE>(':'))) {
52 host_.assign(val, colon - val); 52 host_.assign(val, colon - val);
53 // Note: In every case, we're guaranteed that colon is followed by a null, 53 // Note: In every case, we're guaranteed that colon is followed by a null,
54 // or non-numeric character. 54 // or non-numeric character.
55 port_ = static_cast<uint16>(::strtoul(colon + 1, NULL, 10)); 55 port_ = static_cast<uint16_t>(::strtoul(colon + 1, NULL, 10));
56 // TODO: Consider checking for invalid data following port number. 56 // TODO: Consider checking for invalid data following port number.
57 } else { 57 } else {
58 host_.assign(val, len); 58 host_.assign(val, len);
59 port_ = HttpDefaultPort(secure_); 59 port_ = HttpDefaultPort(secure_);
60 } 60 }
61 } 61 }
62 62
63 template<class CTYPE> 63 template<class CTYPE>
64 void Url<CTYPE>::do_set_full_path(const CTYPE* val, size_t len) { 64 void Url<CTYPE>::do_set_full_path(const CTYPE* val, size_t len) {
65 const CTYPE* query = strchrn(val, len, static_cast<CTYPE>('?')); 65 const CTYPE* query = strchrn(val, len, static_cast<CTYPE>('?'));
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 } 122 }
123 value->assign(query_.substr(pos, end - pos)); 123 value->assign(query_.substr(pos, end - pos));
124 return true; 124 return true;
125 } 125 }
126 126
127 /////////////////////////////////////////////////////////////////////////////// 127 ///////////////////////////////////////////////////////////////////////////////
128 128
129 } // namespace rtc 129 } // namespace rtc
130 130
131 #endif // WEBRTC_BASE_HTTPCOMMON_INL_H__ 131 #endif // WEBRTC_BASE_HTTPCOMMON_INL_H__
OLDNEW
« no previous file with comments | « webrtc/base/httpcommon.cc ('k') | webrtc/base/ipaddress.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698