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

Unified Diff: url/url_canon_stdstring.h

Issue 84673002: Deinline the implementation of StdStringCanonOutput. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « url/url.gyp ('k') | url/url_canon_stdstring.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/url_canon_stdstring.h
diff --git a/url/url_canon_stdstring.h b/url/url_canon_stdstring.h
index 9b4a6c2a3b56b5069e76be69da71a17a3cfa5d0a..0915672c371b1fea10692a43e6341b98908f4773 100644
--- a/url/url_canon_stdstring.h
+++ b/url/url_canon_stdstring.h
@@ -13,6 +13,7 @@
#include "base/compiler_specific.h"
#include "url/url_canon.h"
+#include "url/url_export.h"
namespace url_canon {
@@ -32,31 +33,15 @@ namespace url_canon {
//
// Therefore, the user should call Complete() before using the string that
// this class wrote into.
-class StdStringCanonOutput : public CanonOutput {
+class URL_EXPORT StdStringCanonOutput : public CanonOutput {
public:
- StdStringCanonOutput(std::string* str)
- : CanonOutput(),
- str_(str) {
- cur_len_ = static_cast<int>(str_->size()); // Append to existing data.
- str_->resize(str_->capacity());
- buffer_ = str_->empty() ? NULL : &(*str_)[0];
- buffer_len_ = static_cast<int>(str_->size());
- }
- virtual ~StdStringCanonOutput() {
- // Nothing to do, we don't own the string.
- }
+ StdStringCanonOutput(std::string* str);
+ virtual ~StdStringCanonOutput();
// Must be called after writing has completed but before the string is used.
- void Complete() {
- str_->resize(cur_len_);
- buffer_len_ = cur_len_;
- }
+ void Complete();
- virtual void Resize(int sz) OVERRIDE {
- str_->resize(sz);
- buffer_ = str_->empty() ? NULL : &(*str_)[0];
- buffer_len_ = sz;
- }
+ virtual void Resize(int sz) OVERRIDE;
protected:
std::string* str_;
« no previous file with comments | « url/url.gyp ('k') | url/url_canon_stdstring.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698