File: debug_utils.h

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (73 lines) | stat: -rw-r--r-- 3,091 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CONTENT_COMMON_DEBUG_UTILS_H_
#define CONTENT_COMMON_DEBUG_UTILS_H_

namespace content {

// There are cases that require debugging of complex multiprocess scenarios in
// which tools such as DumpWithoutCrashing and tracing can be useful.
// The goal of this enum is to be able to log to UMA when such complex scenarios
// occur with two goals:
// * Get an idea of the magnitute of the problem, since just crash reports
//   cannot express this, given they are throttled client side.
// * For clients which have continuous tracing enabled, upload a snapshot of the
//   trace to aid understanding of the interactions between all processes.
//
// Usage: Add a new value to the DebugScenario enum below and call
//   CaptureTraceForNavigationDebugScenario(YOUR_NEW_ENUM_VALUE);
// from the location where you are hitting the scenario you care about.
//
// NOTE: Do not renumber elements in this list. Add new entries at the end.
// Items may be renamed but do not change the values. We rely on the enum values
// in histograms.

enum class DebugScenario {
  kDebugSameDocNavigationDocIdMismatch = 1,

  // A non-main frame navigation with old_page_info set was detected.
  kDebugNonMainFrameWithOldPageInfo = 2,

  // Metrics and the bfcache situations do not match.
  kDebugBackForwardCacheMetricsMismatch = 3,

  // Detected a mismatch between the origin to commit as calculated on 1) the
  // browser-side VS 2) the renderer-side.
  kDebugBrowserVsRendererOriginToCommit = 4,

  // Evict-Restore race in Back Forward Cache - Renderer requested a frame be
  // evicted from cache, but the frame is no longer in the cache.
  kDebugBackForwardCacheEvictRestoreRace = 5,

  // HTTP response_head was unexpectedly nullptr even for HTTP or HTTPS schemes.
  kDebugNoResponseHeadForHttpOrHttps = 6,

  // RenderViewHost is not present when trying to create a new subframe's
  // RenderFrameProxyHost.
  kDebugSubframeProxyCreationWithNoRVH = 7,

  // BackForwardCacheEntry exists for a subframe history navigation.
  kDebugBackForwardCacheEntryExistsOnSubframeHistoryNav = 8,

  // RenderFrameProxyHost does not exist when trying to call
  // RenderFrameProxyHost::SetFocusedFrame().
  // 9: kDebugNoRenderFrameProxyHostOnSetFocusedFrame was removed.

  // The RenderFrameHost to be restored from the back/forward cache no longer
  // exists for a navigation that is not marked as being restarted.
  // 10: kDebugNoRestoredRFHOnNonRestartedNavigation was removed.

  // After making changes, you MUST update the histograms xml by running:
  // "python tools/metrics/histograms/update_debug_scenarios.py"
  kMaxValue = kDebugBackForwardCacheEntryExistsOnSubframeHistoryNav,
};

// The tracing categories enabled for debugging navigation scenarios can be
// found in server-side studies config for slow reports.
void CaptureTraceForNavigationDebugScenario(DebugScenario scenario);

}  // namespace content

#endif  // CONTENT_COMMON_DEBUG_UTILS_H_