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
3 // found in the LICENSE file.
5 #ifndef MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_H_
6 #define MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_H_
10 #include "mojo/public/system/core.h"
16 struct MessageHeader {
20 MOJO_COMPILE_ASSERT(sizeof(MessageHeader) == 8, bad_sizeof_MessageHeader);
26 MOJO_COMPILE_ASSERT(sizeof(MessageData) == 9, bad_sizeof_MessageData);
34 MessageData* data; // Heap-allocated.
35 std::vector<Handle> handles;
38 class MessageReceiver {
40 // The receiver may mutate the given message or take ownership of its
41 // |message->data| member by setting it to NULL.
42 virtual bool Accept(Message* message) = 0;
47 #endif // MOJO_PUBLIC_BINDINGS_LIB_MESSAGE_H_