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

Unified Diff: mojo/edk/system/token_serializer_messages_win.h

Issue 1387963004: Create a broker interface for the new Mojo EDK so that the browser can create and duplicate messa... (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: presubmit whitespace error Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/edk/system/simple_token_serializer_win.cc ('k') | mojo/edk/system/token_serializer_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/system/token_serializer_messages_win.h
diff --git a/mojo/edk/system/token_serializer_messages_win.h b/mojo/edk/system/token_serializer_messages_win.h
new file mode 100644
index 0000000000000000000000000000000000000000..3de4bf4e68696851c585177668743d90e8eb4cb6
--- /dev/null
+++ b/mojo/edk/system/token_serializer_messages_win.h
@@ -0,0 +1,46 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef MOJO_EDK_SYSTEM_TOKEN_SERIALIZER_MESSAGES_WIN_H_
+#define MOJO_EDK_SYSTEM_TOKEN_SERIALIZER_MESSAGES_WIN_H_
+
+#include <stdint.h>
+
+#include "base/compiler_specific.h"
+
+namespace mojo {
+namespace edk {
+
+// This header defines the message format between ChildTokenSerializer and
+// ParentTokenSerializer.
+
+enum MessageId {
+ // The reply is two HANDLEs.
+ CREATE_PLATFORM_CHANNEL_PAIR = 0,
+ // The reply is tokens of the same count of passed in handles.
+ HANDLE_TO_TOKEN,
+ // The reply is handles of the same count of passed in tokens.
+ TOKEN_TO_HANDLE,
+};
+
+// Definitions of the raw bytes sent between ChildTokenSerializer and
+// ParentTokenSerializer.
+
+struct ALIGNAS(4) TokenSerializerMessage {
brucedawson 2015/11/25 20:44:11 What is the purpose of the ALIGNAS(4) directive he
+ uint32_t size;
+ MessageId id;
+ // Data, if any, follows.
+ union {
+ HANDLE handles[1]; // If HANDLE_TO_TOKEN.
+ uint64_t tokens[1]; // If TOKEN_TO_HANDLE.
+ };
+};
+
+const int kTokenSerializerMessageHeaderSize =
+ sizeof(uint32_t) + sizeof(MessageId);
+
+} // namespace edk
+} // namespace mojo
+
+#endif // MOJO_EDK_SYSTEM_TOKEN_SERIALIZER_MESSAGES_WIN_H_
« no previous file with comments | « mojo/edk/system/simple_token_serializer_win.cc ('k') | mojo/edk/system/token_serializer_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698