summaryrefslogtreecommitdiff
path: root/src/HttpResponse.cc
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-07-04 00:39:11 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2013-07-04 00:39:11 +0900
commit57f1902ee1fd24e2fa94a5e5c0ee357335366d7d (patch)
treee3d944409286cca7fad799f7ff089378539defe0 /src/HttpResponse.cc
parentcb205a207ce6c2f4e01247e2270e2fe687062a23 (diff)
Use std::unique_ptr for StreamFilter instead of std::shared_ptr
Diffstat (limited to 'src/HttpResponse.cc')
-rw-r--r--src/HttpResponse.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/HttpResponse.cc b/src/HttpResponse.cc
index 4741c5ce..7bbe26ef 100644
--- a/src/HttpResponse.cc
+++ b/src/HttpResponse.cc
@@ -189,17 +189,17 @@ const std::string& HttpResponse::getTransferEncoding() const
return httpHeader_->find(HttpHeader::TRANSFER_ENCODING);
}
-std::shared_ptr<StreamFilter> HttpResponse::getTransferEncodingStreamFilter() const
+std::unique_ptr<StreamFilter>
+HttpResponse::getTransferEncodingStreamFilter() const
{
- std::shared_ptr<StreamFilter> filter;
// TODO Transfer-Encoding header field can contains multiple tokens. We should
// parse the field and retrieve each token.
if(isTransferEncodingSpecified()) {
if(util::strieq(getTransferEncoding(), "chunked")) {
- filter.reset(new ChunkedDecodingStreamFilter());
+ return make_unique<ChunkedDecodingStreamFilter>();
}
}
- return filter;
+ return std::unique_ptr<StreamFilter>{};
}
bool HttpResponse::isContentEncodingSpecified() const
@@ -212,16 +212,16 @@ const std::string& HttpResponse::getContentEncoding() const
return httpHeader_->find(HttpHeader::CONTENT_ENCODING);
}
-std::shared_ptr<StreamFilter> HttpResponse::getContentEncodingStreamFilter() const
+std::unique_ptr<StreamFilter>
+HttpResponse::getContentEncodingStreamFilter() const
{
- std::shared_ptr<StreamFilter> filter;
#ifdef HAVE_ZLIB
if(util::strieq(getContentEncoding(), "gzip") ||
util::strieq(getContentEncoding(), "deflate")) {
- filter.reset(new GZipDecodingStreamFilter());
+ return make_unique<GZipDecodingStreamFilter>();
}
#endif // HAVE_ZLIB
- return filter;
+ return std::unique_ptr<StreamFilter>{};
}
int64_t HttpResponse::getContentLength() const