| Index: mojo/public/cpp/bindings/lib/filter_chain.h
|
| diff --git a/mojo/public/cpp/bindings/lib/filter_chain.h b/mojo/public/cpp/bindings/lib/filter_chain.h
|
| index 447be3d136860710b7795b5a60e83c234d99b975..77b8448f794e7431512f70fd917971dc92fe1ea3 100644
|
| --- a/mojo/public/cpp/bindings/lib/filter_chain.h
|
| +++ b/mojo/public/cpp/bindings/lib/filter_chain.h
|
| @@ -28,6 +28,9 @@ class FilterChain {
|
| template <typename FilterType, typename... Args>
|
| inline void Append(Args&&... args);
|
|
|
| + // Takes ownership of |filter|.
|
| + void Append(MessageFilter* filter);
|
| +
|
| // Doesn't take ownership of |sink|. Therefore |sink| has to stay alive while
|
| // this object is alive.
|
| void SetSink(MessageReceiver* sink);
|
| @@ -50,10 +53,7 @@ class FilterChain {
|
|
|
| template <typename FilterType, typename... Args>
|
| inline void FilterChain::Append(Args&&... args) {
|
| - FilterType* filter = new FilterType(std::forward<Args>(args)..., sink_);
|
| - if (!filters_.empty())
|
| - filters_.back()->set_sink(filter);
|
| - filters_.push_back(filter);
|
| + Append(new FilterType(std::forward<Args>(args)..., sink_));
|
| }
|
|
|
| template <>
|
|
|