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

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

Issue 1320783002: Make SharedMemoryHandle a class on windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ipc_global
Patch Set: Rebase. Created 5 years, 2 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/blit_unittest.cc ('k') | ui/surface/transport_dib_win.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"
11 11
12 #if defined(OS_WIN) 12 #if defined(OS_WIN)
13 #include <windows.h> 13 #include <windows.h>
14 #endif 14 #endif
15 15
16 class SkCanvas; 16 class SkCanvas;
17 17
18 // ----------------------------------------------------------------------------- 18 // -----------------------------------------------------------------------------
19 // A TransportDIB is a block of memory that is used to transport pixels 19 // A TransportDIB is a block of memory that is used to transport pixels
20 // between processes: from the renderer process to the browser, and 20 // between processes: from the renderer process to the browser, and
21 // between renderer and plugin processes. 21 // between renderer and plugin processes.
22 // ----------------------------------------------------------------------------- 22 // -----------------------------------------------------------------------------
23 class SURFACE_EXPORT TransportDIB { 23 class SURFACE_EXPORT TransportDIB {
24 public: 24 public:
25 ~TransportDIB(); 25 ~TransportDIB();
26 26
27 // A Handle is the type which can be sent over the wire so that the remote 27 // A Handle is the type which can be sent over the wire so that the remote
28 // side can map the transport DIB. 28 // side can map the transport DIB.
29 #if defined(OS_WIN)
30 typedef HANDLE Handle;
31 #else // OS_POSIX
32 typedef base::SharedMemoryHandle Handle; 29 typedef base::SharedMemoryHandle Handle;
33 #endif
34 30
35 // Returns a default, invalid handle, that is meant to indicate a missing 31 // Returns a default, invalid handle, that is meant to indicate a missing
36 // Transport DIB. 32 // Transport DIB.
37 static Handle DefaultHandleValue() { 33 static Handle DefaultHandleValue() {
38 return base::SharedMemory::NULLHandle(); 34 return base::SharedMemory::NULLHandle();
39 } 35 }
40 36
41 // Create a new TransportDIB, returning NULL on failure. 37 // Create a new TransportDIB, returning NULL on failure.
42 // 38 //
43 // 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
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 91
96 explicit TransportDIB(base::SharedMemoryHandle dib); 92 explicit TransportDIB(base::SharedMemoryHandle dib);
97 base::SharedMemory shared_memory_; 93 base::SharedMemory shared_memory_;
98 uint32 sequence_num_; 94 uint32 sequence_num_;
99 size_t size_; // length, in bytes 95 size_t size_; // length, in bytes
100 96
101 DISALLOW_COPY_AND_ASSIGN(TransportDIB); 97 DISALLOW_COPY_AND_ASSIGN(TransportDIB);
102 }; 98 };
103 99
104 #endif // UI_SURFACE_TRANSPORT_DIB_H_ 100 #endif // UI_SURFACE_TRANSPORT_DIB_H_
OLDNEW
« no previous file with comments | « ui/gfx/blit_unittest.cc ('k') | ui/surface/transport_dib_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698