Skip to content

Commit c2a32fd

Browse files
Will Wangmeta-codesync[bot]
authored andcommitted
Add Validation Check 1.5/n: Change HTTPMessageFilter::getFilterName() to std::string_view
Summary: Change the return type of `HTTPMessageFilter::getFilterName()` from `const std::string&` to `std::string_view`. Nicer more modern API. Reviewed By: hanidamlaj Differential Revision: D89774003 fbshipit-source-id: 0579efedc96d1c205bdf75688327fad13fba2c73
1 parent f084bc2 commit c2a32fd

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

third-party/proxygen/src/proxygen/lib/http/HTTPMessageFilters.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414

1515
#include <proxygen/lib/http/sink/HTTPSink.h>
1616

17+
#include <string_view>
18+
1719
namespace proxygen {
1820

1921
static const std::string kMessageFilterDefaultName_ = "Unknown";
@@ -103,7 +105,7 @@ class HTTPMessageFilter
103105
nextTransactionHandler_->onExTransaction(txn);
104106
}
105107

106-
[[nodiscard]] virtual const std::string& getFilterName() const noexcept {
108+
[[nodiscard]] virtual std::string_view getFilterName() const noexcept {
107109
return kMessageFilterDefaultName_;
108110
}
109111

third-party/proxygen/src/proxygen/lib/http/test/MockHTTPMessageFilter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class MockHTTPMessageFilter : public HTTPMessageFilter {
6161
nextOnHeadersComplete(std::move(msgU));
6262
}
6363

64-
const std::string& getFilterName() const noexcept override {
64+
std::string_view getFilterName() const noexcept override {
6565
return kMockFilterName;
6666
}
6767

0 commit comments

Comments
 (0)