Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4ef51c34 authored by Alex Vakulenko's avatar Alex Vakulenko Committed by Gerrit Code Review
Browse files

Merge "crash_reporter/metricsd: Update libchrome APIs to r369476"

parents fb494eb4 ea05ff92
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -68,8 +68,8 @@ const char* const kPCRegex[] = {
  " RIP  \\[<.*>\\] ([^\\+ ]+).*",  // X86_64 uses RIP for the program counter
};

COMPILE_ASSERT(arraysize(kPCRegex) == KernelCollector::kArchCount,
               missing_arch_pc_regexp);
static_assert(arraysize(kPCRegex) == KernelCollector::kArchCount,
              "Missing Arch PC regexp");

}  // namespace

+3 −4
Original line number Diff line number Diff line
@@ -75,13 +75,12 @@ std::vector<std::string> ParseProxyString(const std::string& input) {
    // Start by finding the first space (if any).
    std::string::iterator space;
    for (space = token.begin(); space != token.end(); ++space) {
      if (IsAsciiWhitespace(*space)) {
      if (base::IsAsciiWhitespace(*space)) {
        break;
      }
    }

    std::string scheme = std::string(token.begin(), space);
    base::StringToLowerASCII(&scheme);
    std::string scheme = base::ToLowerASCII(std::string(token.begin(), space));
    // Chrome uses "socks" to mean socks4 and "proxy" to mean http.
    if (scheme == "socks")
      scheme += "4";
@@ -183,7 +182,7 @@ class ProxyResolver : public brillo::DBusDaemon {
    timeout_callback_.Cancel();
    proxies_ = ParseProxyString(proxy_info);
    LOG(INFO) << "Found proxies via browser signal: "
              << JoinString(proxies_, 'x');
              << base::JoinString(proxies_, "x");

    Quit();
  }
+4 −4
Original line number Diff line number Diff line
@@ -151,8 +151,8 @@ bool UserCollector::GetIdFromStatus(
    return false;
  }
  std::string id_substring = id_line.substr(strlen(prefix), std::string::npos);
  std::vector<std::string> ids;
  base::SplitString(id_substring, '\t', &ids);
  std::vector<std::string> ids = base::SplitString(
      id_substring, "\t", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
  if (ids.size() != kIdMax || kind < 0 || kind >= kIdMax) {
    return false;
  }
@@ -313,8 +313,8 @@ bool UserCollector::GetCreatedCrashDirectory(pid_t pid, uid_t supplied_ruid,

  uid_t uid;
  if (base::ReadFileToString(process_path.Append("status"), &status)) {
    std::vector<std::string> status_lines;
    base::SplitString(status, '\n', &status_lines);
    std::vector<std::string> status_lines = base::SplitString(
        status, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);

    std::string process_state;
    if (!GetStateFromStatus(status_lines, &process_state)) {
+2 −3
Original line number Diff line number Diff line
@@ -80,9 +80,8 @@ class UserCollectorTest : public ::testing::Test {
  }

  std::vector<std::string> SplitLines(const std::string &lines) const {
    std::vector<std::string> result;
    base::SplitString(lines, '\n', &result);
    return result;
    return base::SplitString(lines, "\n", base::TRIM_WHITESPACE,
                             base::SPLIT_WANT_ALL);
  }

  UserCollectorMock collector_;
+5 −4
Original line number Diff line number Diff line
@@ -104,14 +104,15 @@ bool CpuUsageCollector::ParseProcStat(const std::string& stat_content,
                                      uint64_t *user_ticks,
                                      uint64_t *user_nice_ticks,
                                      uint64_t *system_ticks) {
  std::vector<std::string> proc_stat_lines;
  base::SplitString(stat_content, '\n', &proc_stat_lines);
  std::vector<std::string> proc_stat_lines = base::SplitString(
      stat_content, "\n", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
  if (proc_stat_lines.empty()) {
    LOG(WARNING) << "No lines found in " << kMetricsProcStatFileName;
    return false;
  }
  std::vector<std::string> proc_stat_totals;
  base::SplitStringAlongWhitespace(proc_stat_lines[0], &proc_stat_totals);
  std::vector<std::string> proc_stat_totals =
      base::SplitString(proc_stat_lines[0], base::kWhitespaceASCII,
                        base::KEEP_WHITESPACE, base::SPLIT_WANT_NONEMPTY);

  if (proc_stat_totals.size() != kMetricsProcStatFirstLineItemsCount ||
      proc_stat_totals[0] != "cpu" ||
Loading