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

Side by Side Diff: mojo/public/cpp/bindings/lib/interface_id.h

Issue 2100683002: Mojo C++ Bindings: Extract AssociatedGroupController from MultiplexRouter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: oops more gyp ugh Created 4 years, 5 months 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_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_ID_H_
6 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_ID_H_
7
8 #include <stdint.h>
9
10 namespace mojo {
11 namespace internal {
12
13 // The size of the type matters because it is directly used in messages.
14 using InterfaceId = uint32_t;
15
16 // IDs of associated interface can be generated at both sides of the message
17 // pipe. In order to avoid collision, the highest bit is used as namespace bit:
18 // at the side where the client-side of the master interface lives, IDs are
19 // generated with the namespace bit set to 1; at the opposite side IDs are
20 // generated with the namespace bit set to 0.
21 const uint32_t kInterfaceIdNamespaceMask = 0x80000000;
22
23 const InterfaceId kMasterInterfaceId = 0x00000000;
24 const InterfaceId kInvalidInterfaceId = 0xFFFFFFFF;
25
26 inline bool IsMasterInterfaceId(InterfaceId id) {
27 return id == kMasterInterfaceId;
28 }
29
30 inline bool IsValidInterfaceId(InterfaceId id) {
31 return id != kInvalidInterfaceId;
32 }
33
34 } // namespace internal
35 } // namespace mojo
36
37 #endif // MOJO_PUBLIC_CPP_BINDINGS_LIB_INTERFACE_ID_H_
OLDNEW
« no previous file with comments | « mojo/public/cpp/bindings/lib/interface_endpoint_controller.h ('k') | mojo/public/cpp/bindings/lib/interface_ptr_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698