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

Side by Side Diff: mojo/edk/system/token_serializer_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 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MOJO_EDK_SYSTEM_TOKEN_SERIALIZER_WIN_H_
6 #define MOJO_EDK_SYSTEM_TOKEN_SERIALIZER_WIN_H_
7
8 #include <stdint.h>
9 #include <vector>
10
11 #include "mojo/edk/embedder/scoped_platform_handle.h"
12
13 namespace mojo {
14 namespace edk {
15
16 // An interface for serializing a Mojo handle to memory. A child process will
17 // have to make sync calls to the parent process. It is safe to call from any
18 // thread.
19 class MOJO_SYSTEM_IMPL_EXPORT TokenSerializer {
20 public:
21 virtual ~TokenSerializer() {}
22
23 // Create a PlatformChannelPair.
24 virtual void CreatePlatformChannelPair(ScopedPlatformHandle* server,
25 ScopedPlatformHandle* client) = 0;
26
27 // Converts the given platform handles to tokens.
28 // |tokens| should point to memory that is sizeof(uint64_t) * count;
29 virtual void HandleToToken(const PlatformHandle* platform_handles,
30 size_t count,
31 uint64_t* tokens) = 0;
32
33 // Converts the given tokens to platformhandles.
34 // |handles| should point to memory that is sizeof(HANDLE) * count;
35 virtual void TokenToHandle(const uint64_t* tokens,
36 size_t count,
37 PlatformHandle* handles) = 0;
38 };
39
40 } // namespace edk
41 } // namespace mojo
42
43 #endif // MOJO_EDK_SYSTEM_TOKEN_SERIALIZER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698