diff options
author | Alex Vakulenko <avakulenko@google.com> | 2015-10-13 09:23:34 -0700 |
---|---|---|
committer | Alex Vakulenko <avakulenko@google.com> | 2015-10-13 15:29:24 -0700 |
commit | 74dc62460b8cdd5bfeac47bfe8e759fc04b55ef8 (patch) | |
tree | 7349d98fd73421d28c764b6a3cc713878fda4e3c /crash_reporter | |
parent | cee44732e61c3e0f9491aa6cea78670ed6c9c89d (diff) | |
download | system_core-74dc62460b8cdd5bfeac47bfe8e759fc04b55ef8.tar.gz system_core-74dc62460b8cdd5bfeac47bfe8e759fc04b55ef8.tar.bz2 system_core-74dc62460b8cdd5bfeac47bfe8e759fc04b55ef8.zip |
system/core: Rename "chromeos" -> "brillo" in include paths and namespaces
libchromeos is transitioning to libbrillo and chromeos namespaces
and include directory is changing to brillo.
Bug: 24872993
Change-Id: I797613a38c7444a113f12e38366a424388477276
Diffstat (limited to 'crash_reporter')
-rw-r--r-- | crash_reporter/crash_collector.cc | 8 | ||||
-rw-r--r-- | crash_reporter/crash_collector_test.cc | 10 | ||||
-rw-r--r-- | crash_reporter/crash_reporter.cc | 26 | ||||
-rw-r--r-- | crash_reporter/crash_reporter_logs_test.cc | 4 | ||||
-rw-r--r-- | crash_reporter/kernel_collector_test.cc | 10 | ||||
-rw-r--r-- | crash_reporter/list_proxies.cc | 18 | ||||
-rw-r--r-- | crash_reporter/testrunner.cc | 2 | ||||
-rw-r--r-- | crash_reporter/udev_collector.cc | 4 | ||||
-rw-r--r-- | crash_reporter/udev_collector_test.cc | 4 | ||||
-rw-r--r-- | crash_reporter/unclean_shutdown_collector_test.cc | 6 | ||||
-rw-r--r-- | crash_reporter/user_collector.cc | 12 | ||||
-rw-r--r-- | crash_reporter/user_collector_test.cc | 8 |
12 files changed, 56 insertions, 56 deletions
diff --git a/crash_reporter/crash_collector.cc b/crash_reporter/crash_collector.cc index ae56b4ca5..2a9d1d361 100644 --- a/crash_reporter/crash_collector.cc +++ b/crash_reporter/crash_collector.cc @@ -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()); diff --git a/crash_reporter/crash_collector_test.cc b/crash_reporter/crash_collector_test.cc index 32cbe9fcf..d00a5b512 100644 --- a/crash_reporter/crash_collector_test.cc +++ b/crash_reporter/crash_collector_test.cc @@ -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)); diff --git a/crash_reporter/crash_reporter.cc b/crash_reporter/crash_reporter.cc index 7872f7b1d..3955fe54b 100644 --- a/crash_reporter/crash_reporter.cc +++ b/crash_reporter/crash_reporter.cc @@ -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); diff --git a/crash_reporter/crash_reporter_logs_test.cc b/crash_reporter/crash_reporter_logs_test.cc index c9ca02d5d..e7780023e 100644 --- a/crash_reporter/crash_reporter_logs_test.cc +++ b/crash_reporter/crash_reporter_logs_test.cc @@ -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)); diff --git a/crash_reporter/kernel_collector_test.cc b/crash_reporter/kernel_collector_test.cc index e690b779c..cdb0ae73f 100644 --- a/crash_reporter/kernel_collector_test.cc +++ b/crash_reporter/kernel_collector_test.cc @@ -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" diff --git a/crash_reporter/list_proxies.cc b/crash_reporter/list_proxies.cc index a39441d07..d445557b6 100644 --- a/crash_reporter/list_proxies.cc +++ b/crash_reporter/list_proxies.cc @@ -28,8 +28,8 @@ #include <base/strings/string_tokenizer.h> #include <base/strings/string_util.h> #include <base/values.h> -#include <chromeos/daemons/dbus_daemon.h> -#include <chromeos/syslog_logging.h> +#include <brillo/daemons/dbus_daemon.h> +#include <brillo/syslog_logging.h> #include "libcrosservice/dbus-proxies.h" @@ -111,7 +111,7 @@ std::vector<std::string> ParseProxyString(const std::string& input) { // must be called, which blocks on the D-Bus call to Chrome. The call returns // after either the timeout or the proxy has been resolved. The resolved // proxies can then be accessed through the proxies() function. -class ProxyResolver : public chromeos::DBusDaemon { +class ProxyResolver : public brillo::DBusDaemon { public: ProxyResolver(const std::string& source_url, const std::string& signal_interface, @@ -138,7 +138,7 @@ class ProxyResolver : public chromeos::DBusDaemon { timeout_callback_.callback(), timeout_); - return chromeos::DBusDaemon::Run(); + return brillo::DBusDaemon::Run(); } protected: @@ -162,7 +162,7 @@ class ProxyResolver : public chromeos::DBusDaemon { return; } - chromeos::ErrorPtr error; + brillo::ErrorPtr error; call_proxy_->ResolveNetworkProxy(source_url_, signal_interface_, signal_name_, @@ -189,7 +189,7 @@ class ProxyResolver : public chromeos::DBusDaemon { } int OnInit() override { - int return_code = chromeos::DBusDaemon::OnInit(); + int return_code = brillo::DBusDaemon::OnInit(); if (return_code != EX_OK) return return_code; @@ -276,13 +276,13 @@ int main(int argc, char *argv[]) { } // Default to logging to syslog. - int init_flags = chromeos::kLogToSyslog; + int init_flags = brillo::kLogToSyslog; // Log to stderr if a TTY (and "-quiet" wasn't passed), or if "-verbose" // was passed. if ((!quiet && isatty(STDERR_FILENO)) || verbose) - init_flags |= chromeos::kLogToStderr; - chromeos::InitLog(init_flags); + init_flags |= brillo::kLogToStderr; + brillo::InitLog(init_flags); std::string url; base::CommandLine::StringVector urls = cl->GetArgs(); diff --git a/crash_reporter/testrunner.cc b/crash_reporter/testrunner.cc index a8c717ed2..744cf10c2 100644 --- a/crash_reporter/testrunner.cc +++ b/crash_reporter/testrunner.cc @@ -14,7 +14,7 @@ * limitations under the License. */ -#include <chromeos/test_helpers.h> +#include <brillo/test_helpers.h> #include <gtest/gtest.h> int main(int argc, char** argv) { diff --git a/crash_reporter/udev_collector.cc b/crash_reporter/udev_collector.cc index 576fdbdbb..1e018db4d 100644 --- a/crash_reporter/udev_collector.cc +++ b/crash_reporter/udev_collector.cc @@ -27,7 +27,7 @@ #include <base/strings/string_split.h> #include <base/strings/string_util.h> #include <base/strings/stringprintf.h> -#include <chromeos/process.h> +#include <brillo/process.h> using base::FilePath; @@ -120,7 +120,7 @@ bool UdevCollector::ProcessUdevCrashLogs(const FilePath& crash_directory, } // Compress the output using gzip. - chromeos::ProcessImpl gzip_process; + brillo::ProcessImpl gzip_process; gzip_process.AddArg(kGzipPath); gzip_process.AddArg(crash_path.value()); int process_result = gzip_process.Run(); diff --git a/crash_reporter/udev_collector_test.cc b/crash_reporter/udev_collector_test.cc index a6643fbe5..5474f482b 100644 --- a/crash_reporter/udev_collector_test.cc +++ b/crash_reporter/udev_collector_test.cc @@ -18,7 +18,7 @@ #include <base/files/file_util.h> #include <base/files/scoped_temp_dir.h> #include <base/strings/stringprintf.h> -#include <chromeos/syslog_logging.h> +#include <brillo/syslog_logging.h> #include <gmock/gmock.h> #include <gtest/gtest.h> @@ -141,7 +141,7 @@ class UdevCollectorTest : public ::testing::Test { kLogConfigFileContents, strlen(kLogConfigFileContents))); - chromeos::ClearLog(); + brillo::ClearLog(); } UdevCollectorMock collector_; diff --git a/crash_reporter/unclean_shutdown_collector_test.cc b/crash_reporter/unclean_shutdown_collector_test.cc index c5c0662fb..3bdeca10c 100644 --- a/crash_reporter/unclean_shutdown_collector_test.cc +++ b/crash_reporter/unclean_shutdown_collector_test.cc @@ -20,12 +20,12 @@ #include <base/files/file_util.h> #include <base/strings/string_util.h> -#include <chromeos/syslog_logging.h> +#include <brillo/syslog_logging.h> #include <gmock/gmock.h> #include <gtest/gtest.h> using base::FilePath; -using ::chromeos::FindLog; +using ::brillo::FindLog; namespace { @@ -65,7 +65,7 @@ class UncleanShutdownCollectorTest : public ::testing::Test { base::DeleteFile(test_unclean_, true); // Set up an alternate power manager state file as well collector_.powerd_suspended_file_ = FilePath(kTestSuspended); - chromeos::ClearLog(); + brillo::ClearLog(); } protected: diff --git a/crash_reporter/user_collector.cc b/crash_reporter/user_collector.cc index c2e0732c5..53fbb1444 100644 --- a/crash_reporter/user_collector.cc +++ b/crash_reporter/user_collector.cc @@ -37,9 +37,9 @@ #include <base/strings/string_split.h> #include <base/strings/string_util.h> #include <base/strings/stringprintf.h> -#include "chromeos/osrelease_reader.h" -#include <chromeos/process.h> -#include <chromeos/syslog_logging.h> +#include <brillo/osrelease_reader.h> +#include <brillo/process.h> +#include <brillo/syslog_logging.h> #include <cutils/properties.h> #include <private/android_filesystem_config.h> @@ -190,7 +190,7 @@ void UserCollector::EnqueueCollectionErrorLog(pid_t pid, AddCrashMetaData("sig", kCollectionErrorSignature); AddCrashMetaData("error_type", GetErrorTypeSignature(error_type)); std::string dump_basename = FormatDumpBasename(exec, time(nullptr), pid); - std::string error_log = chromeos::GetLog(); + std::string error_log = brillo::GetLog(); FilePath diag_log_path = GetCrashPath(crash_path, dump_basename, "diaglog"); if (GetLogContents(FilePath(log_config_path_), kCollectionErrorSignature, diag_log_path)) { @@ -370,7 +370,7 @@ bool UserCollector::RunCoreToMinidump(const FilePath &core_path, const FilePath &minidump_path, const FilePath &temp_directory) { FilePath output_path = temp_directory.Append("output"); - chromeos::ProcessImpl core2md; + brillo::ProcessImpl core2md; core2md.RedirectOutput(output_path.value()); core2md.AddArg(kCoreToMinidumpConverterPath); core2md.AddArg(core_path.value()); @@ -514,7 +514,7 @@ UserCollector::ErrorType UserCollector::ConvertAndEnqueueCrash( property_get(kProductIDProperty, value, "undefined"); AddCrashMetaUploadData("prod", value); - chromeos::OsReleaseReader reader; + brillo::OsReleaseReader reader; reader.Load(); std::string bdk_version = "undefined"; if (!reader.GetString(kBdkVersionKey, &bdk_version)) { diff --git a/crash_reporter/user_collector_test.cc b/crash_reporter/user_collector_test.cc index 1dfac2ae4..72e61e63f 100644 --- a/crash_reporter/user_collector_test.cc +++ b/crash_reporter/user_collector_test.cc @@ -23,12 +23,12 @@ #include <base/files/file_util.h> #include <base/files/scoped_temp_dir.h> #include <base/strings/string_split.h> -#include <chromeos/syslog_logging.h> +#include <brillo/syslog_logging.h> #include <gmock/gmock.h> #include <gtest/gtest.h> using base::FilePath; -using chromeos::FindLog; +using brillo::FindLog; namespace { @@ -73,7 +73,7 @@ class UserCollectorTest : public ::testing::Test { base::DeleteFile(FilePath("test"), true); mkdir("test", 0777); pid_ = getpid(); - chromeos::ClearLog(); + brillo::ClearLog(); } protected: @@ -222,7 +222,7 @@ TEST_F(UserCollectorTest, GetExecutableBaseNameFromPid) { "GetSymlinkTarget failed - Path /proc/0 DirectoryExists: 0")); EXPECT_TRUE(FindLog("stat /proc/0/exe failed: -1 2")); - chromeos::ClearLog(); + brillo::ClearLog(); pid_t my_pid = getpid(); EXPECT_TRUE(collector_.GetExecutableBaseNameFromPid(my_pid, &base_name)); EXPECT_FALSE(FindLog("Readlink failed")); |