Commit cce33421 authored by Taoyu Li's avatar Taoyu Li Committed by Chromium LUCI CQ

Add a new routes view in feedback log for IPv6 routes

BUG=b:175079058
TEST=manual: verify routes6 view is included in feedback log.

Change-Id: I192efc11547d7169d22d8f252ef10fa5177d9d70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2578338Reviewed-by: default avatarMiriam Zimmerman <mutexlox@chromium.org>
Reviewed-by: default avatarIan Barkley-Yeung <iby@chromium.org>
Reviewed-by: default avatarHugo Benichi <hugobenichi@google.com>
Auto-Submit: Taoyu Li <taoyl@chromium.org>
Commit-Queue: Taoyu Li <taoyl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836543}
parent 86d06d94
......@@ -35,6 +35,7 @@ namespace {
constexpr char kNotAvailable[] = "<not available>";
constexpr char kRoutesKeyName[] = "routes";
constexpr char kRoutesv6KeyName[] = "routes6";
constexpr char kLogTruncated[] = "<earlier logs truncated>\n";
// List of user log files that Chrome reads directly as these logs are generated
......@@ -115,7 +116,12 @@ void DebugDaemonLogSource::Fetch(SysLogsSourceCallback callback) {
client->GetRoutes(true, // Numeric
false, // No IPv6
base::BindOnce(&DebugDaemonLogSource::OnGetRoutes,
weak_ptr_factory_.GetWeakPtr()));
weak_ptr_factory_.GetWeakPtr(), false));
++num_pending_requests_;
client->GetRoutes(true, // Numeric
true, // with IPv6
base::BindOnce(&DebugDaemonLogSource::OnGetRoutes,
weak_ptr_factory_.GetWeakPtr(), true));
++num_pending_requests_;
if (scrub_) {
......@@ -134,12 +140,13 @@ void DebugDaemonLogSource::Fetch(SysLogsSourceCallback callback) {
}
void DebugDaemonLogSource::OnGetRoutes(
bool is_ipv6,
base::Optional<std::vector<std::string>> routes) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
(*response_)[kRoutesKeyName] = routes.has_value()
? base::JoinString(routes.value(), "\n")
: kNotAvailable;
std::string key = is_ipv6 ? kRoutesv6KeyName : kRoutesKeyName;
(*response_)[key] = routes.has_value()
? base::JoinString(routes.value(), "\n")
: kNotAvailable;
RequestCompleted();
}
......
......@@ -43,7 +43,8 @@ class DebugDaemonLogSource : public SystemLogsSource {
typedef std::map<std::string, std::string> KeyValueMap;
// Callbacks for the dbus calls to debugd.
void OnGetRoutes(base::Optional<std::vector<std::string>> routes);
void OnGetRoutes(bool is_ipv6,
base::Optional<std::vector<std::string>> routes);
void OnGetOneLog(std::string key, base::Optional<std::string> status);
void OnGetLogs(bool succeeded,
const KeyValueMap& logs);
......
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