OLD | NEW |
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_NO_INTERFACE_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_NO_INTERFACE_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_NO_INTERFACE_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_NO_INTERFACE_H_ |
7 | 7 |
8 #include <assert.h> | 8 #include <assert.h> |
9 | 9 |
10 #include "mojo/public/cpp/bindings/message.h" | 10 #include "mojo/public/cpp/bindings/message.h" |
| 11 #include "mojo/public/cpp/bindings/message_filter.h" |
11 #include "mojo/public/cpp/system/core.h" | 12 #include "mojo/public/cpp/system/core.h" |
12 | 13 |
13 namespace mojo { | 14 namespace mojo { |
14 | 15 |
15 // NoInterface is for use in cases when a non-existent or empty interface is | 16 // NoInterface is for use in cases when a non-existent or empty interface is |
16 // needed (e.g., when the Mojom "Peer" attribute is not present). | 17 // needed (e.g., when the Mojom "Peer" attribute is not present). |
17 | 18 |
18 class NoInterfaceProxy; | 19 class NoInterfaceProxy; |
19 class NoInterfaceStub; | 20 class NoInterfaceStub; |
20 | 21 |
21 class NoInterface { | 22 class NoInterface { |
22 public: | 23 public: |
23 typedef NoInterfaceProxy Proxy_; | 24 typedef NoInterfaceProxy Proxy_; |
24 typedef NoInterfaceStub Stub_; | 25 typedef NoInterfaceStub Stub_; |
| 26 typedef PassThroughFilter RequestValidator_; |
| 27 typedef PassThroughFilter ResponseValidator_; |
25 typedef NoInterface Client; | 28 typedef NoInterface Client; |
26 virtual ~NoInterface() {} | 29 virtual ~NoInterface() {} |
27 virtual void SetClient(NoInterface* client) {} | 30 virtual void SetClient(NoInterface* client) {} |
28 }; | 31 }; |
29 | 32 |
30 class NoInterfaceProxy : public NoInterface { | 33 class NoInterfaceProxy : public NoInterface { |
31 public: | 34 public: |
32 explicit NoInterfaceProxy(MessageReceiver* receiver) {} | 35 explicit NoInterfaceProxy(MessageReceiver* receiver) {} |
33 }; | 36 }; |
34 | 37 |
35 class NoInterfaceStub : public MessageReceiver { | 38 class NoInterfaceStub : public MessageReceiver { |
36 public: | 39 public: |
37 NoInterfaceStub() {} | 40 NoInterfaceStub() {} |
38 void set_sink(NoInterface* sink) {} | 41 void set_sink(NoInterface* sink) {} |
39 virtual bool Accept(Message* message) MOJO_OVERRIDE; | 42 virtual bool Accept(Message* message) MOJO_OVERRIDE; |
40 virtual bool AcceptWithResponder(Message* message, MessageReceiver* responder) | 43 virtual bool AcceptWithResponder(Message* message, MessageReceiver* responder) |
41 MOJO_OVERRIDE; | 44 MOJO_OVERRIDE; |
42 }; | 45 }; |
43 | 46 |
44 | 47 |
45 // AnyInterface is for use in cases where any interface would do (e.g., see the | 48 // AnyInterface is for use in cases where any interface would do (e.g., see the |
46 // Shell::Connect method). | 49 // Shell::Connect method). |
47 | 50 |
48 typedef NoInterface AnyInterface; | 51 typedef NoInterface AnyInterface; |
49 | 52 |
50 } // namespace mojo | 53 } // namespace mojo |
51 | 54 |
52 #endif // MOJO_PUBLIC_CPP_BINDINGS_NO_INTERFACE_H_ | 55 #endif // MOJO_PUBLIC_CPP_BINDINGS_NO_INTERFACE_H_ |
OLD | NEW |