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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 HandleAndSequenceNum() | 47 HandleAndSequenceNum() |
48 : handle(NULL), | 48 : handle(NULL), |
49 sequence_num(0) { | 49 sequence_num(0) { |
50 } | 50 } |
51 | 51 |
52 HandleAndSequenceNum(HANDLE h, uint32 seq_num) | 52 HandleAndSequenceNum(HANDLE h, uint32 seq_num) |
53 : handle(h), | 53 : handle(h), |
54 sequence_num(seq_num) { | 54 sequence_num(seq_num) { |
55 } | 55 } |
56 | 56 |
| 57 bool operator==(const HandleAndSequenceNum& other) const { |
| 58 return other.handle == handle && other.sequence_num == sequence_num; |
| 59 } |
| 60 |
57 bool operator<(const HandleAndSequenceNum& other) const { | 61 bool operator<(const HandleAndSequenceNum& other) const { |
58 // Use the lexicographic order on the tuple <handle, sequence_num>. | 62 // Use the lexicographic order on the tuple <handle, sequence_num>. |
59 if (other.handle != handle) | 63 if (other.handle != handle) |
60 return other.handle < handle; | 64 return other.handle < handle; |
61 return other.sequence_num < sequence_num; | 65 return other.sequence_num < sequence_num; |
62 } | 66 } |
63 | 67 |
64 HANDLE handle; | 68 HANDLE handle; |
65 uint32 sequence_num; | 69 uint32 sequence_num; |
66 }; | 70 }; |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 Display* display_; // connection to the X server | 224 Display* display_; // connection to the X server |
221 size_t inflight_counter_; // How many requests to the X server are in flight | 225 size_t inflight_counter_; // How many requests to the X server are in flight |
222 bool detached_; // If true, delete the transport DIB when it is idle | 226 bool detached_; // If true, delete the transport DIB when it is idle |
223 #endif | 227 #endif |
224 size_t size_; // length, in bytes | 228 size_t size_; // length, in bytes |
225 | 229 |
226 DISALLOW_COPY_AND_ASSIGN(TransportDIB); | 230 DISALLOW_COPY_AND_ASSIGN(TransportDIB); |
227 }; | 231 }; |
228 | 232 |
229 #endif // UI_SURFACE_TRANSPORT_DIB_H_ | 233 #endif // UI_SURFACE_TRANSPORT_DIB_H_ |
OLD | NEW |