Commit 3ffc2457 authored by Lei Zhang's avatar Lei Zhang Committed by Commit Bot

Simplify base/BUILD.gn rules for shared_memory_* files.

base/memory/shared_memory_posix.cc was especially confusing because on
iOS it was removed and then re-added to the sources list.

Change-Id: I689911144a6116e1129b2ecb5e9b90db791a7e8f
Reviewed-on: https://chromium-review.googlesource.com/794450Reviewed-by: default avatarDirk Pranke <dpranke@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520207}
parent f21132bb
......@@ -516,20 +516,12 @@ jumbo_component("base") {
"memory/scoped_policy.h",
"memory/scoped_refptr.h",
"memory/shared_memory.h",
"memory/shared_memory_android.cc",
"memory/shared_memory_handle.cc",
"memory/shared_memory_handle.h",
"memory/shared_memory_handle_android.cc",
"memory/shared_memory_handle_mac.cc",
"memory/shared_memory_handle_win.cc",
"memory/shared_memory_helper.cc",
"memory/shared_memory_helper.h",
"memory/shared_memory_mac.cc",
"memory/shared_memory_nacl.cc",
"memory/shared_memory_posix.cc",
"memory/shared_memory_tracker.cc",
"memory/shared_memory_tracker.h",
"memory/shared_memory_win.cc",
"memory/singleton.cc",
"memory/singleton.h",
"memory/weak_ptr.cc",
......@@ -1131,12 +1123,6 @@ jumbo_component("base") {
}
}
# MacOS and Android have their own custom shared memory implementations due
# to supporting both POSIX and native handles.
if (is_posix && !is_mac && !is_android) {
sources += [ "memory/shared_memory_handle_posix.cc" ]
}
all_dependent_configs = []
defines = []
data = []
......@@ -1218,6 +1204,10 @@ jumbo_component("base") {
# Android.
if (is_android) {
sources -= [ "debug/stack_trace_posix.cc" ]
sources += [
"memory/shared_memory_android.cc",
"memory/shared_memory_handle_android.cc",
]
# Android uses some Linux sources, put those back.
set_sources_assignment_filter([])
......@@ -1258,8 +1248,6 @@ jumbo_component("base") {
# below, rather than using the generic POSIX or Linux-y ones.
sources -= [
"debug/stack_trace_posix.cc",
"memory/shared_memory_handle_posix.cc",
"memory/shared_memory_posix.cc",
"message_loop/message_pump_libevent.cc",
"message_loop/message_pump_libevent.h",
"posix/unix_domain_socket.cc",
......@@ -1309,6 +1297,7 @@ jumbo_component("base") {
set_sources_assignment_filter([])
sources += [
"files/file_path_watcher_stub.cc",
"memory/shared_memory_nacl.cc",
"process/process_metrics_nacl.cc",
"sync_socket_nacl.cc",
"threading/platform_thread_linux.cc",
......@@ -1335,7 +1324,6 @@ jumbo_component("base") {
"memory/discardable_shared_memory.h",
"memory/shared_memory_helper.cc",
"memory/shared_memory_helper.h",
"memory/shared_memory_posix.cc",
"native_library.cc",
"native_library_posix.cc",
"path_service.cc",
......@@ -1389,7 +1377,6 @@ jumbo_component("base") {
} else {
# Remove NaCl stuff.
sources -= [
"memory/shared_memory_nacl.cc",
"os_compat_nacl.cc",
"os_compat_nacl.h",
"rand_util_nacl.cc",
......@@ -1415,6 +1402,8 @@ jumbo_component("base") {
# Windows.
if (is_win) {
sources += [
"memory/shared_memory_handle_win.cc",
"memory/shared_memory_win.cc",
"power_monitor/power_monitor_device_source_win.cc",
"profiler/win32_stack_frame_unwinder.cc",
"profiler/win32_stack_frame_unwinder.h",
......@@ -1530,8 +1519,11 @@ jumbo_component("base") {
# Desktop Mac.
if (is_mac) {
sources -= [ "profiler/native_stack_sampler_posix.cc" ]
sources += [
"mac/scoped_typeref.h",
"memory/shared_memory_handle_mac.cc",
"memory/shared_memory_mac.cc",
"power_monitor/power_monitor_device_source_mac.mm",
"time/time_conversion_posix.cc",
"time/time_exploded_posix.cc",
......@@ -1551,17 +1543,12 @@ jumbo_component("base") {
# Mac or iOS.
if (is_mac || is_ios) {
sources -= [
"memory/shared_memory_posix.cc",
"native_library_posix.cc",
"strings/sys_string_conversions_posix.cc",
"synchronization/waitable_event_posix.cc",
"synchronization/waitable_event_watcher_posix.cc",
"threading/platform_thread_internal_posix.cc",
]
if (is_mac) {
sources -= [ "profiler/native_stack_sampler_posix.cc" ]
}
} else {
# Non-Mac/ios.
sources -= [
......@@ -1670,7 +1657,6 @@ jumbo_component("base") {
"mac/scoped_objc_class_swizzler.h",
"mac/scoped_objc_class_swizzler.mm",
"mac/scoped_typeref.h",
"memory/shared_memory_posix.cc",
"message_loop/message_pump_mac.h",
"message_loop/message_pump_mac.mm",
"power_monitor/power_monitor_device_source_ios.mm",
......@@ -1685,6 +1671,16 @@ jumbo_component("base") {
set_sources_assignment_filter(sources_assignment_filter)
}
# Android, Fuchsia, and MacOS have their own custom shared memory handle
# implementations. e.g. due to supporting both POSIX and native handles.
if (is_posix && !is_android && !is_fuchsia && !is_mac) {
sources += [ "memory/shared_memory_handle_posix.cc" ]
}
if (is_posix && !is_fuchsia && !is_mac && !is_nacl) {
sources += [ "memory/shared_memory_posix.cc" ]
}
if (is_posix && !is_fuchsia && !is_mac && !is_ios) {
sources += [
"time/time_conversion_posix.cc",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment