Skip to content

Commit 0a16b60

Browse files
browser(webkit): fix crash when a worker is terminated while logging (#797)
1 parent 0007439 commit 0a16b60

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

browser_patches/webkit/BUILD_NUMBER

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1131
1+
1132

browser_patches/webkit/patches/bootstrap.diff

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,25 @@ index eb25aedee4cd9ebe007e06c2515b37ee095b06f4..badf6559595c8377db1089ca3c25008e
103103
static String createIdentifier();
104104
static String requestId(unsigned long identifier);
105105
};
106+
diff --git a/Source/JavaScriptCore/inspector/InjectedScript.cpp b/Source/JavaScriptCore/inspector/InjectedScript.cpp
107+
index cc849f051fa40518a9d1a03429bc2b4dbcfb3102..11b05346f6098fa23f51ba9abc1af0e0e60a626c 100644
108+
--- a/Source/JavaScriptCore/inspector/InjectedScript.cpp
109+
+++ b/Source/JavaScriptCore/inspector/InjectedScript.cpp
110+
@@ -287,9 +287,13 @@ RefPtr<Protocol::Runtime::RemoteObject> InjectedScript::wrapObject(JSC::JSValue
111+
auto callResult = callFunctionWithEvalEnabled(wrapFunction);
112+
if (!callResult)
113+
return nullptr;
114+
+ auto callResultValue = callResult.value();
115+
+ // callResultValue could be missing if the execution was terminated
116+
+ if (!callResultValue)
117+
+ return nullptr;
118+
119+
RefPtr<JSON::Object> resultObject;
120+
- bool castSucceeded = toInspectorValue(globalObject(), callResult.value())->asObject(resultObject);
121+
+ bool castSucceeded = toInspectorValue(globalObject(), callResultValue)->asObject(resultObject);
122+
ASSERT_UNUSED(castSucceeded, castSucceeded);
123+
124+
return BindingTraits<Protocol::Runtime::RemoteObject>::runtimeCast(resultObject);
106125
diff --git a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp b/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp
107126
index 038cb646d31706905deff8935040d63c0afd00f9..2fca7b043f15a8cce3819cc827912fb719a345db 100644
108127
--- a/Source/JavaScriptCore/inspector/InspectorBackendDispatcher.cpp

0 commit comments

Comments
 (0)