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

Unified Diff: ppapi/proxy/proxy_channel.h

Issue 8585013: Merge definitions of PlatformFileToInt and IntToPlatformFile to one place. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 9 years, 1 month 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 | « ppapi/proxy/ppb_broker_proxy.cc ('k') | webkit/plugins/ppapi/ppb_broker_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/proxy_channel.h
diff --git a/ppapi/proxy/proxy_channel.h b/ppapi/proxy/proxy_channel.h
index 0a1fb0305a6509f6fec68e807a401fd3cc2facdf..9ca3fdaf5670ccabc050ae7797d2afe3f8f87891 100644
--- a/ppapi/proxy/proxy_channel.h
+++ b/ppapi/proxy/proxy_channel.h
@@ -24,6 +24,28 @@ class TestSink;
namespace ppapi {
namespace proxy {
+// TODO(piman/brettw): Change trusted interface to return a PP_FileHandle,
+// those casts are ugly.
+inline base::PlatformFile IntToPlatformFile(int32_t handle) {
+#if defined(OS_WIN)
+ return reinterpret_cast<HANDLE>(static_cast<intptr_t>(handle));
+#elif defined(OS_POSIX)
+ return handle;
+#else
+ #error Not implemented.
+#endif
+}
+
+inline int32_t PlatformFileToInt(base::PlatformFile handle) {
+#if defined(OS_WIN)
+ return static_cast<int32_t>(reinterpret_cast<intptr_t>(handle));
+#elif defined(OS_POSIX)
+ return handle;
+#else
+ #error Not implemented.
+#endif
+}
piman 2011/11/22 20:20:36 I'm not sure these functions belong to this file..
xhwang 2011/11/22 23:22:58 As discussed offline, these functions will stay in
+
class PPAPI_PROXY_EXPORT ProxyChannel
: public IPC::Channel::Listener,
public IPC::Message::Sender {
« no previous file with comments | « ppapi/proxy/ppb_broker_proxy.cc ('k') | webkit/plugins/ppapi/ppb_broker_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698