Chromium Code Reviews| 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 { |