Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 URL_URL_CANON_STDSTRING_H_ | 5 #ifndef URL_URL_CANON_STDSTRING_H_ |
| 6 #define URL_URL_CANON_STDSTRING_H_ | 6 #define URL_URL_CANON_STDSTRING_H_ |
| 7 | 7 |
| 8 // This header file defines a canonicalizer output method class for STL | 8 // This header file defines a canonicalizer output method class for STL |
| 9 // strings. Because the canonicalizer tries not to be dependent on the STL, | 9 // strings. Because the canonicalizer tries not to be dependent on the STL, |
| 10 // we have segregated it here. | 10 // we have segregated it here. |
| 11 | 11 |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/strings/string_piece.h" | 15 #include "base/strings/string_piece.h" |
| 16 #include "url/third_party/mozilla/url_parse.h" | |
| 16 #include "url/url_canon.h" | 17 #include "url/url_canon.h" |
| 17 #include "url/url_export.h" | 18 #include "url/url_export.h" |
| 18 | 19 |
| 20 namespace base { | |
| 21 template <typename STRING_TYPE> class BasicStringPiece; | |
| 22 } // namespace base | |
|
Łukasz Anforowicz
2016/01/07 00:16:17
This fwd decl is unexpected - BasicStringPiece sho
| |
| 23 | |
| 19 namespace url { | 24 namespace url { |
| 20 | 25 |
| 21 // Write into a std::string given in the constructor. This object does not own | 26 // Write into a std::string given in the constructor. This object does not own |
| 22 // the string itself, and the user must ensure that the string stays alive | 27 // the string itself, and the user must ensure that the string stays alive |
| 23 // throughout the lifetime of this object. | 28 // throughout the lifetime of this object. |
| 24 // | 29 // |
| 25 // The given string will be appended to; any existing data in the string will | 30 // The given string will be appended to; any existing data in the string will |
| 26 // be preserved. The caller should reserve() the amount of data in the string | 31 // be preserved. The caller should reserve() the amount of data in the string |
| 27 // they expect to be written. We will resize if necessary, but that's slow. | 32 // they expect to be written. We will resize if necessary, but that's slow. |
| 28 // | 33 // |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 78 this->SetQuery(s.data(), Component(0, static_cast<int>(s.length()))); | 83 this->SetQuery(s.data(), Component(0, static_cast<int>(s.length()))); |
| 79 } | 84 } |
| 80 void SetRefStr(const base::BasicStringPiece<STR>& s) { | 85 void SetRefStr(const base::BasicStringPiece<STR>& s) { |
| 81 this->SetRef(s.data(), Component(0, static_cast<int>(s.length()))); | 86 this->SetRef(s.data(), Component(0, static_cast<int>(s.length()))); |
| 82 } | 87 } |
| 83 }; | 88 }; |
| 84 | 89 |
| 85 } // namespace url | 90 } // namespace url |
| 86 | 91 |
| 87 #endif // URL_URL_CANON_STDSTRING_H_ | 92 #endif // URL_URL_CANON_STDSTRING_H_ |
| OLD | NEW |