Skip to content

Commit f2423d2

Browse files
committed
Remove HostHtmlDocumentServiceProvider as it is always NULL
1 parent caed8c0 commit f2423d2

File tree

2 files changed

+2
-27
lines changed

2 files changed

+2
-27
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Interop/BrowserInteropHelper.cs

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -87,32 +87,7 @@ internal static bool IsInitialViewerNavigation
8787
}
8888
}
8989

90-
/// <summary>
91-
/// Retrieves the IServiceProvider object for the browser we're hosted in.
92-
/// This is used for IDispatchEx operations in the script interop feature.
93-
/// Critical: Returns critical type UnsafeNativeMethods.IServiceProvider
94-
/// </summary>
95-
internal static UnsafeNativeMethods.IServiceProvider HostHtmlDocumentServiceProvider
96-
{
97-
get
98-
{
99-
// HostHtmlDocumentServiceProvider is used by DynamicScriptObject for IDispatchEx
100-
// operations in case of IE. During initialization we get the document node from
101-
// the DOM to obtain the required service provider. During this short timeframe
102-
// it's valid to have a null-value returned here. In all other cases, we make sure
103-
// not to run with a null service provider for sake of security.
104-
// See InitializeHostHtmlDocumentServiceProvider as well.
105-
/* TODO: straighten this with browser flags to check only when hosted in IE */
106-
Invariant.Assert(!(_initializedHostScript && _hostHtmlDocumentServiceProvider == null));
107-
108-
return _hostHtmlDocumentServiceProvider;
109-
}
110-
}
111-
11290
private static bool _isInitialViewerNavigation;
113-
114-
private static UnsafeNativeMethods.IServiceProvider _hostHtmlDocumentServiceProvider;
115-
private static bool _initializedHostScript;
11691
}
11792
}
11893

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Interop/DynamicScriptObject.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,12 +568,12 @@ private HRESULT InvokeOnScriptObject(int dispid, int flags, NativeMethods.DISPPA
568568
//
569569
// That is why we switch to invoking the script via IDispatch with SUCS on the methods.
570570

571-
if (_scriptObjectEx != null)
571+
if (_scriptObjectEx != null) // TODO: This code path is never taken outside XBAP
572572
{
573573
// This case takes care of IE hosting where the use of IDispatchEx is recommended by IE people
574574
// since the service provider object we can pass here is used by the browser to enforce cross-
575575
// zone scripting mitigations.
576-
return _scriptObjectEx.InvokeEx(dispid, Thread.CurrentThread.CurrentCulture.LCID, flags, dp, out result, exInfo, BrowserInteropHelper.HostHtmlDocumentServiceProvider);
576+
return _scriptObjectEx.InvokeEx(dispid, Thread.CurrentThread.CurrentCulture.LCID, flags, dp, out result, exInfo, null);
577577
}
578578
else
579579
{

0 commit comments

Comments
 (0)