| 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 #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 Loading... |
| 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 |
| OLD | NEW |