File: crash_export_thunks.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 (84 lines) | stat: -rw-r--r-- 3,778 bytes parent folder | download | duplicates (6)
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
74
75
76
77
78
79
80
81
82
83
84
// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_CRASH_CORE_APP_CRASH_EXPORT_THUNKS_H_
#define COMPONENTS_CRASH_CORE_APP_CRASH_EXPORT_THUNKS_H_

#include <windows.h>

#include <stddef.h>
#include <time.h>

#include "build/build_config.h"

namespace crash_reporter {
struct ProductInfo;
struct Report;
}  // namespace crash_reporter

extern "C" {

// All the functions in this file are named with a suffix of _ExportThunk to
// make sure their names cannot easily collide with random other functions.
// The Microsoft Visual Studio linker has a misfeature where it searches rather
// aggressively for functions to match exports in .DEF files.
// See https://crbug.com/760385#c11 for how this can be bad.

// This function may be invoked across module boundaries to request a single
// crash report upload. See CrashUploadListCrashpad.
void RequestSingleCrashUpload_ExportThunk(const char* local_id);

// This function may be invoked across module boundaries to retrieve the crash
// list. It copies up to |report_count| reports into |reports| and returns the
// number of reports available. If the return value is less than or equal to
// |reports_size|, then |reports| contains all the available reports.
size_t GetCrashReports_ExportThunk(crash_reporter::Report* reports,
                                   size_t reports_size);

// Crashes the process after generating a dump for the provided exception. Note
// that the crash reporter should be initialized before calling this function
// for it to do anything.
// NOTE: This function is used by SyzyASAN to invoke a crash. If you change the
// the name or signature of this function you will break SyzyASAN instrumented
// releases of Chrome. Please contact syzygy-team@chromium.org before doing so!
int CrashForException_ExportThunk(EXCEPTION_POINTERS* info);

// This function is used in chrome_metrics_services_manager_client.cc to trigger
// changes to the upload-enabled state. This is done when the metrics services
// are initialized, and when the user changes their consent for uploads. See
// crash_reporter::SetUploadConsent for effects. The given consent value should
// be consistent with
// crash_reporter::GetCrashReporterClient()->GetCollectStatsConsent(), but it's
// not enforced to avoid blocking startup code on synchronizing them.
void SetUploadConsent_ExportThunk(bool consent);

// Returns the current upload consent state.
// This function is used by JS Error reporting which lives in chrome.dll.
bool GetUploadConsent_ExportThunk();

// Returns a textual description of the product info (product name, version,
// etc.) to include in the crash report.
// This function is used by JS Error reporting which lives in chrome.dll.
void GetProductInfo_ExportThunk(crash_reporter::ProductInfo* product_info);

// Injects a thread into a remote process to dump state when there is no crash.
// |process| that represents serialized crash keys sent from the browser.
// This method is used solely to classify hung input.
HANDLE InjectDumpForHungInput_ExportThunk(HANDLE process);

// Returns the crashpad database path.
const wchar_t* GetCrashpadDatabasePath_ExportThunk();

// This function may be invoked across module boundaries to delete reports
// within the time range. See crash_reporter::ClearReportsBetween.
void ClearReportsBetween_ExportThunk(time_t begin, time_t end);

// Immediately dump |process| to a crash dump adorned with |ptype|.
// Takes ownership of |process|, does not kill nor affect the exit code of
// |process|.
bool DumpHungProcessWithPtype_ExportThunk(HANDLE process, const char* ptype);

}  // extern "C"

#endif  // COMPONENTS_CRASH_CORE_APP_CRASH_EXPORT_THUNKS_H_