Commit 7213338a authored by Alice Boxhall's avatar Alice Boxhall Committed by Commit Bot

Revert "Enable Lacros to send a simple feedback report with all Lacros data."

This reverts commit 4f00646f.

Reason for revert: Broke feedback_common_test on lacros:
https://ci.chromium.org/p/chromium/builders/ci/linux-lacros-tester-rel/1305

Original change's description:
> Enable Lacros to send a simple feedback report with all Lacros data.
> 
> The simple lacros feedback report includes the following:
> 
> 1. Lacros feedback reports are sent with ChromeOS product id, so
> that they will be found under ChromeOS product on Listnr.
> 
> 2. Prefix the chrome version string with "Lacros ", so that lacros
> reports can be filtered by "Version" (for example "Lacros") on Listnr.
> 
> 3. Attach lacros user log in the system log.
> 
> Bug:1109387
> TEST:
> 1. Open Lacros browser, send a feedback report by clicking
> "Report an issue" under Help menu.
> 2. Verify the report can be found at
> http://listnr site. The chrome version string should have
> a "Lacros " at the beginning, for example, "Lacros 86.0.4238.0".
> 3. Verify the report contains both system_logs.zip and histograms.zip.
> The system log should contain lacros log data from
> /home/chronos/user/lacros/lacros.log under "lacros_user_log" section.
> 
> 
> Change-Id: I98b381724866d163dc760147448a80e2249c0a1b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2362977
> Commit-Queue: Jenny Zhang <jennyz@chromium.org>
> Reviewed-by: Miriam Zimmerman <mutexlox@chromium.org>
> Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
> Reviewed-by: James Cook <jamescook@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#800772}

TBR=jamescook@chromium.org,jennyz@chromium.org,afakhry@chromium.org,mutexlox@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1109387
Change-Id: Ibc3fa78f5ddd42860d858e4f84d38ba87090a263
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2371422Reviewed-by: default avatarAlice Boxhall <aboxhall@chromium.org>
Commit-Queue: Alice Boxhall <aboxhall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800905}
parent 8362598c
...@@ -4108,8 +4108,6 @@ static_library("browser") { ...@@ -4108,8 +4108,6 @@ static_library("browser") {
"chrome_browser_main_extra_parts_lacros.h", "chrome_browser_main_extra_parts_lacros.h",
"lacros/lacros_chrome_service_delegate_impl.cc", "lacros/lacros_chrome_service_delegate_impl.cc",
"lacros/lacros_chrome_service_delegate_impl.h", "lacros/lacros_chrome_service_delegate_impl.h",
"lacros/system_logs/user_log_files_log_source.cc",
"lacros/system_logs/user_log_files_log_source.h",
"metrics/lacros_metrics_provider.cc", "metrics/lacros_metrics_provider.cc",
"metrics/lacros_metrics_provider.h", "metrics/lacros_metrics_provider.h",
"notifications/notification_platform_bridge_chromeos.cc", "notifications/notification_platform_bridge_chromeos.cc",
......
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <memory> #include <memory>
#include "build/build_config.h" #include "build/build_config.h"
#include "build/lacros_buildflags.h"
#include "chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h" #include "chrome/browser/feedback/system_logs/log_sources/chrome_internal_log_source.h"
#include "chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h" #include "chrome/browser/feedback/system_logs/log_sources/crash_ids_source.h"
#include "chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.h" #include "chrome/browser/feedback/system_logs/log_sources/memory_details_log_source.h"
...@@ -26,10 +25,6 @@ ...@@ -26,10 +25,6 @@
#include "chrome/browser/chromeos/system_logs/ui_hierarchy_log_source.h" #include "chrome/browser/chromeos/system_logs/ui_hierarchy_log_source.h"
#endif #endif
#if BUILDFLAG(IS_LACROS)
#include "chrome/browser/lacros/system_logs/user_log_files_log_source.h"
#endif
namespace system_logs { namespace system_logs {
SystemLogsFetcher* BuildChromeSystemLogsFetcher(bool scrub_data) { SystemLogsFetcher* BuildChromeSystemLogsFetcher(bool scrub_data) {
...@@ -55,10 +50,6 @@ SystemLogsFetcher* BuildChromeSystemLogsFetcher(bool scrub_data) { ...@@ -55,10 +50,6 @@ SystemLogsFetcher* BuildChromeSystemLogsFetcher(bool scrub_data) {
fetcher->AddSource(std::make_unique<UiHierarchyLogSource>(scrub_data)); fetcher->AddSource(std::make_unique<UiHierarchyLogSource>(scrub_data));
#endif #endif
#if BUILDFLAG(IS_LACROS)
fetcher->AddSource(std::make_unique<UserLogFilesLogSource>());
#endif
return fetcher; return fetcher;
} }
......
...@@ -68,9 +68,6 @@ constexpr char kExtensionsListKey[] = "extensions"; ...@@ -68,9 +68,6 @@ constexpr char kExtensionsListKey[] = "extensions";
constexpr char kPowerApiListKey[] = "chrome.power extensions"; constexpr char kPowerApiListKey[] = "chrome.power extensions";
constexpr char kDataReductionProxyKey[] = "data_reduction_proxy"; constexpr char kDataReductionProxyKey[] = "data_reduction_proxy";
constexpr char kChromeVersionTag[] = "CHROME VERSION"; constexpr char kChromeVersionTag[] = "CHROME VERSION";
#if BUILDFLAG(IS_LACROS)
constexpr char kLacrosChromeVersionPrefix[] = "Lacros ";
#endif
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
constexpr char kArcPolicyComplianceReportKey[] = constexpr char kArcPolicyComplianceReportKey[] =
"CHROMEOS_ARC_POLICY_COMPLIANCE_REPORT"; "CHROMEOS_ARC_POLICY_COMPLIANCE_REPORT";
...@@ -269,14 +266,7 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) { ...@@ -269,14 +266,7 @@ void ChromeInternalLogSource::Fetch(SysLogsSourceCallback callback) {
auto response = std::make_unique<SystemLogsResponse>(); auto response = std::make_unique<SystemLogsResponse>();
#if BUILDFLAG(IS_LACROS)
// Add a Lacros prefix string in the chrome version string to
// differentiate lacros chrome vs ash chrome in the feedback report.
response->emplace(kChromeVersionTag,
kLacrosChromeVersionPrefix + chrome::GetVersionString());
#else
response->emplace(kChromeVersionTag, chrome::GetVersionString()); response->emplace(kChromeVersionTag, chrome::GetVersionString());
#endif
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
response->emplace(kChromeEnrollmentTag, GetEnrollmentStatusString()); response->emplace(kChromeEnrollmentTag, GetEnrollmentStatusString());
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/lacros/system_logs/user_log_files_log_source.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "components/feedback/feedback_util.h"
#include "content/public/browser/browser_thread.h"
namespace system_logs {
namespace {
constexpr char kDefaultLogPath[] = "/home/chronos/user/lacros/lacros.log";
constexpr char kLogKey[] = "lacros_user_log";
// Maximum buffer size for user logs in bytes.
const int64_t kMaxLogSize = 1024 * 1024;
constexpr char kLogTruncated[] = "<earlier logs truncated>\n";
constexpr char kNotAvailable[] = "<not available>";
} // namespace
UserLogFilesLogSource::UserLogFilesLogSource()
: SystemLogsSource("UserLoggedFiles"),
response_(std::make_unique<SystemLogsResponse>()) {}
UserLogFilesLogSource::~UserLogFilesLogSource() = default;
void UserLogFilesLogSource::Fetch(SysLogsSourceCallback callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK(!callback.is_null());
auto response = std::make_unique<SystemLogsResponse>();
auto* response_ptr = response.get();
const base::FilePath log_file_path = base::FilePath(kDefaultLogPath);
base::ThreadPool::PostTaskAndReply(
FROM_HERE, {base::MayBlock(), base::TaskPriority::BEST_EFFORT},
base::BindOnce(&UserLogFilesLogSource::ReadFile,
weak_ptr_factory_.GetWeakPtr(), log_file_path, kLogKey,
response_ptr),
base::BindOnce(std::move(callback), std::move(response)));
callback_ = std::move(callback);
}
void UserLogFilesLogSource::ReadFile(const base::FilePath& log_file_path,
const std::string& log_key,
SystemLogsResponse* response) {
std::string value;
const bool read_success =
feedback_util::ReadEndOfFile(log_file_path, kMaxLogSize, &value);
if (read_success && value.length() == kMaxLogSize) {
value.replace(0, strlen(kLogTruncated), kLogTruncated);
LOG(WARNING) << "Large log file was likely truncated: " << log_file_path;
}
response->emplace(log_key, (read_success && !value.empty()) ? std::move(value)
: kNotAvailable);
}
} // namespace system_logs
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_LACROS_SYSTEM_LOGS_USER_LOG_FILES_LOG_SOURCE_H_
#define CHROME_BROWSER_LACROS_SYSTEM_LOGS_USER_LOG_FILES_LOG_SOURCE_H_
#include <string>
#include "base/files/file_path.h"
#include "base/memory/weak_ptr.h"
#include "components/feedback/system_logs/system_logs_source.h"
namespace system_logs {
// This class gathers log data from Lacros user log files.
class UserLogFilesLogSource : public SystemLogsSource {
public:
UserLogFilesLogSource();
~UserLogFilesLogSource() override;
UserLogFilesLogSource(const UserLogFilesLogSource&) = delete;
UserLogFilesLogSource& operator=(const UserLogFilesLogSource&) = delete;
// SystemLogsSource override:
void Fetch(SysLogsSourceCallback callback) override;
private:
void ReadFile(const base::FilePath& log_file_path,
const std::string& log_key,
SystemLogsResponse* response);
std::unique_ptr<SystemLogsResponse> response_;
SysLogsSourceCallback callback_;
base::WeakPtrFactory<UserLogFilesLogSource> weak_ptr_factory_{this};
};
} // namespace system_logs
#endif // CHROME_BROWSER_LACROS_SYSTEM_LOGS_USER_LOG_FILES_LOG_SOURCE_H_
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <utility> #include <utility>
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "build/lacros_buildflags.h"
#include "components/feedback/feedback_report.h" #include "components/feedback/feedback_report.h"
#include "components/feedback/feedback_util.h" #include "components/feedback/feedback_util.h"
#include "components/feedback/proto/common.pb.h" #include "components/feedback/proto/common.pb.h"
...@@ -18,7 +17,7 @@ ...@@ -18,7 +17,7 @@
namespace { namespace {
#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS) #if defined(OS_CHROMEOS)
constexpr int kChromeOSProductId = 208; constexpr int kChromeOSProductId = 208;
#else #else
constexpr int kChromeBrowserProductId = 237; constexpr int kChromeBrowserProductId = 237;
...@@ -124,7 +123,7 @@ void FeedbackCommon::PrepareReport( ...@@ -124,7 +123,7 @@ void FeedbackCommon::PrepareReport(
// Set whether we're reporting from ChromeOS or Chrome on another platform. // Set whether we're reporting from ChromeOS or Chrome on another platform.
userfeedback::ChromeData chrome_data; userfeedback::ChromeData chrome_data;
#if defined(OS_CHROMEOS) || BUILDFLAG(IS_LACROS) #if defined(OS_CHROMEOS)
const userfeedback::ChromeData_ChromePlatform chrome_platform = const userfeedback::ChromeData_ChromePlatform chrome_platform =
userfeedback::ChromeData_ChromePlatform_CHROME_OS; userfeedback::ChromeData_ChromePlatform_CHROME_OS;
const int default_product_id = kChromeOSProductId; const int default_product_id = kChromeOSProductId;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment