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

Commit 7d85a6a5 authored by Alex Vakulenko's avatar Alex Vakulenko Committed by Gerrit Code Review
Browse files

Merge "system/core: Rename "chromeos" -> "brillo" in include paths and namespaces"

parents cee44732 74dc6246
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -35,8 +35,8 @@
#include <base/strings/string_split.h>
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
#include <chromeos/key_value_store.h>
#include <chromeos/process.h>
#include <brillo/key_value_store.h>
#include <brillo/process.h>

namespace {

@@ -340,7 +340,7 @@ bool CrashCollector::CheckHasCapacity(const FilePath &crash_directory) {
bool CrashCollector::GetLogContents(const FilePath &config_path,
                                    const std::string &exec_name,
                                    const FilePath &output_file) {
  chromeos::KeyValueStore store;
  brillo::KeyValueStore store;
  if (!store.Load(config_path)) {
    LOG(INFO) << "Unable to read log configuration file "
              << config_path.value();
@@ -351,7 +351,7 @@ bool CrashCollector::GetLogContents(const FilePath &config_path,
  if (!store.GetString(exec_name, &command))
    return false;

  chromeos::ProcessImpl diag_process;
  brillo::ProcessImpl diag_process;
  diag_process.AddArg(kShellPath);
  diag_process.AddStringOption("-c", command);
  diag_process.RedirectOutput(output_file.value());
+5 −5
Original line number Diff line number Diff line
@@ -22,14 +22,14 @@
#include <base/files/file_util.h>
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
#include <chromeos/syslog_logging.h>
#include <brillo/syslog_logging.h>
#include <gtest/gtest.h>

#include "crash_collector.h"

using base::FilePath;
using base::StringPrintf;
using chromeos::FindLog;
using brillo::FindLog;
using ::testing::Invoke;
using ::testing::Return;

@@ -54,7 +54,7 @@ class CrashCollectorTest : public ::testing::Test {
    collector_.Initialize(CountCrash, IsMetrics);
    test_dir_ = FilePath("test");
    base::CreateDirectory(test_dir_);
    chromeos::ClearLog();
    brillo::ClearLog();
  }

  void TearDown() {
@@ -208,7 +208,7 @@ TEST_F(CrashCollectorTest, MetaData) {
            symlink(kMetaFileBasename,
                    meta_symlink_path.value().c_str()));
  ASSERT_TRUE(base::PathExists(meta_symlink_path));
  chromeos::ClearLog();
  brillo::ClearLog();
  collector_.WriteCrashMetaData(meta_symlink_path,
                                "kernel",
                                payload_file.value());
@@ -221,7 +221,7 @@ TEST_F(CrashCollectorTest, MetaData) {
  // Test target of dangling symlink is not created.
  base::DeleteFile(meta_file, false);
  ASSERT_FALSE(base::PathExists(meta_file));
  chromeos::ClearLog();
  brillo::ClearLog();
  collector_.WriteCrashMetaData(meta_symlink_path, "kernel",
                                payload_file.value());
  EXPECT_FALSE(base::PathExists(meta_file));
+13 −13
Original line number Diff line number Diff line
@@ -25,9 +25,9 @@
#include <base/strings/string_split.h>
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
#include <chromeos/flag_helper.h>
#include <chromeos/process.h>
#include <chromeos/syslog_logging.h>
#include <brillo/flag_helper.h>
#include <brillo/process.h>
#include <brillo/syslog_logging.h>
#include <metrics/metrics_library.h>

#include "kernel_collector.h"
@@ -102,7 +102,7 @@ static void CountUserCrash() {
  // Note: This will mean that the dbus-send process will become a zombie and
  // reparent to init for reaping, but that's OK -- see above.

  chromeos::ProcessImpl dbus_send;
  brillo::ProcessImpl dbus_send;
  dbus_send.AddArg("/system/bin/dbus-send");
  dbus_send.AddArg("--type=signal");
  dbus_send.AddArg("--system");
@@ -183,10 +183,10 @@ static int HandleUserCrash(UserCollector *user_collector,
  }

  // Accumulate logs to help in diagnosing failures during user collection.
  chromeos::LogToString(true);
  brillo::LogToString(true);
  // Handle the crash, get the name of the process from procfs.
  bool handled = user_collector->HandleCrash(user, nullptr);
  chromeos::LogToString(false);
  brillo::LogToString(false);
  if (!handled)
    return 1;
  return 0;
@@ -198,9 +198,9 @@ static int HandleUdevCrash(UdevCollector *udev_collector,
  CHECK(!udev_event.empty()) << "--udev= must be set";

  // Accumulate logs to help in diagnosing failures during user collection.
  chromeos::LogToString(true);
  brillo::LogToString(true);
  bool handled = udev_collector->HandleCrash(udev_event);
  chromeos::LogToString(false);
  brillo::LogToString(false);
  if (!handled)
    return 1;
  return 0;
@@ -209,9 +209,9 @@ static int HandleUdevCrash(UdevCollector *udev_collector,
static int HandleKernelWarning(KernelWarningCollector
                               *kernel_warning_collector) {
  // Accumulate logs to help in diagnosing failures during collection.
  chromeos::LogToString(true);
  brillo::LogToString(true);
  bool handled = kernel_warning_collector->Collect();
  chromeos::LogToString(false);
  brillo::LogToString(false);
  if (!handled)
    return 1;
  return 0;
@@ -278,9 +278,9 @@ int main(int argc, char *argv[]) {
  OpenStandardFileDescriptors();
  FilePath my_path = base::MakeAbsoluteFilePath(FilePath(argv[0]));
  s_metrics_lib.Init();
  chromeos::FlagHelper::Init(argc, argv, "Chromium OS Crash Reporter");
  chromeos::OpenLog(my_path.BaseName().value().c_str(), true);
  chromeos::InitLog(chromeos::kLogToSyslog);
  brillo::FlagHelper::Init(argc, argv, "Chromium OS Crash Reporter");
  brillo::OpenLog(my_path.BaseName().value().c_str(), true);
  brillo::InitLog(brillo::kLogToSyslog);

  KernelCollector kernel_collector;
  kernel_collector.Initialize(CountKernelCrash, IsFeedbackAllowed);
+2 −2
Original line number Diff line number Diff line
@@ -17,7 +17,7 @@
#include <string>

#include <base/files/file_path.h>
#include <chromeos/key_value_store.h>
#include <brillo/key_value_store.h>
#include <gtest/gtest.h>

namespace {
@@ -32,7 +32,7 @@ const char kChromeExecName[] = "chrome";

// Tests that the config file is parsable and that Chrome is listed.
TEST(CrashReporterLogsTest, ReadConfig) {
  chromeos::KeyValueStore store;
  brillo::KeyValueStore store;
  ASSERT_TRUE(store.Load(base::FilePath(kConfigFile)));
  std::string command;
  EXPECT_TRUE(store.GetString(kChromeExecName, &command));
+5 −5
Original line number Diff line number Diff line
@@ -22,13 +22,13 @@
#include <base/files/scoped_temp_dir.h>
#include <base/strings/string_util.h>
#include <base/strings/stringprintf.h>
#include <chromeos/syslog_logging.h>
#include <brillo/syslog_logging.h>
#include <gtest/gtest.h>

using base::FilePath;
using base::StringPrintf;
using chromeos::FindLog;
using chromeos::GetLog;
using brillo::FindLog;
using brillo::GetLog;

namespace {

@@ -78,7 +78,7 @@ class KernelCollectorTest : public ::testing::Test {

    test_crash_directory_ = scoped_temp_dir_.path().Append("crash_directory");
    ASSERT_TRUE(base::CreateDirectory(test_crash_directory_));
    chromeos::ClearLog();
    brillo::ClearLog();
  }

  FilePath test_kcrash_;
@@ -282,7 +282,7 @@ TEST_F(KernelCollectorTest, CollectOK) {
  ASSERT_EQ(1, s_crashes);
  ASSERT_TRUE(FindLog("(handling)"));
  static const char kNamePrefix[] = "Stored kcrash to ";
  std::string log = chromeos::GetLog();
  std::string log = brillo::GetLog();
  size_t pos = log.find(kNamePrefix);
  ASSERT_NE(std::string::npos, pos)
      << "Did not find string \"" << kNamePrefix << "\" in log: {\n"
Loading