| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef URL_SCHEME_HOST_PORT_H_ | 5 #ifndef URL_SCHEME_HOST_PORT_H_ |
| 6 #define URL_SCHEME_HOST_PORT_H_ | 6 #define URL_SCHEME_HOST_PORT_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 uint16_t port); | 89 uint16_t port); |
| 90 | 90 |
| 91 // Metadata influencing whether or not the constructor should sanity check | 91 // Metadata influencing whether or not the constructor should sanity check |
| 92 // host canonicalization. | 92 // host canonicalization. |
| 93 enum ConstructPolicy { CHECK_CANONICALIZATION, ALREADY_CANONICALIZED }; | 93 enum ConstructPolicy { CHECK_CANONICALIZATION, ALREADY_CANONICALIZED }; |
| 94 | 94 |
| 95 // Creates a (scheme, host, port) tuple without performing sanity checking | 95 // Creates a (scheme, host, port) tuple without performing sanity checking |
| 96 // that the host and port are canonicalized. This should only be used when | 96 // that the host and port are canonicalized. This should only be used when |
| 97 // converting between already normalized types, and should NOT be used for | 97 // converting between already normalized types, and should NOT be used for |
| 98 // IPC. | 98 // IPC. |
| 99 SchemeHostPort(base::StringPiece scheme, | 99 SchemeHostPort(std::string scheme, |
| 100 base::StringPiece host, | 100 std::string host, |
| 101 uint16_t port, | 101 uint16_t port, |
| 102 ConstructPolicy policy); | 102 ConstructPolicy policy); |
| 103 | 103 |
| 104 // Creates a (scheme, host, port) tuple from |url|, as described at | 104 // Creates a (scheme, host, port) tuple from |url|, as described at |
| 105 // https://tools.ietf.org/html/rfc6454#section-4 | 105 // https://tools.ietf.org/html/rfc6454#section-4 |
| 106 // | 106 // |
| 107 // If |url| is invalid or non-standard, the result will be an invalid | 107 // If |url| is invalid or non-standard, the result will be an invalid |
| 108 // SchemeHostPort object. | 108 // SchemeHostPort object. |
| 109 explicit SchemeHostPort(const GURL& url); | 109 explicit SchemeHostPort(const GURL& url); |
| 110 | 110 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 std::string SerializeInternal(url::Parsed* parsed) const; | 146 std::string SerializeInternal(url::Parsed* parsed) const; |
| 147 | 147 |
| 148 std::string scheme_; | 148 std::string scheme_; |
| 149 std::string host_; | 149 std::string host_; |
| 150 uint16_t port_; | 150 uint16_t port_; |
| 151 }; | 151 }; |
| 152 | 152 |
| 153 } // namespace url | 153 } // namespace url |
| 154 | 154 |
| 155 #endif // URL_SCHEME_HOST_PORT_H_ | 155 #endif // URL_SCHEME_HOST_PORT_H_ |
| OLD | NEW |