Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Side by Side Diff: ui/surface/transport_dib.h

Issue 2849633002: Get rid of base::SharedMemory::NULLHandle(); (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/gfx/gpu_memory_buffer.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « ui/gfx/gpu_memory_buffer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698