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

Side by Side Diff: net/quic/platform/api/quic_url.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_text_utils_test.cc ('k') | net/quic/platform/api/quic_url.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_H_ 5 #ifndef NET_QUIC_PLATFORM_API_QUIC_URL_H_
6 #define NET_QUIC_PLATFORM_API_QUIC_URL_H_ 6 #define NET_QUIC_PLATFORM_API_QUIC_URL_H_
7 7
8 #include "net/quic/platform/api/quic_export.h" 8 #include "net/quic/platform/api/quic_export.h"
9 #include "net/quic/platform/api/quic_string_piece.h"
9 #include "net/quic/platform/impl/quic_url_impl.h" 10 #include "net/quic/platform/impl/quic_url_impl.h"
10 11
11 namespace net { 12 namespace net {
12 13
13 // QuicUrl stores a representation of a URL. 14 // QuicUrl stores a representation of a URL.
14 class QUIC_EXPORT_PRIVATE QuicUrl { 15 class QUIC_EXPORT_PRIVATE QuicUrl {
15 public: 16 public:
16 // Constructs an empty QuicUrl. 17 // Constructs an empty QuicUrl.
17 QuicUrl() = default; 18 QuicUrl() = default;
18 19
19 // Constructs a QuicUrl from the url string |url|. 20 // Constructs a QuicUrl from the url string |url|.
20 // NOTE: If |url| doesn't have a scheme, it will have an empty scheme 21 // NOTE: If |url| doesn't have a scheme, it will have an empty scheme
21 // field. If that's not what you want, use the QuicUrlImpl(url, 22 // field. If that's not what you want, use the QuicUrlImpl(url,
22 // default_scheme) form below. 23 // default_scheme) form below.
23 explicit QuicUrl(base::StringPiece url); 24 explicit QuicUrl(QuicStringPiece url);
24 25
25 // Constructs a QuicUrl from |url|, assuming that the scheme for the QuicUrl 26 // Constructs a QuicUrl from |url|, assuming that the scheme for the QuicUrl
26 // is |default_scheme| if there is no scheme specified in |url|. 27 // is |default_scheme| if there is no scheme specified in |url|.
27 QuicUrl(base::StringPiece url, base::StringPiece default_scheme); 28 QuicUrl(QuicStringPiece url, QuicStringPiece default_scheme);
28 29
29 QuicUrl(const QuicUrl& url); 30 QuicUrl(const QuicUrl& url);
30 31
31 // Returns false if any of these conditions occur: 32 // Returns false if any of these conditions occur:
32 // No scheme specified 33 // No scheme specified
33 // Host name too long (the maximum hostname length is platform-dependent) 34 // Host name too long (the maximum hostname length is platform-dependent)
34 // Invalid characters in host name, path or params 35 // Invalid characters in host name, path or params
35 // Invalid port number (e.g. greater than 65535) 36 // Invalid port number (e.g. greater than 65535)
36 bool IsValid() const; 37 bool IsValid() const;
37 38
(...skipping 21 matching lines...) Expand all
59 60
60 const QuicUrlImpl& impl() const { return impl_; } 61 const QuicUrlImpl& impl() const { return impl_; }
61 62
62 private: 63 private:
63 QuicUrlImpl impl_; 64 QuicUrlImpl impl_;
64 }; 65 };
65 66
66 } // namespace net 67 } // namespace net
67 68
68 #endif // NET_QUIC_PLATFORM_API_QUIC_URL_H_ 69 #endif // NET_QUIC_PLATFORM_API_QUIC_URL_H_
OLDNEW
« no previous file with comments | « net/quic/platform/api/quic_text_utils_test.cc ('k') | net/quic/platform/api/quic_url.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698