OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_SURFACE_TRANSPORT_DIB_H_ | 5 #ifndef UI_SURFACE_TRANSPORT_DIB_H_ |
6 #define UI_SURFACE_TRANSPORT_DIB_H_ | 6 #define UI_SURFACE_TRANSPORT_DIB_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ui/surface/surface_export.h" | 9 #include "ui/surface/surface_export.h" |
10 | 10 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 typedef int Handle; // These two ints are SysV IPC shared memory keys | 99 typedef int Handle; // These two ints are SysV IPC shared memory keys |
100 struct Id { | 100 struct Id { |
101 // Ensure that default initialized Ids are invalid. | 101 // Ensure that default initialized Ids are invalid. |
102 Id() : shmkey(-1) { | 102 Id() : shmkey(-1) { |
103 } | 103 } |
104 | 104 |
105 bool operator<(const Id& other) const { | 105 bool operator<(const Id& other) const { |
106 return shmkey < other.shmkey; | 106 return shmkey < other.shmkey; |
107 } | 107 } |
108 | 108 |
| 109 bool operator==(const Id& other) const { |
| 110 return shmkey == other.shmkey; |
| 111 } |
| 112 |
109 int shmkey; | 113 int shmkey; |
110 }; | 114 }; |
111 | 115 |
112 // Returns a default, invalid handle, that is meant to indicate a missing | 116 // Returns a default, invalid handle, that is meant to indicate a missing |
113 // Transport DIB. | 117 // Transport DIB. |
114 static Handle DefaultHandleValue() { return -1; } | 118 static Handle DefaultHandleValue() { return -1; } |
115 | 119 |
116 // Returns a value that is ONLY USEFUL FOR TESTS WHERE IT WON'T BE | 120 // Returns a value that is ONLY USEFUL FOR TESTS WHERE IT WON'T BE |
117 // ACTUALLY USED AS A REAL HANDLE. | 121 // ACTUALLY USED AS A REAL HANDLE. |
118 static Handle GetFakeHandleForTest() { | 122 static Handle GetFakeHandleForTest() { |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 Display* display_; // connection to the X server | 228 Display* display_; // connection to the X server |
225 size_t inflight_counter_; // How many requests to the X server are in flight | 229 size_t inflight_counter_; // How many requests to the X server are in flight |
226 bool detached_; // If true, delete the transport DIB when it is idle | 230 bool detached_; // If true, delete the transport DIB when it is idle |
227 #endif | 231 #endif |
228 size_t size_; // length, in bytes | 232 size_t size_; // length, in bytes |
229 | 233 |
230 DISALLOW_COPY_AND_ASSIGN(TransportDIB); | 234 DISALLOW_COPY_AND_ASSIGN(TransportDIB); |
231 }; | 235 }; |
232 | 236 |
233 #endif // UI_SURFACE_TRANSPORT_DIB_H_ | 237 #endif // UI_SURFACE_TRANSPORT_DIB_H_ |
OLD | NEW |