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

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

Issue 1145893009: Change transport dib API to not make copies of SharedMemoryHandle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shared_memory_pepper_rename
Patch Set: Comments from jbauman. Created 5 years, 6 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 | « ppapi/thunk/ppb_image_data_api.h ('k') | ui/surface/transport_dib.cc » ('j') | 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 "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "ui/surface/surface_export.h" 10 #include "ui/surface/surface_export.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 128
129 // Return the maximum size of the shared memory. This is not the amount of 129 // Return the maximum size of the shared memory. This is not the amount of
130 // data which is valid, you have to know that via other means, this is simply 130 // data which is valid, you have to know that via other means, this is simply
131 // the maximum amount that /could/ be valid. 131 // the maximum amount that /could/ be valid.
132 size_t size() const { return size_; } 132 size_t size() const { return size_; }
133 133
134 // Return the identifier which can be used to refer to this shared memory 134 // Return the identifier which can be used to refer to this shared memory
135 // on the wire. 135 // on the wire.
136 Id id() const; 136 Id id() const;
137 137
138 // Return a handle to the underlying shared memory. This can be sent over the 138 // Returns a pointer to the SharedMemory object that backs the transport dib.
139 // wire to give this transport DIB to another process. 139 base::SharedMemory* shared_memory();
140 Handle handle() const;
141 140
142 private: 141 private:
143 TransportDIB(); 142 TransportDIB();
144 143
145 // Verifies that the dib can hold a canvas of the requested dimensions. 144 // Verifies that the dib can hold a canvas of the requested dimensions.
146 bool VerifyCanvasSize(int w, int h); 145 bool VerifyCanvasSize(int w, int h);
147 146
148 explicit TransportDIB(base::SharedMemoryHandle dib); 147 explicit TransportDIB(base::SharedMemoryHandle dib);
149 base::SharedMemory shared_memory_; 148 base::SharedMemory shared_memory_;
150 uint32 sequence_num_; 149 uint32 sequence_num_;
151 size_t size_; // length, in bytes 150 size_t size_; // length, in bytes
152 151
153 DISALLOW_COPY_AND_ASSIGN(TransportDIB); 152 DISALLOW_COPY_AND_ASSIGN(TransportDIB);
154 }; 153 };
155 154
156 #endif // UI_SURFACE_TRANSPORT_DIB_H_ 155 #endif // UI_SURFACE_TRANSPORT_DIB_H_
OLDNEW
« no previous file with comments | « ppapi/thunk/ppb_image_data_api.h ('k') | ui/surface/transport_dib.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698