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

Side by Side Diff: url/url_canon_stdstring.h

Issue 658563010: Update virtual/final usage in url/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 | « url/url_canon_icu.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.
(...skipping 18 matching lines...) Expand all
29 // unused space at the end because we make the string very big to start out 29 // unused space at the end because we make the string very big to start out
30 // with (by |initial_size|). This ends up being important because resize 30 // with (by |initial_size|). This ends up being important because resize
31 // operations are slow, and because the base class needs to write directly 31 // operations are slow, and because the base class needs to write directly
32 // into the buffer. 32 // into the buffer.
33 // 33 //
34 // Therefore, the user should call Complete() before using the string that 34 // Therefore, the user should call Complete() before using the string that
35 // this class wrote into. 35 // this class wrote into.
36 class URL_EXPORT StdStringCanonOutput : public CanonOutput { 36 class URL_EXPORT StdStringCanonOutput : public CanonOutput {
37 public: 37 public:
38 StdStringCanonOutput(std::string* str); 38 StdStringCanonOutput(std::string* str);
39 virtual ~StdStringCanonOutput(); 39 ~StdStringCanonOutput() override;
40 40
41 // Must be called after writing has completed but before the string is used. 41 // Must be called after writing has completed but before the string is used.
42 void Complete(); 42 void Complete();
43 43
44 virtual void Resize(int sz) override; 44 void Resize(int sz) override;
45 45
46 protected: 46 protected:
47 std::string* str_; 47 std::string* str_;
48 }; 48 };
49 49
50 // An extension of the Replacements class that allows the setters to use 50 // An extension of the Replacements class that allows the setters to use
51 // standard strings. 51 // standard strings.
52 // 52 //
53 // The strings passed as arguments are not copied and must remain valid until 53 // The strings passed as arguments are not copied and must remain valid until
54 // this class goes out of scope. 54 // this class goes out of scope.
(...skipping 22 matching lines...) Expand all
77 this->SetQuery(s.data(), Component(0, static_cast<int>(s.length()))); 77 this->SetQuery(s.data(), Component(0, static_cast<int>(s.length())));
78 } 78 }
79 void SetRefStr(const STR& s) { 79 void SetRefStr(const STR& s) {
80 this->SetRef(s.data(), Component(0, static_cast<int>(s.length()))); 80 this->SetRef(s.data(), Component(0, static_cast<int>(s.length())));
81 } 81 }
82 }; 82 };
83 83
84 } // namespace url 84 } // namespace url
85 85
86 #endif // URL_URL_CANON_STDSTRING_H_ 86 #endif // URL_URL_CANON_STDSTRING_H_
OLDNEW
« no previous file with comments | « url/url_canon_icu.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698