| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 | 7 |
| 8 #include "components/breakpad/app/breakpad_linux.h" | 8 #include "components/breakpad/app/breakpad_linux.h" |
| 9 | 9 |
| 10 #include <fcntl.h> | 10 #include <fcntl.h> |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 #endif | 197 #endif |
| 198 | 198 |
| 199 size_t LengthWithoutTrailingSpaces(const char* str, size_t len) { | 199 size_t LengthWithoutTrailingSpaces(const char* str, size_t len) { |
| 200 while (len > 0 && str[len - 1] == ' ') { | 200 while (len > 0 && str[len - 1] == ' ') { |
| 201 len--; | 201 len--; |
| 202 } | 202 } |
| 203 return len; | 203 return len; |
| 204 } | 204 } |
| 205 | 205 |
| 206 void SetClientIdFromCommandLine(const CommandLine& command_line) { | 206 void SetClientIdFromCommandLine(const CommandLine& command_line) { |
| 207 // Get the guid and linux distro from the command line switch. | 207 // Get the guid from the command line switch. |
| 208 std::string switch_value = | 208 std::string switch_value = |
| 209 command_line.GetSwitchValueASCII(switches::kEnableCrashReporter); | 209 command_line.GetSwitchValueASCII(switches::kEnableCrashReporter); |
| 210 size_t separator = switch_value.find(","); | 210 GetBreakpadClient()->SetClientID(switch_value); |
| 211 if (separator != std::string::npos) { | |
| 212 GetBreakpadClient()->SetClientID(switch_value.substr(0, separator)); | |
| 213 base::SetLinuxDistro(switch_value.substr(separator + 1)); | |
| 214 } else { | |
| 215 GetBreakpadClient()->SetClientID(switch_value); | |
| 216 } | |
| 217 } | 211 } |
| 218 | 212 |
| 219 // MIME substrings. | 213 // MIME substrings. |
| 220 #if defined(OS_CHROMEOS) | 214 #if defined(OS_CHROMEOS) |
| 221 const char g_sep[] = ":"; | 215 const char g_sep[] = ":"; |
| 222 #endif | 216 #endif |
| 223 const char g_rn[] = "\r\n"; | 217 const char g_rn[] = "\r\n"; |
| 224 const char g_form_data_msg[] = "Content-Disposition: form-data; name=\""; | 218 const char g_form_data_msg[] = "Content-Disposition: form-data; name=\""; |
| 225 const char g_quote_msg[] = "\""; | 219 const char g_quote_msg[] = "\""; |
| 226 const char g_dashdash_msg[] = "--"; | 220 const char g_dashdash_msg[] = "--"; |
| (...skipping 1386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1613 } | 1607 } |
| 1614 } | 1608 } |
| 1615 } | 1609 } |
| 1616 #endif // OS_ANDROID | 1610 #endif // OS_ANDROID |
| 1617 | 1611 |
| 1618 bool IsCrashReporterEnabled() { | 1612 bool IsCrashReporterEnabled() { |
| 1619 return g_is_crash_reporter_enabled; | 1613 return g_is_crash_reporter_enabled; |
| 1620 } | 1614 } |
| 1621 | 1615 |
| 1622 } // namespace breakpad | 1616 } // namespace breakpad |
| OLD | NEW |