summaryrefslogtreecommitdiffstats
path: root/url
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 14:31:21 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-03 14:31:21 +0000
commitb596606630eee4cfb2449209e582b803b613f7fe (patch)
tree3d6fbaf607f4ede2d75e90ad3e7d21d437e15660 /url
parentcfb8c555703a92eed3a61e7a4fe91e74451a9221 (diff)
downloadchromium_src-b596606630eee4cfb2449209e582b803b613f7fe.zip
chromium_src-b596606630eee4cfb2449209e582b803b613f7fe.tar.gz
chromium_src-b596606630eee4cfb2449209e582b803b613f7fe.tar.bz2
Deinline the implementation of StdStringCanonOutput.
This should move the implementation of StdStringCanonOutput from the header to the source file, that should please the chromium-style clang plugin. BUG=287029 TEST=url_unittests R=thakis@chromium.org,abarth@chromium.org TBR=abarth Review URL: https://codereview.chromium.org/84673002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@238392 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'url')
-rw-r--r--url/url.gyp1
-rw-r--r--url/url_canon_stdstring.cc32
-rw-r--r--url/url_canon_stdstring.h27
3 files changed, 39 insertions, 21 deletions
diff --git a/url/url.gyp b/url/url.gyp
index 2c81443..9dc949a 100644
--- a/url/url.gyp
+++ b/url/url.gyp
@@ -42,6 +42,7 @@
'url_canon_pathurl.cc',
'url_canon_query.cc',
'url_canon_relative.cc',
+ 'url_canon_stdstring.cc',
'url_canon_stdstring.h',
'url_canon_stdurl.cc',
'url_file.h',
diff --git a/url/url_canon_stdstring.cc b/url/url_canon_stdstring.cc
new file mode 100644
index 0000000..ad81a2f
--- /dev/null
+++ b/url/url_canon_stdstring.cc
@@ -0,0 +1,32 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "url/url_canon_stdstring.h"
+
+namespace url_canon {
+
+StdStringCanonOutput::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());
+}
+
+StdStringCanonOutput::~StdStringCanonOutput() {
+ // Nothing to do, we don't own the string.
+}
+
+void StdStringCanonOutput::Complete() {
+ str_->resize(cur_len_);
+ buffer_len_ = cur_len_;
+}
+
+void StdStringCanonOutput::Resize(int sz) {
+ str_->resize(sz);
+ buffer_ = str_->empty() ? NULL : &(*str_)[0];
+ buffer_len_ = sz;
+}
+
+} // namespace url_canon
diff --git a/url/url_canon_stdstring.h b/url/url_canon_stdstring.h
index 9b4a6c2..0915672 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_;