diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/fuchsia/base/feedback_registration.cc | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/fuchsia/base/feedback_registration.cc')
-rw-r--r-- | chromium/fuchsia/base/feedback_registration.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/chromium/fuchsia/base/feedback_registration.cc b/chromium/fuchsia/base/feedback_registration.cc new file mode 100644 index 00000000000..d8bee5ff647 --- /dev/null +++ b/chromium/fuchsia/base/feedback_registration.cc @@ -0,0 +1,30 @@ +// 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 "fuchsia/base/feedback_registration.h" + +#include <fuchsia/feedback/cpp/fidl.h> +#include <lib/sys/cpp/component_context.h> + +#include "base/fuchsia/process_context.h" +#include "base/strings/string_piece.h" +#include "components/version_info/version_info.h" + +namespace cr_fuchsia { + +void RegisterCrashReportingFields(base::StringPiece component_url, + base::StringPiece crash_product_name) { + fuchsia::feedback::CrashReportingProduct product_data; + product_data.set_name(crash_product_name.as_string()); + product_data.set_version(version_info::GetVersionNumber()); + // TODO(https://crbug.com/1077428): Use the actual channel when appropriate. + // For now, always set it to the empty string to avoid reporting "missing". + product_data.set_channel(""); + base::ComponentContextForProcess() + ->svc() + ->Connect<fuchsia::feedback::CrashReportingProductRegister>() + ->Upsert(component_url.as_string(), std::move(product_data)); +} + +} // namespace cr_fuchsia |