Teach PPAPI proxy to share image memory on Mac OS X

Instead of just using base::SharedMemory, we use SysV shared memory on Linux so
that we can share memory with X.  Normally we abstract this detail away with
TransportDIB, but the TransportDIB lives in chrome/app, which is outside the
dependency cone of ppapi/proxy.

This patch creates a new abstraction at this layer of the dependency graph
called ImageData::ImageHandle that represents shared memory for the purpose of
image data.  This patch also fills in the implementation of this abstraction on
Mac OS X.  Consequently, out-of-process PPAPI plugins on Mac can now draw to
the screen.

Review URL: http://codereview.chromium.org/5658003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68569 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ppapi/proxy/serialized_structs.h b/ppapi/proxy/serialized_structs.h
index d90926b..2c78dd4 100644
--- a/ppapi/proxy/serialized_structs.h
+++ b/ppapi/proxy/serialized_structs.h
@@ -8,6 +8,8 @@
 #include <string>
 #include <vector>
 
+#include "base/shared_memory.h"
+#include "build/build_config.h"
 #include "ppapi/c/pp_bool.h"
 #include "ppapi/c/pp_point.h"
 #include "ppapi/c/pp_rect.h"
@@ -96,9 +98,16 @@
   std::vector<PP_Point> glyph_advances;
 };
 
+#if defined(OS_WIN)
+typedef HANDLE ImageHandle;
+#elif defined(OS_MACOSX)
+typedef base::SharedMemoryHandle ImageHandle;
+#else
+// On X Windows this is a SysV shared memory key.
+typedef int ImageHandle;
+#endif
+
 }  // namespace proxy
 }  // namespace pp
 
-
-
 #endif  // PPAPI_PROXY_SERIALIZED_STRUCTS_H_