OLD | NEW |
1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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 NET_QUIC_PLATFORM_API_QUIC_URL_UTILS_H_ | 5 #ifndef NET_QUIC_PLATFORM_API_QUIC_URL_UTILS_H_ |
6 #define NET_QUIC_PLATFORM_API_QUIC_URL_UTILS_H_ | 6 #define NET_QUIC_PLATFORM_API_QUIC_URL_UTILS_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "net/quic/platform/api/quic_export.h" | 9 #include "net/quic/platform/api/quic_export.h" |
| 10 #include "net/quic/platform/api/quic_string_piece.h" |
10 #include "net/quic/platform/impl/quic_url_utils_impl.h" | 11 #include "net/quic/platform/impl/quic_url_utils_impl.h" |
11 | 12 |
12 namespace net { | 13 namespace net { |
13 | 14 |
14 class QUIC_EXPORT_PRIVATE QuicUrlUtils { | 15 class QUIC_EXPORT_PRIVATE QuicUrlUtils { |
15 public: | 16 public: |
16 // Returns hostname, or empty std::string if missing. | 17 // Returns hostname, or empty std::string if missing. |
17 static std::string HostName(base::StringPiece url); | 18 static std::string HostName(QuicStringPiece url); |
18 | 19 |
19 // Returns false if any of these conditions occur: (1) Host name too long; (2) | 20 // Returns false if any of these conditions occur: (1) Host name too long; (2) |
20 // Invalid characters in host name, path or params; (3) Invalid port number | 21 // Invalid characters in host name, path or params; (3) Invalid port number |
21 // (e.g. greater than 65535). | 22 // (e.g. greater than 65535). |
22 static bool IsValidUrl(base::StringPiece url); | 23 static bool IsValidUrl(QuicStringPiece url); |
23 | 24 |
24 private: | 25 private: |
25 DISALLOW_COPY_AND_ASSIGN(QuicUrlUtils); | 26 DISALLOW_COPY_AND_ASSIGN(QuicUrlUtils); |
26 }; | 27 }; |
27 | 28 |
28 } // namespace net | 29 } // namespace net |
29 | 30 |
30 #endif // NET_QUIC_PLATFORM_API_QUIC_URL_UTILS_H_ | 31 #endif // NET_QUIC_PLATFORM_API_QUIC_URL_UTILS_H_ |
OLD | NEW |