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

Side by Side Diff: net/quic/platform/api/quic_url_utils.h

Issue 2740453006: Add QuicStringPiece which is actually StringPiece. (Closed)
Patch Set: fix compile error and rebase Created 3 years, 9 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 | « net/quic/platform/api/quic_url.cc ('k') | net/quic/platform/api/quic_url_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_
OLDNEW
« no previous file with comments | « net/quic/platform/api/quic_url.cc ('k') | net/quic/platform/api/quic_url_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698