| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // For linux_syscall_support.h. This makes it safe to call embedded system | 5 // For linux_syscall_support.h. This makes it safe to call embedded system |
| 6 // calls when in seccomp mode. | 6 // calls when in seccomp mode. |
| 7 #define SYS_SYSCALL_ENTRYPOINT "playground$syscallEntryPoint" | 7 #define SYS_SYSCALL_ENTRYPOINT "playground$syscallEntryPoint" |
| 8 | 8 |
| 9 #include "chrome/app/breakpad_linux.h" | 9 #include "chrome/app/breakpad_linux.h" |
| 10 | 10 |
| (...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 } | 862 } |
| 863 } | 863 } |
| 864 | 864 |
| 865 if (info.process_type_length) { | 865 if (info.process_type_length) { |
| 866 writer.AddPairString("ptype", info.process_type); | 866 writer.AddPairString("ptype", info.process_type); |
| 867 writer.AddBoundary(); | 867 writer.AddBoundary(); |
| 868 writer.Flush(); | 868 writer.Flush(); |
| 869 } | 869 } |
| 870 | 870 |
| 871 // If GPU info is known, send it. | 871 // If GPU info is known, send it. |
| 872 unsigned gpu_vendor_len = my_strlen(child_process_logging::g_gpu_vendor_id); | 872 if (*child_process_logging::g_gpu_vendor_id) { |
| 873 if (gpu_vendor_len) { | |
| 874 static const char vendor_msg[] = "gpu-venid"; | 873 static const char vendor_msg[] = "gpu-venid"; |
| 875 static const char device_msg[] = "gpu-devid"; | 874 static const char device_msg[] = "gpu-devid"; |
| 876 static const char driver_msg[] = "gpu-driver"; | 875 static const char driver_msg[] = "gpu-driver"; |
| 877 static const char psver_msg[] = "gpu-psver"; | 876 static const char psver_msg[] = "gpu-psver"; |
| 878 static const char vsver_msg[] = "gpu-vsver"; | 877 static const char vsver_msg[] = "gpu-vsver"; |
| 879 | 878 |
| 880 writer.AddPairString(vendor_msg, child_process_logging::g_gpu_vendor_id); | 879 writer.AddPairString(vendor_msg, child_process_logging::g_gpu_vendor_id); |
| 881 writer.AddBoundary(); | 880 writer.AddBoundary(); |
| 882 writer.AddPairString(device_msg, child_process_logging::g_gpu_device_id); | 881 writer.AddPairString(device_msg, child_process_logging::g_gpu_device_id); |
| 883 writer.AddBoundary(); | 882 writer.AddBoundary(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 899 | 898 |
| 900 // For renderers and plugins. | 899 // For renderers and plugins. |
| 901 if (info.crash_url_length) { | 900 if (info.crash_url_length) { |
| 902 static const char url_chunk_msg[] = "url-chunk-"; | 901 static const char url_chunk_msg[] = "url-chunk-"; |
| 903 static const unsigned kMaxUrlLength = 8 * MimeWriter::kMaxCrashChunkSize; | 902 static const unsigned kMaxUrlLength = 8 * MimeWriter::kMaxCrashChunkSize; |
| 904 writer.AddPairDataInChunks(url_chunk_msg, sizeof(url_chunk_msg) - 1, | 903 writer.AddPairDataInChunks(url_chunk_msg, sizeof(url_chunk_msg) - 1, |
| 905 info.crash_url, std::min(info.crash_url_length, kMaxUrlLength), | 904 info.crash_url, std::min(info.crash_url_length, kMaxUrlLength), |
| 906 MimeWriter::kMaxCrashChunkSize, false /* Don't strip whitespaces. */); | 905 MimeWriter::kMaxCrashChunkSize, false /* Don't strip whitespaces. */); |
| 907 } | 906 } |
| 908 | 907 |
| 909 if (my_strlen(child_process_logging::g_channel)) { | 908 if (*child_process_logging::g_channel) { |
| 910 writer.AddPairString("channel", child_process_logging::g_channel); | 909 writer.AddPairString("channel", child_process_logging::g_channel); |
| 911 writer.AddBoundary(); | 910 writer.AddBoundary(); |
| 912 writer.Flush(); | 911 writer.Flush(); |
| 913 } | 912 } |
| 914 | 913 |
| 915 if (my_strlen(child_process_logging::g_num_views)) { | 914 if (*child_process_logging::g_num_views) { |
| 916 writer.AddPairString("num-views", child_process_logging::g_num_views); | 915 writer.AddPairString("num-views", child_process_logging::g_num_views); |
| 917 writer.AddBoundary(); | 916 writer.AddBoundary(); |
| 918 writer.Flush(); | 917 writer.Flush(); |
| 919 } | 918 } |
| 920 | 919 |
| 921 if (my_strlen(child_process_logging::g_num_extensions)) { | 920 if (*child_process_logging::g_num_extensions) { |
| 922 writer.AddPairString("num-extensions", | 921 writer.AddPairString("num-extensions", |
| 923 child_process_logging::g_num_extensions); | 922 child_process_logging::g_num_extensions); |
| 924 writer.AddBoundary(); | 923 writer.AddBoundary(); |
| 925 writer.Flush(); | 924 writer.Flush(); |
| 926 } | 925 } |
| 927 | 926 |
| 928 unsigned extension_ids_len = | 927 unsigned extension_ids_len = |
| 929 my_strlen(child_process_logging::g_extension_ids); | 928 my_strlen(child_process_logging::g_extension_ids); |
| 930 if (extension_ids_len) { | 929 if (extension_ids_len) { |
| 931 static const char extension_msg[] = "extension-"; | 930 static const char extension_msg[] = "extension-"; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 944 static const char printer_info_msg[] = "prn-info-"; | 943 static const char printer_info_msg[] = "prn-info-"; |
| 945 static const unsigned kMaxPrnInfoLen = | 944 static const unsigned kMaxPrnInfoLen = |
| 946 kMaxReportedPrinterRecords * child_process_logging::kPrinterInfoStrLen; | 945 kMaxReportedPrinterRecords * child_process_logging::kPrinterInfoStrLen; |
| 947 writer.AddPairDataInChunks(printer_info_msg, sizeof(printer_info_msg) - 1, | 946 writer.AddPairDataInChunks(printer_info_msg, sizeof(printer_info_msg) - 1, |
| 948 child_process_logging::g_printer_info, | 947 child_process_logging::g_printer_info, |
| 949 std::min(printer_info_len, kMaxPrnInfoLen), | 948 std::min(printer_info_len, kMaxPrnInfoLen), |
| 950 child_process_logging::kPrinterInfoStrLen, | 949 child_process_logging::kPrinterInfoStrLen, |
| 951 true); | 950 true); |
| 952 } | 951 } |
| 953 | 952 |
| 954 if (my_strlen(child_process_logging::g_num_switches)) { | 953 if (*child_process_logging::g_num_switches) { |
| 955 writer.AddPairString("num-switches", | 954 writer.AddPairString("num-switches", |
| 956 child_process_logging::g_num_switches); | 955 child_process_logging::g_num_switches); |
| 957 writer.AddBoundary(); | 956 writer.AddBoundary(); |
| 958 writer.Flush(); | 957 writer.Flush(); |
| 959 } | 958 } |
| 960 | 959 |
| 961 unsigned switches_len = | 960 unsigned switches_len = |
| 962 my_strlen(child_process_logging::g_switches); | 961 my_strlen(child_process_logging::g_switches); |
| 963 if (switches_len) { | 962 if (switches_len) { |
| 964 static const char switch_msg[] = "switch-"; | 963 static const char switch_msg[] = "switch-"; |
| 965 static const unsigned kMaxSwitchLen = | 964 static const unsigned kMaxSwitchLen = |
| 966 kMaxSwitches * child_process_logging::kSwitchLen; | 965 kMaxSwitches * child_process_logging::kSwitchLen; |
| 967 writer.AddPairDataInChunks(switch_msg, sizeof(switch_msg) - 1, | 966 writer.AddPairDataInChunks(switch_msg, sizeof(switch_msg) - 1, |
| 968 child_process_logging::g_switches, | 967 child_process_logging::g_switches, |
| 969 std::min(switches_len, kMaxSwitchLen), | 968 std::min(switches_len, kMaxSwitchLen), |
| 970 child_process_logging::kSwitchLen, | 969 child_process_logging::kSwitchLen, |
| 971 true /* Strip whitespace since switches are padded to kSwitchLen. */); | 970 true /* Strip whitespace since switches are padded to kSwitchLen. */); |
| 972 } | 971 } |
| 973 | 972 |
| 973 if (*child_process_logging::g_num_variations) { |
| 974 writer.AddPairString("num-experiments", |
| 975 child_process_logging::g_num_variations); |
| 976 writer.AddBoundary(); |
| 977 writer.Flush(); |
| 978 } |
| 979 |
| 980 unsigned variation_chunks_len = |
| 981 my_strlen(child_process_logging::g_variation_chunks); |
| 982 if (variation_chunks_len) { |
| 983 static const char variation_msg[] = "experiment-chunk-"; |
| 984 static const unsigned kMaxVariationsLen = |
| 985 kMaxReportedVariationChunks * kMaxVariationChunkSize; |
| 986 writer.AddPairDataInChunks(variation_msg, sizeof(variation_msg) - 1, |
| 987 child_process_logging::g_variation_chunks, |
| 988 std::min(variation_chunks_len, kMaxVariationsLen), |
| 989 kMaxVariationChunkSize, |
| 990 true /* Strip whitespace since variation chunks are padded. */); |
| 991 } |
| 992 |
| 974 if (info.oom_size) { | 993 if (info.oom_size) { |
| 975 char oom_size_str[kUint64StringSize]; | 994 char oom_size_str[kUint64StringSize]; |
| 976 const unsigned oom_size_len = my_uint64_len(info.oom_size); | 995 const unsigned oom_size_len = my_uint64_len(info.oom_size); |
| 977 my_uint64tos(oom_size_str, info.oom_size, oom_size_len); | 996 my_uint64tos(oom_size_str, info.oom_size, oom_size_len); |
| 978 static const char oom_size_msg[] = "oom-size"; | 997 static const char oom_size_msg[] = "oom-size"; |
| 979 writer.AddPairData(oom_size_msg, sizeof(oom_size_msg) - 1, | 998 writer.AddPairData(oom_size_msg, sizeof(oom_size_msg) - 1, |
| 980 oom_size_str, oom_size_len); | 999 oom_size_str, oom_size_len); |
| 981 writer.AddBoundary(); | 1000 writer.AddBoundary(); |
| 982 writer.Flush(); | 1001 writer.Flush(); |
| 983 } | 1002 } |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 logging::SetDumpWithoutCrashingFunction(&DumpProcess); | 1253 logging::SetDumpWithoutCrashingFunction(&DumpProcess); |
| 1235 #if defined(ADDRESS_SANITIZER) | 1254 #if defined(ADDRESS_SANITIZER) |
| 1236 // Register the callback for AddressSanitizer error reporting. | 1255 // Register the callback for AddressSanitizer error reporting. |
| 1237 __asan_set_error_report_callback(AsanLinuxBreakpadCallback); | 1256 __asan_set_error_report_callback(AsanLinuxBreakpadCallback); |
| 1238 #endif | 1257 #endif |
| 1239 } | 1258 } |
| 1240 | 1259 |
| 1241 bool IsCrashReporterEnabled() { | 1260 bool IsCrashReporterEnabled() { |
| 1242 return g_is_crash_reporter_enabled; | 1261 return g_is_crash_reporter_enabled; |
| 1243 } | 1262 } |
| OLD | NEW |