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

Unified Diff: mojo/public/cpp/bindings/lib/filter_chain.h

Issue 2064903002: Mojo: Report bindings validation errors via MojoNotifyBadMessage (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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
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 12e8bf0a931ed8efe9f63c27d1ba2ac7054f54ce..61745024f35d5d299a94ba0d838d06f10fbd20be 100644
--- a/mojo/public/cpp/bindings/lib/filter_chain.h
+++ b/mojo/public/cpp/bindings/lib/filter_chain.h
@@ -5,6 +5,7 @@
#ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_FILTER_CHAIN_H_
#define MOJO_PUBLIC_CPP_BINDINGS_LIB_FILTER_CHAIN_H_
+#include <utility>
#include <vector>
#include "base/macros.h"
@@ -24,8 +25,8 @@ class FilterChain {
FilterChain& operator=(FilterChain&& other);
~FilterChain();
- template <typename FilterType>
- inline void Append();
+ template <typename FilterType, typename... Args>
+ inline void Append(Args&&... args);
// Doesn't take ownership of |sink|. Therefore |sink| has to stay alive while
// this object is alive.
@@ -47,9 +48,9 @@ class FilterChain {
DISALLOW_COPY_AND_ASSIGN(FilterChain);
};
-template <typename FilterType>
-inline void FilterChain::Append() {
- FilterType* filter = new FilterType(sink_);
+template <typename FilterType, typename... Args>
+inline void FilterChain::Append(Args&&... args) {
+ FilterType* filter = new FilterType(sink_, std::forward<Args>(args)...);
if (!filters_.empty())
filters_.back()->set_sink(filter);
filters_.push_back(filter);

Powered by Google App Engine
This is Rietveld 408576698