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 |
14 // Adds a bit of type safety to node ids. | 16 // Adds a bit of type safety to node ids. |
15 struct MOJO_VIEW_MANAGER_EXPORT NodeId { | 17 struct MOJO_VIEW_MANAGER_EXPORT NodeId { |
16 NodeId(uint16_t connection_id, uint16_t node_id) | 18 NodeId(uint16_t connection_id, uint16_t node_id) |
17 : connection_id(connection_id), | 19 : connection_id(connection_id), |
18 node_id(node_id) {} | 20 node_id(node_id) {} |
19 NodeId() : connection_id(0), node_id(0) {} | 21 NodeId() : connection_id(0), node_id(0) {} |
20 | 22 |
21 bool operator==(const NodeId& other) const { | 23 bool operator==(const NodeId& other) const { |
22 return other.connection_id == connection_id && | 24 return other.connection_id == connection_id && |
23 other.node_id == node_id; | 25 other.node_id == node_id; |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 76 |
75 inline uint32_t ViewIdToTransportId(const ViewId& id) { | 77 inline uint32_t ViewIdToTransportId(const ViewId& id) { |
76 return (id.connection_id << 16) | id.view_id; | 78 return (id.connection_id << 16) | id.view_id; |
77 } | 79 } |
78 | 80 |
79 } // namespace view_manager | 81 } // namespace view_manager |
80 } // namespace services | 82 } // namespace services |
81 } // namespace mojo | 83 } // namespace mojo |
82 | 84 |
83 #endif // MOJO_SERVICES_VIEW_MANAGER_IDS_H_ | 85 #endif // MOJO_SERVICES_VIEW_MANAGER_IDS_H_ |
OLD | NEW |