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

Unified Diff: services/media/framework/graph.h

Issue 1822333002: Motown: wholesale clang-format (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: dalesat Created 4 years, 9 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 | « services/media/framework/formatting.cc ('k') | services/media/framework/graph.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/media/framework/graph.h
diff --git a/services/media/framework/graph.h b/services/media/framework/graph.h
index ea833f0cc2425916252be6436d09c7fcc97ab659..f0b6482840efb8eae911b4ae61283649bb8427e8 100644
--- a/services/media/framework/graph.h
+++ b/services/media/framework/graph.h
@@ -23,17 +23,18 @@ namespace {
// StageCreator::Create creates a stage for a part. DEFINE_STAGE_CREATOR defines
// a specialization for a particular model/stage type pair. Every new
// model/stage type pair that's defined will need an entry here.
-template<typename T, typename Enable = void> class StageCreator;
-
-#define DEFINE_STAGE_CREATOR(TModel, TStage) \
-template<typename T> \
-class StageCreator<T, typename std::enable_if< \
- std::is_base_of<TModel, T>::value>::type> { \
- public: \
- static inline Stage* Create(std::shared_ptr<T> t_ptr) { \
- return new TStage(std::shared_ptr<TModel>(t_ptr)); \
- } \
-};
+template <typename T, typename Enable = void>
+class StageCreator;
+
+#define DEFINE_STAGE_CREATOR(TModel, TStage) \
+ template <typename T> \
+ class StageCreator< \
+ T, typename std::enable_if<std::is_base_of<TModel, T>::value>::type> { \
+ public: \
+ static inline Stage* Create(std::shared_ptr<T> t_ptr) { \
+ return new TStage(std::shared_ptr<TModel>(t_ptr)); \
+ } \
+ };
DEFINE_STAGE_CREATOR(MultistreamSource, MultistreamSourceStage);
DEFINE_STAGE_CREATOR(Transform, TransformStage);
@@ -42,7 +43,7 @@ DEFINE_STAGE_CREATOR(ActiveSink, ActiveSinkStage);
#undef DEFINE_STAGE_CREATOR
-} // namespace
+} // namespace
//
// USAGE
@@ -119,7 +120,7 @@ class Graph {
~Graph();
// Adds a part to the graph.
- template<typename T>
+ template <typename T>
PartRef Add(std::shared_ptr<T> t_ptr) {
DCHECK(t_ptr);
return Add(StageCreator<T>::Create(t_ptr));
@@ -164,7 +165,7 @@ class Graph {
// Adds all the parts in t (which must all have one input and one output) and
// connects them in sequence to the output connector. Returns the output
// connector of the last part or the output parameter if it is empty.
- template<typename T>
+ template <typename T>
OutputRef AddAndConnectAll(OutputRef output, const T& t) {
for (const auto& element : t) {
PartRef part = Add(StageCreator<T>::Create(element));
« no previous file with comments | « services/media/framework/formatting.cc ('k') | services/media/framework/graph.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698