From 7bd613e55835de1f8d29f24de4e4271bdb8c01d4 Mon Sep 17 00:00:00 2001 From: Joshua Peraza Date: Wed, 28 Mar 2018 08:37:22 -0700 Subject: [PATCH] linux: prefix args with crashpad and build tools on android 1. Prefix enable_http_transport_libcurl with crashpad for use in chromium .gn files. 2. Make tools build on Android using http_transport_none.cc Bug: crashpad:30 Change-Id: I0a9878fe9f5b8fbc13a52f93df273fb1de8160f3 Reviewed-on: https://chromium-review.googlesource.com/984038 Reviewed-by: Mark Mentovai --- tools/generate_dump.cc | 4 ++-- util/BUILD.gn | 10 +++++----- util/util.gyp | 6 ++++++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tools/generate_dump.cc b/tools/generate_dump.cc index c1fbde84..cce0823b 100644 --- a/tools/generate_dump.cc +++ b/tools/generate_dump.cc @@ -47,7 +47,7 @@ #include "util/win/xp_compat.h" #elif defined(OS_FUCHSIA) #include "snapshot/fuchsia/process_snapshot_fuchsia.h" -#elif defined(OS_LINUX) +#elif defined(OS_LINUX) || defined(OS_ANDROID) #include "snapshot/linux/process_snapshot_linux.h" #endif // OS_MACOSX @@ -201,7 +201,7 @@ int GenerateDumpMain(int argc, char* argv[]) { if (!process_snapshot.Initialize(ZX_HANDLE_INVALID)) { return EXIT_FAILURE; } -#elif defined(OS_LINUX) +#elif defined(OS_LINUX) || defined(OS_ANDROID) // TODO(jperaza): https://crashpad.chromium.org/bug/30. ProcessSnapshotLinux process_snapshot; if (!process_snapshot.Initialize(nullptr)) { diff --git a/util/BUILD.gn b/util/BUILD.gn index a7034924..3836e804 100644 --- a/util/BUILD.gn +++ b/util/BUILD.gn @@ -17,7 +17,7 @@ import("../build/crashpad_buildconfig.gni") declare_args() { if (crashpad_is_linux) { # Whether the libcurl-based HTTPTransport implementation should be built. - enable_http_transport_libcurl = true + crashpad_enable_http_transport_libcurl = true } } @@ -251,8 +251,8 @@ static_library("util") { sources += get_target_outputs(":mig") } - if (crashpad_is_linux) { - if (enable_http_transport_libcurl) { + if (crashpad_is_linux || crashpad_is_android) { + if (crashpad_is_linux && crashpad_enable_http_transport_libcurl) { sources += [ "net/http_transport_libcurl.cc" ] } else { sources += [ "net/http_transport_none.cc" ] @@ -420,7 +420,7 @@ static_library("util") { include_dirs += [ "$root_build_dir/gen" ] } - if (crashpad_is_linux && enable_http_transport_libcurl) { + if (crashpad_is_linux && crashpad_enable_http_transport_libcurl) { libs = [ "curl" ] } @@ -497,7 +497,7 @@ source_set("util_test") { } if (!crashpad_is_android && !crashpad_is_fuchsia && - (!crashpad_is_linux || enable_http_transport_libcurl)) { + (!crashpad_is_linux || crashpad_enable_http_transport_libcurl)) { # Android and Fuchsia will each require an HTTPTransport implementation # (libcurl isn’t in either’s SDK) and a solution to # http_transport_test_server.py, because Python isn’t available on either. diff --git a/util/util.gyp b/util/util.gyp index e0394e2a..45de7a62 100644 --- a/util/util.gyp +++ b/util/util.gyp @@ -177,6 +177,7 @@ 'net/http_transport.h', 'net/http_transport_libcurl.cc', 'net/http_transport_mac.mm', + 'net/http_transport_none.cc', 'net/http_transport_win.cc', 'net/url.cc', 'net/url.h', @@ -393,6 +394,11 @@ 'net/http_transport_libcurl.cc', ], }], + ['OS!="android"', { + 'sources!': [ + 'net/http_transport_none.cc', + ], + }], ['OS!="linux" and OS!="android"', { 'sources/': [ ['exclude', '^process/'],