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

Unified Diff: ui/surface/transport_dib.h

Issue 232773008: More removal of GTK code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove base/ so I don't need another stamp. Created 6 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/shell_dialogs/select_file_dialog.cc ('k') | ui/surface/transport_dib_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/surface/transport_dib.h
diff --git a/ui/surface/transport_dib.h b/ui/surface/transport_dib.h
index 4a00967d77f03a85e46844873e17a063ce264b63..fa2d13283e12d1883a59eef434888bb01886c61a 100644
--- a/ui/surface/transport_dib.h
+++ b/ui/surface/transport_dib.h
@@ -6,17 +6,11 @@
#define UI_SURFACE_TRANSPORT_DIB_H_
#include "base/basictypes.h"
-#include "ui/surface/surface_export.h"
-
-#if !defined(TOOLKIT_GTK)
#include "base/memory/shared_memory.h"
-#endif
+#include "ui/surface/surface_export.h"
#if defined(OS_WIN)
#include <windows.h>
-#elif defined(TOOLKIT_GTK)
-#include "ui/base/x/x11_util.h"
-#include "ui/gfx/x/x11_types.h"
#endif
class SkCanvas;
@@ -74,27 +68,6 @@ class SURFACE_EXPORT TransportDIB {
// Returns a default, invalid handle, that is meant to indicate a missing
// Transport DIB.
static Handle DefaultHandleValue() { return NULL; }
-#elif defined(TOOLKIT_GTK)
- typedef int Handle; // These two ints are SysV IPC shared memory keys
- struct Id {
- // Ensure that default initialized Ids are invalid.
- Id() : shmkey(-1) {
- }
-
- bool operator<(const Id& other) const {
- return shmkey < other.shmkey;
- }
-
- bool operator==(const Id& other) const {
- return shmkey == other.shmkey;
- }
-
- int shmkey;
- };
-
- // Returns a default, invalid handle, that is meant to indicate a missing
- // Transport DIB.
- static Handle DefaultHandleValue() { return -1; }
#else // OS_POSIX
typedef base::SharedMemoryHandle Handle;
// On POSIX, the inode number of the backing file is used as an id.
@@ -166,39 +139,15 @@ class SURFACE_EXPORT TransportDIB {
// wire to give this transport DIB to another process.
Handle handle() const;
-#if defined(TOOLKIT_GTK)
- // Map the shared memory into the X server and return an id for the shared
- // segment.
- XID MapToX(XDisplay* connection);
-
- void IncreaseInFlightCounter() { inflight_counter_++; }
- // Decreases the inflight counter, and deletes the transport DIB if it is
- // detached.
- void DecreaseInFlightCounter();
-
- // Deletes this transport DIB and detaches the shared memory once the
- // |inflight_counter_| is zero.
- void Detach();
-#endif
-
private:
TransportDIB();
// Verifies that the dib can hold a canvas of the requested dimensions.
bool VerifyCanvasSize(int w, int h);
-#if defined(TOOLKIT_GTK)
- Id key_; // SysV shared memory id
- void* address_; // mapped address
- XSharedMemoryId x_shm_; // X id for the shared segment
- XDisplay* display_; // connection to the X server
- size_t inflight_counter_; // How many requests to the X server are in flight
- bool detached_; // If true, delete the transport DIB when it is idle
-#else
explicit TransportDIB(base::SharedMemoryHandle dib);
base::SharedMemory shared_memory_;
uint32 sequence_num_;
-#endif
size_t size_; // length, in bytes
DISALLOW_COPY_AND_ASSIGN(TransportDIB);
« no previous file with comments | « ui/shell_dialogs/select_file_dialog.cc ('k') | ui/surface/transport_dib_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698