| 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_PIPE_CONTROL_MESSAGE_HANDLER_H_ | 5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_H_ |
| 6 #define MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_H_ | 6 #define MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "mojo/public/cpp/bindings/bindings_export.h" | 12 #include "mojo/public/cpp/bindings/bindings_export.h" |
| 13 #include "mojo/public/cpp/bindings/interface_id.h" | |
| 14 #include "mojo/public/cpp/bindings/lib/serialization_context.h" | |
| 15 #include "mojo/public/cpp/bindings/message.h" | 13 #include "mojo/public/cpp/bindings/message.h" |
| 16 | 14 |
| 17 namespace mojo { | 15 namespace mojo { |
| 18 | 16 |
| 19 class PipeControlMessageHandlerDelegate; | 17 class PipeControlMessageHandlerDelegate; |
| 20 | 18 |
| 21 // Handler for messages defined in pipe_control_messages.mojom. | 19 // Handler for messages defined in pipe_control_messages.mojom. |
| 22 class MOJO_CPP_BINDINGS_EXPORT PipeControlMessageHandler | 20 class MOJO_CPP_BINDINGS_EXPORT PipeControlMessageHandler |
| 23 : NON_EXPORTED_BASE(public MessageReceiver) { | 21 : NON_EXPORTED_BASE(public MessageReceiver) { |
| 24 public: | 22 public: |
| (...skipping 16 matching lines...) Expand all Loading... |
| 41 // If the method returns false, the message pipe should be closed. | 39 // If the method returns false, the message pipe should be closed. |
| 42 bool Accept(Message* message) override; | 40 bool Accept(Message* message) override; |
| 43 | 41 |
| 44 private: | 42 private: |
| 45 // |message| must have passed message header validation. | 43 // |message| must have passed message header validation. |
| 46 bool Validate(Message* message); | 44 bool Validate(Message* message); |
| 47 bool RunOrClosePipe(Message* message); | 45 bool RunOrClosePipe(Message* message); |
| 48 | 46 |
| 49 std::string description_; | 47 std::string description_; |
| 50 PipeControlMessageHandlerDelegate* const delegate_; | 48 PipeControlMessageHandlerDelegate* const delegate_; |
| 51 internal::SerializationContext context_; | |
| 52 | 49 |
| 53 DISALLOW_COPY_AND_ASSIGN(PipeControlMessageHandler); | 50 DISALLOW_COPY_AND_ASSIGN(PipeControlMessageHandler); |
| 54 }; | 51 }; |
| 55 | 52 |
| 56 } // namespace mojo | 53 } // namespace mojo |
| 57 | 54 |
| 58 #endif // MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_H_ | 55 #endif // MOJO_PUBLIC_CPP_BINDINGS_PIPE_CONTROL_MESSAGE_HANDLER_H_ |
| OLD | NEW |