OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SERVICES_VIEW_MANAGER_IDS_H_ | 5 #ifndef MOJO_SERVICES_VIEW_MANAGER_IDS_H_ |
6 #define MOJO_SERVICES_VIEW_MANAGER_IDS_H_ | 6 #define MOJO_SERVICES_VIEW_MANAGER_IDS_H_ |
7 | 7 |
8 #include "mojo/services/view_manager/view_manager_export.h" | 8 #include "mojo/services/view_manager/view_manager_export.h" |
9 | 9 |
10 namespace mojo { | 10 namespace mojo { |
11 namespace services { | 11 namespace services { |
12 namespace view_manager { | 12 namespace view_manager { |
13 | 13 |
14 typedef uint32_t ChangeId; | |
15 | |
16 // Adds a bit of type safety to node ids. | 14 // Adds a bit of type safety to node ids. |
17 struct MOJO_VIEW_MANAGER_EXPORT NodeId { | 15 struct MOJO_VIEW_MANAGER_EXPORT NodeId { |
18 NodeId(uint16_t connection_id, uint16_t node_id) | 16 NodeId(uint16_t connection_id, uint16_t node_id) |
19 : connection_id(connection_id), | 17 : connection_id(connection_id), |
20 node_id(node_id) {} | 18 node_id(node_id) {} |
21 NodeId() : connection_id(0), node_id(0) {} | 19 NodeId() : connection_id(0), node_id(0) {} |
22 | 20 |
23 bool operator==(const NodeId& other) const { | 21 bool operator==(const NodeId& other) const { |
24 return other.connection_id == connection_id && | 22 return other.connection_id == connection_id && |
25 other.node_id == node_id; | 23 other.node_id == node_id; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 74 |
77 inline uint32_t ViewIdToTransportId(const ViewId& id) { | 75 inline uint32_t ViewIdToTransportId(const ViewId& id) { |
78 return (id.connection_id << 16) | id.view_id; | 76 return (id.connection_id << 16) | id.view_id; |
79 } | 77 } |
80 | 78 |
81 } // namespace view_manager | 79 } // namespace view_manager |
82 } // namespace services | 80 } // namespace services |
83 } // namespace mojo | 81 } // namespace mojo |
84 | 82 |
85 #endif // MOJO_SERVICES_VIEW_MANAGER_IDS_H_ | 83 #endif // MOJO_SERVICES_VIEW_MANAGER_IDS_H_ |
OLD | NEW |