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

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
« no previous file with comments | « mojo/public/cpp/bindings/lib/bounds_checker.cc ('k') | mojo/public/cpp/bindings/lib/interface_ptr_state.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..447be3d136860710b7795b5a60e83c234d99b975 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(std::forward<Args>(args)..., sink_);
if (!filters_.empty())
filters_.back()->set_sink(filter);
filters_.push_back(filter);
« no previous file with comments | « mojo/public/cpp/bindings/lib/bounds_checker.cc ('k') | mojo/public/cpp/bindings/lib/interface_ptr_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698