fixup! [M108 Migration][API] Implement ewk_view_session_timeout_set internal API 55/308655/4
authorsidpaswan <s.paswan@samsung.com>
Thu, 28 Mar 2024 10:05:35 +0000 (15:35 +0530)
committerBot Blink <blinkbot@samsung.com>
Fri, 29 Mar 2024 00:54:58 +0000 (00:54 +0000)
The crash observed was due introduction of CHECK failure in
To<LocalDOMWindow>(GetExecutionContext()) . The code has been
modified accordingly to bypass this check fail and also added
nullptr condition check for the same.

Change-Id: Id01d38092bb9d1badd9828286cb870403039fb9f
Signed-off-by: sidpaswan <s.paswan@samsung.com>
third_party/blink/renderer/core/xmlhttprequest/xml_http_request.cc

index 59b34074f9009cb54b7493a0450ef63a91ca7450..46a77e9bcbfd6347d531f9a22d4b49bda231f1f6 100644 (file)
@@ -1222,12 +1222,16 @@ void XMLHttpRequest::CreateRequest(scoped_refptr<EncodedFormData> http_body,
 
   loader_ = MakeGarbageCollected<ThreadableLoader>(execution_context, this,
                                                    resource_loader_options);
-#if defined(USE_EFL)
+#if BUILDFLAG(IS_EFL)
   uint64_t timeout_milliseconds_global = 0;
-  auto* document = To<LocalDOMWindow>(GetExecutionContext())->document();
-  if (execution_context.IsWindow() && document && document->GetPage()) {
-    timeout_milliseconds_global =
-        document->GetPage()->GetLongPollingGlobalTimeout() * 1000;
+
+  if (execution_context.IsWindow() &&
+      DynamicTo<LocalDOMWindow>(&execution_context)) {
+    auto* document = To<LocalDOMWindow>(GetExecutionContext())->document();
+    if (document && document->GetPage()) {
+      timeout_milliseconds_global =
+          document->GetPage()->GetLongPollingGlobalTimeout() * 1000;
+    }
   }
 
   uint64_t timeout_to_set = timeout();