chore: add V8 crash information to crashReporter (#24771)
* feat: add V8 crash information to crashReporter * Address review feedback
This commit is contained in:
parent
d93bb34ac4
commit
948cc08265
4 changed files with 61 additions and 0 deletions
|
@ -128,6 +128,16 @@ std::vector<v8::Local<v8::Value>> GetWeaklyTrackedValues(v8::Isolate* isolate) {
|
|||
}
|
||||
return locals;
|
||||
}
|
||||
|
||||
// This causes a fatal error by creating a circular extension dependency.
|
||||
void TriggerFatalErrorForTesting(v8::Isolate* isolate) {
|
||||
static const char* aDeps[] = {"B"};
|
||||
v8::RegisterExtension(std::make_unique<v8::Extension>("A", "", 1, aDeps));
|
||||
static const char* bDeps[] = {"A"};
|
||||
v8::RegisterExtension(std::make_unique<v8::Extension>("B", "", 1, bDeps));
|
||||
v8::ExtensionConfiguration config(1, bDeps);
|
||||
v8::Context::New(isolate, &config);
|
||||
}
|
||||
#endif
|
||||
|
||||
void Initialize(v8::Local<v8::Object> exports,
|
||||
|
@ -144,6 +154,7 @@ void Initialize(v8::Local<v8::Object> exports,
|
|||
&RequestGarbageCollectionForTesting);
|
||||
dict.SetMethod("isSameOrigin", &IsSameOrigin);
|
||||
#ifdef DCHECK_IS_ON
|
||||
dict.SetMethod("triggerFatalErrorForTesting", &TriggerFatalErrorForTesting);
|
||||
dict.SetMethod("getWeaklyTrackedValues", &GetWeaklyTrackedValues);
|
||||
dict.SetMethod("clearWeaklyTrackedValues", &ClearWeaklyTrackedValues);
|
||||
dict.SetMethod("weaklyTrackValue", &WeaklyTrackValue);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue