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

Side by Side Diff: mojo/public/cpp/bindings/lib/interface_impl_internal.h

Issue 291583005: Change FilterChain::Append() to a template method. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_IMPL_INTERNAL_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_IMPL_INTERNAL_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_IMPL_INTERNAL_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_IMPL_INTERNAL_H_
7 7
8 #include "mojo/public/cpp/bindings/error_handler.h" 8 #include "mojo/public/cpp/bindings/error_handler.h"
9 #include "mojo/public/cpp/bindings/interface_ptr.h" 9 #include "mojo/public/cpp/bindings/interface_ptr.h"
10 #include "mojo/public/cpp/bindings/lib/filter_chain.h" 10 #include "mojo/public/cpp/bindings/lib/filter_chain.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 MessagePipe pipe; 49 MessagePipe pipe;
50 ptr->Bind(pipe.handle0.Pass(), waiter); 50 ptr->Bind(pipe.handle0.Pass(), waiter);
51 Bind(pipe.handle1.Pass(), waiter); 51 Bind(pipe.handle1.Pass(), waiter);
52 } 52 }
53 53
54 void Bind(ScopedMessagePipeHandle handle, 54 void Bind(ScopedMessagePipeHandle handle,
55 MojoAsyncWaiter* waiter) { 55 MojoAsyncWaiter* waiter) {
56 assert(!router_); 56 assert(!router_);
57 57
58 FilterChain filters; 58 FilterChain filters;
59 filters.Append(new MessageHeaderValidator) 59 filters.Append<MessageHeaderValidator>();
60 .Append(new typename Interface::RequestValidator_) 60 filters.Append<typename Interface::RequestValidator_>();
61 .Append(new typename Interface::Client::ResponseValidator_); 61 filters.Append<typename Interface::Client::ResponseValidator_>();
62 62
63 router_ = new Router(handle.Pass(), filters.Pass(), waiter); 63 router_ = new Router(handle.Pass(), filters.Pass(), waiter);
64 router_->set_incoming_receiver(&stub_); 64 router_->set_incoming_receiver(&stub_);
65 router_->set_error_handler(this); 65 router_->set_error_handler(this);
66 66
67 proxy_ = new typename Client::Proxy_(router_); 67 proxy_ = new typename Client::Proxy_(router_);
68 68
69 instance()->SetClient(proxy_); 69 instance()->SetClient(proxy_);
70 instance()->OnConnectionEstablished(); 70 instance()->OnConnectionEstablished();
71 } 71 }
(...skipping 17 matching lines...) Expand all
89 typename Client::Proxy_* proxy_; 89 typename Client::Proxy_* proxy_;
90 typename Interface::Stub_ stub_; 90 typename Interface::Stub_ stub_;
91 91
92 MOJO_DISALLOW_COPY_AND_ASSIGN(InterfaceImplState); 92 MOJO_DISALLOW_COPY_AND_ASSIGN(InterfaceImplState);
93 }; 93 };
94 94
95 } // namespace internal 95 } // namespace internal
96 } // namespace mojo 96 } // namespace mojo
97 97
98 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_IMPL_INTERNAL_H_ 98 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_IMPL_INTERNAL_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/filter_chain.cc ('k') | mojo/public/cpp/bindings/lib/interface_ptr_internal.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698