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

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

Issue 280003003: Add SetClient method implementation to InterfaceImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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_PTR_INTERNAL_H_ 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_
7 7
8 #include <stdio.h> 8 #include <stdio.h>
9 9
10 #include "mojo/public/cpp/bindings/lib/router.h" 10 #include "mojo/public/cpp/bindings/lib/router.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 instance_->SetClient(proxy); 70 instance_->SetClient(proxy);
71 client_ = proxy; 71 client_ = proxy;
72 } 72 }
73 73
74 private: 74 private:
75 class ProxyWithStub : public Interface::Proxy_ { 75 class ProxyWithStub : public Interface::Proxy_ {
76 public: 76 public:
77 explicit ProxyWithStub(MessageReceiver* receiver) 77 explicit ProxyWithStub(MessageReceiver* receiver)
78 : Interface::Proxy_(receiver) { 78 : Interface::Proxy_(receiver) {
79 } 79 }
80 virtual void SetClient(typename Interface::Client_* client) MOJO_OVERRIDE { 80 virtual void SetClient(typename Interface::Client* client) MOJO_OVERRIDE {
81 stub.set_sink(client); 81 stub.set_sink(client);
82 } 82 }
83 typename Interface::Client_::Stub_ stub; 83 typename Interface::Client::Stub_ stub;
84 private: 84 private:
85 MOJO_DISALLOW_COPY_AND_ASSIGN(ProxyWithStub); 85 MOJO_DISALLOW_COPY_AND_ASSIGN(ProxyWithStub);
86 }; 86 };
87 87
88 class ClientProxyWithStub : public Interface::Client_::Proxy_ { 88 class ClientProxyWithStub : public Interface::Client::Proxy_ {
89 public: 89 public:
90 explicit ClientProxyWithStub(MessageReceiver* receiver) 90 explicit ClientProxyWithStub(MessageReceiver* receiver)
91 : Interface::Client_::Proxy_(receiver) { 91 : Interface::Client::Proxy_(receiver) {
92 } 92 }
93 typename Interface::Stub_ stub; 93 typename Interface::Stub_ stub;
94 private: 94 private:
95 MOJO_DISALLOW_COPY_AND_ASSIGN(ClientProxyWithStub); 95 MOJO_DISALLOW_COPY_AND_ASSIGN(ClientProxyWithStub);
96 }; 96 };
97 97
98 Interface* instance_; 98 Interface* instance_;
99 typename Interface::Client_* client_; 99 typename Interface::Client* client_;
100 Router* router_; 100 Router* router_;
101 101
102 MOJO_DISALLOW_COPY_AND_ASSIGN(InterfacePtrState); 102 MOJO_DISALLOW_COPY_AND_ASSIGN(InterfacePtrState);
103 }; 103 };
104 104
105 } // namespace internal 105 } // namespace internal
106 } // namespace mojo 106 } // namespace mojo
107 107
108 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_ 108 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_PTR_INTERNAL_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/interface_impl_internal.h ('k') | mojo/public/cpp/bindings/no_interface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698