diff options
author | lionel.g.landwerlin <lionel.g.landwerlin@intel.com> | 2015-03-06 07:43:46 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-06 15:44:39 +0000 |
commit | 58344bb00df4201fd99734ae77b037351eba70ca (patch) | |
tree | b1621378418b19c9de305b8ce2961cd05f32ed2c /content/common/pepper_file_util.cc | |
parent | f4e514de66bc88423b42ccbde1b7f25a5d46b2d9 (diff) | |
download | chromium_src-58344bb00df4201fd99734ae77b037351eba70ca.zip chromium_src-58344bb00df4201fd99734ae77b037351eba70ca.tar.gz chromium_src-58344bb00df4201fd99734ae77b037351eba70ca.tar.bz2 |
content: pepper: factorize file descriptor access
BUG=none
TEST=try bots
Review URL: https://codereview.chromium.org/981463004
Cr-Commit-Position: refs/heads/master@{#319449}
Diffstat (limited to 'content/common/pepper_file_util.cc')
-rw-r--r-- | content/common/pepper_file_util.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/content/common/pepper_file_util.cc b/content/common/pepper_file_util.cc index fea5ef2..be253c1 100644 --- a/content/common/pepper_file_util.cc +++ b/content/common/pepper_file_util.cc @@ -20,4 +20,26 @@ storage::FileSystemType PepperFileSystemTypeToFileSystemType( } } +base::PlatformFile PlatformFileFromSharedMemoryHandle( + const base::SharedMemoryHandle& shm_handle) { +#if defined(OS_WIN) + return shm_handle; +#elif defined(OS_POSIX) + return shm_handle.fd; +#else +#error Platform not supported. +#endif +} + +int IntegerFromSyncSocketHandle( + const base::SyncSocket::Handle& socket_handle) { +#if defined(OS_WIN) + return reinterpret_cast<int>(socket_handle); +#elif defined(OS_POSIX) + return socket_handle; +#else +#error Platform not supported. +#endif +} + } // namespace content |