Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Build shared_memory_mac.cc and shared_memory_handle_mac.cc for iOS
Browse files Browse the repository at this point in the history
media::VideoFrame has new constructors that use SharedMemory and
SharedMemoryHandle. This patch enables building the Mac implementations
to support building //media/cast/sender on iOS.

BUG=528408

Review URL: https://codereview.chromium.org/1328963002

Cr-Commit-Position: refs/heads/master@{#347569}
  • Loading branch information
jfroy authored and Commit bot committed Sep 5, 2015
1 parent a269fca commit cc7516e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 2 additions & 0 deletions base/base.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,8 @@
['include', '^mac/scoped_nsautorelease_pool\\.'],
['include', '^mac/scoped_nsobject\\.'],
['include', '^mac/scoped_objc_class_swizzler\\.'],
['include', '^memory/shared_memory_handle_mac\\.'],
['include', '^memory/shared_memory_mac\\.'],
['include', '^message_loop/message_pump_mac\\.'],
['include', '^strings/sys_string_conversions_mac\\.'],
['include', '^threading/platform_thread_mac\\.'],
Expand Down
9 changes: 9 additions & 0 deletions base/memory/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,15 @@ source_set("memory") {
sources -= [ "shared_memory_posix.cc" ]
}

if (is_ios) {
set_sources_assignment_filter([])
sources += [
"shared_memory_handle_mac.cc",
"shared_memory_mac.cc",
]
set_sources_assignment_filter(sources_assignment_filter)
}

if (is_android) {
deps = [
"//third_party/ashmem",
Expand Down
4 changes: 2 additions & 2 deletions base/memory/shared_memory_handle.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#if defined(OS_WIN)
#include <windows.h>
#elif defined(OS_MACOSX) && !defined(OS_IOS)
#elif defined(OS_MACOSX)
#include <sys/types.h>
#include "base/base_export.h"
#include "base/file_descriptor_posix.h"
Expand All @@ -27,7 +27,7 @@ class Pickle;
// the underlying OS handle to a shared memory segment.
#if defined(OS_WIN)
typedef HANDLE SharedMemoryHandle;
#elif defined(OS_POSIX) && !(defined(OS_MACOSX) && !defined(OS_IOS))
#elif defined(OS_POSIX) && !defined(OS_MACOSX)
typedef FileDescriptor SharedMemoryHandle;
#else
class BASE_EXPORT SharedMemoryHandle {
Expand Down
2 changes: 0 additions & 2 deletions base/memory/shared_memory_handle_mac.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

#include "base/posix/eintr_wrapper.h"

#if defined(OS_MACOSX) && !defined(OS_IOS)
namespace base {

static_assert(sizeof(SharedMemoryHandle::Type) <=
Expand Down Expand Up @@ -87,4 +86,3 @@ SharedMemoryHandle SharedMemoryHandle::Duplicate() const {
}

} // namespace base
#endif // defined(OS_MACOSX) && !defined(OS_IOS)

0 comments on commit cc7516e

Please sign in to comment.