Skip to content
Snippets Groups Projects
Commit d5c17116 authored by Baran Erfani's avatar Baran Erfani Committed by Chromium LUCI CQ
Browse files

[DNT] Added a feature flag to guard dump without crash statements

(cherry picked from commit 622b01b4)

Dump without crashes can be noisy in stable. This flag will enable us to
turn it off and on in different versions of Chrome avoiding extra noises
while being informed about them happening.


Bug: 374365779, 373617224, 375170577
Change-Id: Iee0536c303a571f962b1816667d2fbc67da8ff46
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5950247


Reviewed-by: default avatarWilliam Liu <liuwilliam@chromium.org>
Reviewed-by: default avatarKhushal Sagar <khushalsagar@chromium.org>
Commit-Queue: Baran Erfani <baranerf@google.com>
Cr-Original-Commit-Position: refs/heads/main@{#1372216}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5953097
Cr-Commit-Position: refs/branch-heads/6778@{#791}
Cr-Branched-From: b21671ca-refs/heads/main@{#1368529}
parent 3dede127
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,8 @@
#include "content/public/browser/back_forward_transition_animation_manager.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "third_party/blink/public/common/features.h"
#include "ui/android/view_android.h"
#include "ui/android/window_android.h"
#include "ui/gfx/geometry/point_f.h"
......@@ -19,6 +21,10 @@ namespace gesturenav {
namespace {
const base::FeatureParam<bool> kDumpWithoutCrashTabOnBackGestureHandler{
&blink::features::kBackForwardTransitions,
"dump-without-crash-tab-on-back-gesture-handler", false};
using NavDirection =
content::BackForwardTransitionAnimationManager::NavigationDirection;
......@@ -42,7 +48,9 @@ void TabOnBackGestureHandler::OnBackStarted(JNIEnv* env,
// gesture but we see this pattern on multiple devices.
// See crbug.com/41484247.
if (is_in_progress_) {
base::debug::DumpWithoutCrashing();
if (kDumpWithoutCrashTabOnBackGestureHandler.Get()) {
base::debug::DumpWithoutCrashing();
}
OnBackCancelled(env);
CHECK(!is_in_progress_);
}
......@@ -72,19 +80,21 @@ void TabOnBackGestureHandler::OnBackProgressed(JNIEnv* env,
// however, we see multiple instances with different edge values from
// start to progress. See crbug.com/370105609.
started_edge_ != static_cast<ui::BackGestureEventSwipeEdge>(edge)) {
std::ostringstream strs;
strs << std::fixed << std::setprecision(6) << progress;
SCOPED_CRASH_KEY_STRING64("OnBackProgressed", "progress", strs.str());
SCOPED_CRASH_KEY_STRING32(
"OnBackProgressed", "started edge",
started_edge_ == ui::BackGestureEventSwipeEdge::LEFT ? "left"
: "right");
SCOPED_CRASH_KEY_STRING32("OnBackProgressed", "edge",
edge == 0 ? "left" : "right");
SCOPED_CRASH_KEY_BOOL("OnBackProgressed", "forward", forward);
SCOPED_CRASH_KEY_BOOL("OnBackProgressed", "is in progress",
is_in_progress_);
base::debug::DumpWithoutCrashing();
if (kDumpWithoutCrashTabOnBackGestureHandler.Get()) {
std::ostringstream strs;
strs << std::fixed << std::setprecision(6) << progress;
SCOPED_CRASH_KEY_STRING64("OnBackProgressed", "progress", strs.str());
SCOPED_CRASH_KEY_STRING32(
"OnBackProgressed", "started edge",
started_edge_ == ui::BackGestureEventSwipeEdge::LEFT ? "left"
: "right");
SCOPED_CRASH_KEY_STRING32("OnBackProgressed", "edge",
edge == 0 ? "left" : "right");
SCOPED_CRASH_KEY_BOOL("OnBackProgressed", "forward", forward);
SCOPED_CRASH_KEY_BOOL("OnBackProgressed", "is in progress",
is_in_progress_);
base::debug::DumpWithoutCrashing();
}
OnBackCancelled(env);
CHECK(!is_in_progress_);
......
......@@ -12,11 +12,17 @@
#include "content/browser/renderer_host/navigation_transitions/navigation_transition_config.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/common/content_features.h"
#include "third_party/blink/public/common/features.h"
namespace content {
namespace {
const base::FeatureParam<bool> kDumpWithoutCrashNavigationEntryScreenshotCache{
&blink::features::kBackForwardTransitions,
"dump-without-crash-navigation-entry-screenshot-cache", false};
NavigationEntryScreenshotCache::CompressedCallback& GetTestCallback() {
static base::NoDestructor<NavigationEntryScreenshotCache::CompressedCallback>
instance;
......@@ -131,9 +137,11 @@ void NavigationEntryScreenshotCache::SetScreenshotInternal(
// Should never capture the last committed entry.
if (entry == nav_controller_->GetLastCommittedEntry()) {
SCOPED_CRASH_KEY_BOOL("dnt", "is_copied_from_embedder",
is_copied_from_embedder);
base::debug::DumpWithoutCrashing();
if (kDumpWithoutCrashNavigationEntryScreenshotCache.Get()) {
SCOPED_CRASH_KEY_BOOL("dnt", "is_copied_from_embedder",
is_copied_from_embedder);
base::debug::DumpWithoutCrashing();
}
return;
}
......@@ -141,7 +149,9 @@ void NavigationEntryScreenshotCache::SetScreenshotInternal(
// first (thus not tracked). Impossible to overwrite for a cached entry.
// TODO(crbug.com/373893401): Find out why this happens.
if (entry->GetUserData(NavigationEntryScreenshot::kUserDataKey)) {
base::debug::DumpWithoutCrashing();
if (kDumpWithoutCrashNavigationEntryScreenshotCache.Get()) {
base::debug::DumpWithoutCrashing();
}
RemoveScreenshot(entry);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment