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();