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

Side by Side Diff: mojo/public/bindings/sample/generated/sample_service.h

Issue 66353002: Mojo: RemotePtr<S> + bindings changes for Peer attribute. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move forward declarations to interface_declaration Created 7 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_GENERATED_BINDINGS_SAMPLE_SERVICE_H_ 5 #ifndef MOJO_GENERATED_BINDINGS_SAMPLE_SERVICE_H_
6 #define MOJO_GENERATED_BINDINGS_SAMPLE_SERVICE_H_ 6 #define MOJO_GENERATED_BINDINGS_SAMPLE_SERVICE_H_
7 7
8 #include "mojo/public/bindings/lib/bindings.h" 8 #include "mojo/public/bindings/lib/bindings.h"
9 #include "mojo/public/bindings/lib/message.h" 9 #include "mojo/public/bindings/lib/message.h"
10 10
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 mojo::internal::StructPointer<Bar> bar_; 99 mojo::internal::StructPointer<Bar> bar_;
100 mojo::internal::ArrayPointer<uint8_t> data_; 100 mojo::internal::ArrayPointer<uint8_t> data_;
101 mojo::internal::ArrayPointer<Bar*> extra_bars_; 101 mojo::internal::ArrayPointer<Bar*> extra_bars_;
102 mojo::internal::StringPointer name_; 102 mojo::internal::StringPointer name_;
103 mojo::internal::ArrayPointer<mojo::Handle> files_; 103 mojo::internal::ArrayPointer<mojo::Handle> files_;
104 }; 104 };
105 MOJO_COMPILE_ASSERT(sizeof(Foo) == 64, bad_sizeof_Foo); 105 MOJO_COMPILE_ASSERT(sizeof(Foo) == 64, bad_sizeof_Foo);
106 106
107 #pragma pack(pop) 107 #pragma pack(pop)
108 108
109 class Service;
110 class ServiceProxy;
111 class ServiceStub;
112
113 class ServiceClient;
114 class ServiceClientProxy;
115 class ServiceClientStub;
116
109 class Service { 117 class Service {
110 public: 118 public:
119 typedef ServiceProxy _ProxyType;
DaveMoore 2013/11/11 18:49:05 Why bother with the "Type" part? Could it just be
120 typedef ServiceStub _StubType;
121 typedef ServiceClient _PeerType;
122
111 virtual void Frobinate(const Foo* foo, bool baz, mojo::Handle port) = 0; 123 virtual void Frobinate(const Foo* foo, bool baz, mojo::Handle port) = 0;
112 }; 124 };
113 125
126 class ServiceClient {
127 public:
128 typedef ServiceClientProxy _ProxyType;
129 typedef ServiceClientStub _StubType;
130 typedef Service _PeerType;
131
132 virtual void DidFrobinate(int32_t result) = 0;
133 };
134
114 class ServiceProxy : public Service { 135 class ServiceProxy : public Service {
115 public: 136 public:
116 explicit ServiceProxy(mojo::MessageReceiver* receiver); 137 explicit ServiceProxy(mojo::MessageReceiver* receiver);
117 138
118 virtual void Frobinate(const Foo* Foo, bool baz, mojo::Handle port) 139 virtual void Frobinate(const Foo* Foo, bool baz, mojo::Handle port)
119 MOJO_OVERRIDE; 140 MOJO_OVERRIDE;
120 141
121 private: 142 private:
122 mojo::MessageReceiver* receiver_; 143 mojo::MessageReceiver* receiver_;
123 }; 144 };
124 145
146 class ServiceClientProxy : public ServiceClient {
147 public:
148 explicit ServiceClientProxy(mojo::MessageReceiver* receiver);
149
150 virtual void DidFrobinate(int32_t result) MOJO_OVERRIDE;
151
152 private:
153 mojo::MessageReceiver* receiver_;
154 };
155
125 class ServiceStub : public Service, public mojo::MessageReceiver { 156 class ServiceStub : public Service, public mojo::MessageReceiver {
126 public: 157 public:
127 virtual bool Accept(mojo::Message* message) MOJO_OVERRIDE; 158 virtual bool Accept(mojo::Message* message) MOJO_OVERRIDE;
128 }; 159 };
129 160
161 class ServiceClientStub : public ServiceClient, public mojo::MessageReceiver {
162 public:
163 virtual bool Accept(mojo::Message* message) MOJO_OVERRIDE;
164 };
165
130 } // namespace sample 166 } // namespace sample
131 167
132 #endif // MOJO_GENERATED_BINDINGS_SAMPLE_SERVICE_H_ 168 #endif // MOJO_GENERATED_BINDINGS_SAMPLE_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698