OLD | NEW |
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 |
11 #ifndef WEBRTC_BASE_HTTPCOMMON_H__ | 11 #ifndef WEBRTC_BASE_HTTPCOMMON_H__ |
12 #define WEBRTC_BASE_HTTPCOMMON_H__ | 12 #define WEBRTC_BASE_HTTPCOMMON_H__ |
13 | 13 |
14 #include <map> | 14 #include <map> |
15 #include <memory> | 15 #include <memory> |
16 #include <string> | 16 #include <string> |
17 #include <vector> | 17 #include <vector> |
18 #include "webrtc/base/basictypes.h" | 18 #include "webrtc/base/basictypes.h" |
| 19 #include "webrtc/base/checks.h" |
19 #include "webrtc/base/common.h" | 20 #include "webrtc/base/common.h" |
20 #include "webrtc/base/stringutils.h" | 21 #include "webrtc/base/stringutils.h" |
21 #include "webrtc/base/stream.h" | 22 #include "webrtc/base/stream.h" |
22 | 23 |
23 namespace rtc { | 24 namespace rtc { |
24 | 25 |
25 class CryptString; | 26 class CryptString; |
26 class SocketAddress; | 27 class SocketAddress; |
27 | 28 |
28 ////////////////////////////////////////////////////////////////////// | 29 ////////////////////////////////////////////////////////////////////// |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 void set_port(uint16_t val) { port_ = val; } | 248 void set_port(uint16_t val) { port_ = val; } |
248 uint16_t port() const { return port_; } | 249 uint16_t port() const { return port_; } |
249 | 250 |
250 void set_secure(bool val) { secure_ = val; } | 251 void set_secure(bool val) { secure_ = val; } |
251 bool secure() const { return secure_; } | 252 bool secure() const { return secure_; } |
252 | 253 |
253 void set_path(const string& val) { | 254 void set_path(const string& val) { |
254 if (val.empty()) { | 255 if (val.empty()) { |
255 path_.assign(1, static_cast<CTYPE>('/')); | 256 path_.assign(1, static_cast<CTYPE>('/')); |
256 } else { | 257 } else { |
257 ASSERT(val[0] == static_cast<CTYPE>('/')); | 258 RTC_DCHECK(val[0] == static_cast<CTYPE>('/')); |
258 path_ = val; | 259 path_ = val; |
259 } | 260 } |
260 } | 261 } |
261 const string& path() const { return path_; } | 262 const string& path() const { return path_; } |
262 | 263 |
263 void set_query(const string& val) { | 264 void set_query(const string& val) { |
264 ASSERT(val.empty() || (val[0] == static_cast<CTYPE>('?'))); | 265 RTC_DCHECK(val.empty() || (val[0] == static_cast<CTYPE>('?'))); |
265 query_ = val; | 266 query_ = val; |
266 } | 267 } |
267 const string& query() const { return query_; } | 268 const string& query() const { return query_; } |
268 | 269 |
269 bool get_attribute(const string& name, string* value) const; | 270 bool get_attribute(const string& name, string* value) const; |
270 | 271 |
271 private: | 272 private: |
272 void do_set_url(const CTYPE* val, size_t len); | 273 void do_set_url(const CTYPE* val, size_t len); |
273 void do_set_address(const CTYPE* val, size_t len); | 274 void do_set_address(const CTYPE* val, size_t len); |
274 void do_set_full_path(const CTYPE* val, size_t len); | 275 void do_set_full_path(const CTYPE* val, size_t len); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 const SocketAddress& server, | 450 const SocketAddress& server, |
450 const std::string& method, const std::string& uri, | 451 const std::string& method, const std::string& uri, |
451 const std::string& username, const CryptString& password, | 452 const std::string& username, const CryptString& password, |
452 HttpAuthContext *& context, std::string& response, std::string& auth_method); | 453 HttpAuthContext *& context, std::string& response, std::string& auth_method); |
453 | 454 |
454 ////////////////////////////////////////////////////////////////////// | 455 ////////////////////////////////////////////////////////////////////// |
455 | 456 |
456 } // namespace rtc | 457 } // namespace rtc |
457 | 458 |
458 #endif // WEBRTC_BASE_HTTPCOMMON_H__ | 459 #endif // WEBRTC_BASE_HTTPCOMMON_H__ |
OLD | NEW |