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

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

Issue 2849633002: Get rid of base::SharedMemory::NULLHandle(); (Closed)
Patch Set: Rebase. 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 16 matching lines...) Expand all
27 // between renderer and plugin processes. 27 // between renderer and plugin processes.
28 // ----------------------------------------------------------------------------- 28 // -----------------------------------------------------------------------------
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
38 // Transport DIB.
39 static Handle DefaultHandleValue() {
40 return base::SharedMemory::NULLHandle();
41 }
42
43 // Create a new TransportDIB, returning NULL on failure. 37 // Create a new TransportDIB, returning NULL on failure.
44 // 38 //
45 // The size is the minimum size in bytes of the memory backing the transport 39 // 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 40 // DIB (we may actually allocate more than that to give us better reuse when
47 // cached). 41 // cached).
48 // 42 //
49 // The sequence number is used to uniquely identify the transport DIB. It 43 // 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 44 // should be unique for all transport DIBs ever created in the same
51 // renderer. 45 // renderer.
52 static TransportDIB* Create(size_t size, uint32_t sequence_num); 46 static TransportDIB* Create(size_t size, uint32_t sequence_num);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 92
99 explicit TransportDIB(base::SharedMemoryHandle dib); 93 explicit TransportDIB(base::SharedMemoryHandle dib);
100 base::SharedMemory shared_memory_; 94 base::SharedMemory shared_memory_;
101 uint32_t sequence_num_; 95 uint32_t sequence_num_;
102 size_t size_; // length, in bytes 96 size_t size_; // length, in bytes
103 97
104 DISALLOW_COPY_AND_ASSIGN(TransportDIB); 98 DISALLOW_COPY_AND_ASSIGN(TransportDIB);
105 }; 99 };
106 100
107 #endif // UI_SURFACE_TRANSPORT_DIB_H_ 101 #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