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

Side by Side Diff: net/quic/platform/impl/quic_url_impl.cc

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/impl/quic_url_impl.h ('k') | net/quic/platform/impl/quic_url_utils_impl.h » ('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 #include "net/quic/platform/impl/quic_url_impl.h" 5 #include "net/quic/platform/impl/quic_url_impl.h"
6 6
7 #include "net/quic/platform/api/quic_text_utils.h" 7 #include "net/quic/platform/api/quic_text_utils.h"
8 8
9 using base::StringPiece;
10 using std::string; 9 using std::string;
11 10
12 namespace net { 11 namespace net {
13 12
14 QuicUrlImpl::QuicUrlImpl(StringPiece url) : url_(url) {} 13 QuicUrlImpl::QuicUrlImpl(QuicStringPiece url) : url_(url) {}
15 14
16 QuicUrlImpl::QuicUrlImpl(StringPiece url, StringPiece default_scheme) 15 QuicUrlImpl::QuicUrlImpl(QuicStringPiece url, QuicStringPiece default_scheme)
17 : url_(url) { 16 : url_(url) {
18 if (url_.has_scheme()) { 17 if (url_.has_scheme()) {
19 return; 18 return;
20 } 19 }
21 string buffer = default_scheme.as_string() + "://" + url.as_string(); 20 string buffer = default_scheme.as_string() + "://" + url.as_string();
22 url_ = GURL(buffer); 21 url_ = GURL(buffer);
23 } 22 }
24 23
25 QuicUrlImpl::QuicUrlImpl(const QuicUrlImpl& url) : url_(url.url()) {} 24 QuicUrlImpl::QuicUrlImpl(const QuicUrlImpl& url) : url_(url.url()) {}
26 25
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 } 97 }
99 98
100 int port = url_.EffectiveIntPort(); 99 int port = url_.EffectiveIntPort();
101 if (port == url::PORT_UNSPECIFIED) { 100 if (port == url::PORT_UNSPECIFIED) {
102 return 0; 101 return 0;
103 } 102 }
104 return port; 103 return port;
105 } 104 }
106 105
107 } // namespace net 106 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/platform/impl/quic_url_impl.h ('k') | net/quic/platform/impl/quic_url_utils_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698