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

Unified Diff: ui/surface/transport_dib.h

Issue 13886018: Add a factory and defines for native Linux surfaces. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get {base,ui,aura}_unittests working with native linux surface Created 7 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
Index: ui/surface/transport_dib.h
diff --git a/ui/surface/transport_dib.h b/ui/surface/transport_dib.h
index 535567aec016a3ffffa7a2233d4f035cc19e018c..c07f21ece28991dc8df7abcb17c60f7b3cb4bff1 100644
--- a/ui/surface/transport_dib.h
+++ b/ui/surface/transport_dib.h
@@ -110,6 +110,19 @@ class SURFACE_EXPORT TransportDIB {
static int fake_handle = 10;
return fake_handle++;
}
+#elif defined(USE_NATIVE_SURFACE_LINUX)
+ typedef int Handle;
+ typedef int Id;
+ // Returns a default, invalid handle, that is meant to indicate a missing
+ // Transport DIB.
+ static Handle DefaultHandleValue() { return -1; }
+
+ // Returns a value that is ONLY USEFUL FOR TESTS WHERE IT WON'T BE
+ // ACTUALLY USED AS A REAL HANDLE.
+ static Handle GetFakeHandleForTest() {
+ static int fake_handle = 10;
+ return fake_handle++;
+ }
#else // OS_POSIX
typedef base::SharedMemoryHandle Handle;
// On POSIX, the inode number of the backing file is used as an id.
@@ -198,7 +211,11 @@ class SURFACE_EXPORT TransportDIB {
// Decreases the inflight counter, and deletes the transport DIB if it is
// detached.
void DecreaseInFlightCounter();
+#endif
+#if defined(TOOLKIT_GTK) || \
+ (defined(OS_LINUX) && defined(USE_AURA) && defined(USE_X11)) || \
+ defined(USE_NATIVE_SURFACE_LINUX)
// Deletes this transport DIB and detaches the shared memory once the
// |inflight_counter_| is zero.
void Detach();

Powered by Google App Engine
This is Rietveld 408576698