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") { ...@@ -516,20 +516,12 @@ jumbo_component("base") {
"memory/scoped_policy.h", "memory/scoped_policy.h",
"memory/scoped_refptr.h", "memory/scoped_refptr.h",
"memory/shared_memory.h", "memory/shared_memory.h",
"memory/shared_memory_android.cc",
"memory/shared_memory_handle.cc", "memory/shared_memory_handle.cc",
"memory/shared_memory_handle.h", "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.cc",
"memory/shared_memory_helper.h", "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.cc",
"memory/shared_memory_tracker.h", "memory/shared_memory_tracker.h",
"memory/shared_memory_win.cc",
"memory/singleton.cc", "memory/singleton.cc",
"memory/singleton.h", "memory/singleton.h",
"memory/weak_ptr.cc", "memory/weak_ptr.cc",
...@@ -1131,12 +1123,6 @@ jumbo_component("base") { ...@@ -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 = [] all_dependent_configs = []
defines = [] defines = []
data = [] data = []
...@@ -1218,6 +1204,10 @@ jumbo_component("base") { ...@@ -1218,6 +1204,10 @@ jumbo_component("base") {
# Android. # Android.
if (is_android) { if (is_android) {
sources -= [ "debug/stack_trace_posix.cc" ] 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. # Android uses some Linux sources, put those back.
set_sources_assignment_filter([]) set_sources_assignment_filter([])
...@@ -1258,8 +1248,6 @@ jumbo_component("base") { ...@@ -1258,8 +1248,6 @@ jumbo_component("base") {
# below, rather than using the generic POSIX or Linux-y ones. # below, rather than using the generic POSIX or Linux-y ones.
sources -= [ sources -= [
"debug/stack_trace_posix.cc", "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.cc",
"message_loop/message_pump_libevent.h", "message_loop/message_pump_libevent.h",
"posix/unix_domain_socket.cc", "posix/unix_domain_socket.cc",
...@@ -1309,6 +1297,7 @@ jumbo_component("base") { ...@@ -1309,6 +1297,7 @@ jumbo_component("base") {
set_sources_assignment_filter([]) set_sources_assignment_filter([])
sources += [ sources += [
"files/file_path_watcher_stub.cc", "files/file_path_watcher_stub.cc",
"memory/shared_memory_nacl.cc",
"process/process_metrics_nacl.cc", "process/process_metrics_nacl.cc",
"sync_socket_nacl.cc", "sync_socket_nacl.cc",
"threading/platform_thread_linux.cc", "threading/platform_thread_linux.cc",
...@@ -1335,7 +1324,6 @@ jumbo_component("base") { ...@@ -1335,7 +1324,6 @@ jumbo_component("base") {
"memory/discardable_shared_memory.h", "memory/discardable_shared_memory.h",
"memory/shared_memory_helper.cc", "memory/shared_memory_helper.cc",
"memory/shared_memory_helper.h", "memory/shared_memory_helper.h",
"memory/shared_memory_posix.cc",
"native_library.cc", "native_library.cc",
"native_library_posix.cc", "native_library_posix.cc",
"path_service.cc", "path_service.cc",
...@@ -1389,7 +1377,6 @@ jumbo_component("base") { ...@@ -1389,7 +1377,6 @@ jumbo_component("base") {
} else { } else {
# Remove NaCl stuff. # Remove NaCl stuff.
sources -= [ sources -= [
"memory/shared_memory_nacl.cc",
"os_compat_nacl.cc", "os_compat_nacl.cc",
"os_compat_nacl.h", "os_compat_nacl.h",
"rand_util_nacl.cc", "rand_util_nacl.cc",
...@@ -1415,6 +1402,8 @@ jumbo_component("base") { ...@@ -1415,6 +1402,8 @@ jumbo_component("base") {
# Windows. # Windows.
if (is_win) { if (is_win) {
sources += [ sources += [
"memory/shared_memory_handle_win.cc",
"memory/shared_memory_win.cc",
"power_monitor/power_monitor_device_source_win.cc", "power_monitor/power_monitor_device_source_win.cc",
"profiler/win32_stack_frame_unwinder.cc", "profiler/win32_stack_frame_unwinder.cc",
"profiler/win32_stack_frame_unwinder.h", "profiler/win32_stack_frame_unwinder.h",
...@@ -1530,8 +1519,11 @@ jumbo_component("base") { ...@@ -1530,8 +1519,11 @@ jumbo_component("base") {
# Desktop Mac. # Desktop Mac.
if (is_mac) { if (is_mac) {
sources -= [ "profiler/native_stack_sampler_posix.cc" ]
sources += [ sources += [
"mac/scoped_typeref.h", "mac/scoped_typeref.h",
"memory/shared_memory_handle_mac.cc",
"memory/shared_memory_mac.cc",
"power_monitor/power_monitor_device_source_mac.mm", "power_monitor/power_monitor_device_source_mac.mm",
"time/time_conversion_posix.cc", "time/time_conversion_posix.cc",
"time/time_exploded_posix.cc", "time/time_exploded_posix.cc",
...@@ -1551,17 +1543,12 @@ jumbo_component("base") { ...@@ -1551,17 +1543,12 @@ jumbo_component("base") {
# Mac or iOS. # Mac or iOS.
if (is_mac || is_ios) { if (is_mac || is_ios) {
sources -= [ sources -= [
"memory/shared_memory_posix.cc",
"native_library_posix.cc", "native_library_posix.cc",
"strings/sys_string_conversions_posix.cc", "strings/sys_string_conversions_posix.cc",
"synchronization/waitable_event_posix.cc", "synchronization/waitable_event_posix.cc",
"synchronization/waitable_event_watcher_posix.cc", "synchronization/waitable_event_watcher_posix.cc",
"threading/platform_thread_internal_posix.cc", "threading/platform_thread_internal_posix.cc",
] ]
if (is_mac) {
sources -= [ "profiler/native_stack_sampler_posix.cc" ]
}
} else { } else {
# Non-Mac/ios. # Non-Mac/ios.
sources -= [ sources -= [
...@@ -1670,7 +1657,6 @@ jumbo_component("base") { ...@@ -1670,7 +1657,6 @@ jumbo_component("base") {
"mac/scoped_objc_class_swizzler.h", "mac/scoped_objc_class_swizzler.h",
"mac/scoped_objc_class_swizzler.mm", "mac/scoped_objc_class_swizzler.mm",
"mac/scoped_typeref.h", "mac/scoped_typeref.h",
"memory/shared_memory_posix.cc",
"message_loop/message_pump_mac.h", "message_loop/message_pump_mac.h",
"message_loop/message_pump_mac.mm", "message_loop/message_pump_mac.mm",
"power_monitor/power_monitor_device_source_ios.mm", "power_monitor/power_monitor_device_source_ios.mm",
...@@ -1685,6 +1671,16 @@ jumbo_component("base") { ...@@ -1685,6 +1671,16 @@ jumbo_component("base") {
set_sources_assignment_filter(sources_assignment_filter) 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) { if (is_posix && !is_fuchsia && !is_mac && !is_ios) {
sources += [ sources += [
"time/time_conversion_posix.cc", "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