Chromium Code Reviews| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 class SURFACE_EXPORT TransportDIB { | 29 class SURFACE_EXPORT TransportDIB { |
| 30 public: | 30 public: |
| 31 ~TransportDIB(); | 31 ~TransportDIB(); |
| 32 | 32 |
| 33 // A Handle is the type which can be sent over the wire so that the remote | 33 // A Handle is the type which can be sent over the wire so that the remote |
| 34 // side can map the transport DIB. | 34 // side can map the transport DIB. |
| 35 typedef base::SharedMemoryHandle Handle; | 35 typedef base::SharedMemoryHandle Handle; |
| 36 | 36 |
| 37 // Returns a default, invalid handle, that is meant to indicate a missing | 37 // Returns a default, invalid handle, that is meant to indicate a missing |
| 38 // Transport DIB. | 38 // Transport DIB. |
| 39 static Handle DefaultHandleValue() { | 39 static Handle DefaultHandleValue() { return base::SharedMemoryHandle(); } |
|
Nico
2017/04/27 19:54:30
Guess this can go too.
| |
| 40 return base::SharedMemory::NULLHandle(); | |
| 41 } | |
| 42 | 40 |
| 43 // Create a new TransportDIB, returning NULL on failure. | 41 // Create a new TransportDIB, returning NULL on failure. |
| 44 // | 42 // |
| 45 // The size is the minimum size in bytes of the memory backing the transport | 43 // The size is the minimum size in bytes of the memory backing the transport |
| 46 // DIB (we may actually allocate more than that to give us better reuse when | 44 // DIB (we may actually allocate more than that to give us better reuse when |
| 47 // cached). | 45 // cached). |
| 48 // | 46 // |
| 49 // The sequence number is used to uniquely identify the transport DIB. It | 47 // The sequence number is used to uniquely identify the transport DIB. It |
| 50 // should be unique for all transport DIBs ever created in the same | 48 // should be unique for all transport DIBs ever created in the same |
| 51 // renderer. | 49 // renderer. |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 98 | 96 |
| 99 explicit TransportDIB(base::SharedMemoryHandle dib); | 97 explicit TransportDIB(base::SharedMemoryHandle dib); |
| 100 base::SharedMemory shared_memory_; | 98 base::SharedMemory shared_memory_; |
| 101 uint32_t sequence_num_; | 99 uint32_t sequence_num_; |
| 102 size_t size_; // length, in bytes | 100 size_t size_; // length, in bytes |
| 103 | 101 |
| 104 DISALLOW_COPY_AND_ASSIGN(TransportDIB); | 102 DISALLOW_COPY_AND_ASSIGN(TransportDIB); |
| 105 }; | 103 }; |
| 106 | 104 |
| 107 #endif // UI_SURFACE_TRANSPORT_DIB_H_ | 105 #endif // UI_SURFACE_TRANSPORT_DIB_H_ |
| OLD | NEW |