OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_PIPE_CONTROL_MESSAGE_HANDLER_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_PIPE_CONTROL_MESSAGE_HANDLER_H_ |
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_PIPE_CONTROL_MESSAGE_HANDLER_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_PIPE_CONTROL_MESSAGE_HANDLER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "mojo/public/cpp/bindings/lib/interface_id.h" | 9 #include "mojo/public/cpp/bindings/lib/interface_id.h" |
10 #include "mojo/public/cpp/bindings/lib/serialization_context.h" | 10 #include "mojo/public/cpp/bindings/lib/serialization_context.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 | 24 |
25 // NOTE: |message| must have passed message header validation. | 25 // NOTE: |message| must have passed message header validation. |
26 static bool IsPipeControlMessage(const Message* message); | 26 static bool IsPipeControlMessage(const Message* message); |
27 | 27 |
28 // MessageReceiver implementation: | 28 // MessageReceiver implementation: |
29 | 29 |
30 // NOTE: |message| must: | 30 // NOTE: |message| must: |
31 // - have passed message header validation; and | 31 // - have passed message header validation; and |
32 // - be a pipe control message (i.e., IsPipeControlMessage() returns true). | 32 // - be a pipe control message (i.e., IsPipeControlMessage() returns true). |
33 // If the method returns false, the message pipe should be closed. | 33 // If the method returns false, the message pipe should be closed. |
34 bool Accept(Message* message) override; | 34 bool Accept(Message* message, Error* error) override; |
35 | 35 |
36 private: | 36 private: |
37 // |message| must have passed message header validation. | 37 // |message| must have passed message header validation. |
38 bool Validate(const Message* message); | 38 bool Validate(Message* message, Error* error); |
39 bool RunOrClosePipe(Message* message); | 39 bool RunOrClosePipe(Message* message); |
40 | 40 |
41 PipeControlMessageHandlerDelegate* const delegate_; | 41 PipeControlMessageHandlerDelegate* const delegate_; |
42 SerializationContext context_; | 42 SerializationContext context_; |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(PipeControlMessageHandler); | 44 DISALLOW_COPY_AND_ASSIGN(PipeControlMessageHandler); |
45 }; | 45 }; |
46 | 46 |
47 } // namespace internal | 47 } // namespace internal |
48 } // namespace mojo | 48 } // namespace mojo |
49 | 49 |
50 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_PIPE_CONTROL_MESSAGE_HANDLER_H_ | 50 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_PIPE_CONTROL_MESSAGE_HANDLER_H_ |
OLD | NEW |