Skip to content

Commit a033aca

Browse files
authored
[browser][coreCLR] browserhost improvements (#122233)
1 parent c946b43 commit a033aca

File tree

31 files changed

+209
-156
lines changed

31 files changed

+209
-156
lines changed

src/coreclr/hosts/corerun/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ else()
6161
set(JS_SYSTEM_NATIVE_BROWSER
6262
"${STATIC_LIB_DESTINATION}/libSystem.Native.Browser.js")
6363
set(JS_SYSTEM_BROWSER_UTILS
64-
"${STATIC_LIB_DESTINATION}/libSystem.Browser.Utils.js")
64+
"${STATIC_LIB_DESTINATION}/libSystem.Native.Browser.Utils.js")
6565
set(JS_CORE_RUN
6666
"${CMAKE_CURRENT_SOURCE_DIR}/wasm/libCorerun.extpost.js")
6767
set_target_properties(corerun PROPERTIES

src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@
271271
<PlatformManifestFileEntry Include="libnativeresourcestring.a" IsNative="true" />
272272
<PlatformManifestFileEntry Include="libBrowserHost.js" IsNative="true" />
273273
<PlatformManifestFileEntry Include="libBrowserHost.js.map" IsNative="true" />
274-
<PlatformManifestFileEntry Include="libSystem.Browser.Utils.js" IsNative="true" />
275-
<PlatformManifestFileEntry Include="libSystem.Browser.Utils.js.map" IsNative="true" />
274+
<PlatformManifestFileEntry Include="libSystem.Native.Browser.Utils.js" IsNative="true" />
275+
<PlatformManifestFileEntry Include="libSystem.Native.Browser.Utils.js.map" IsNative="true" />
276276
<PlatformManifestFileEntry Include="libSystem.Native.Browser.js" IsNative="true" />
277277
<PlatformManifestFileEntry Include="libSystem.Native.Browser.js.map" IsNative="true" />
278278
<PlatformManifestFileEntry Include="libSystem.Runtime.InteropServices.JavaScript.Native.js" IsNative="true" />

src/libraries/Common/src/Interop/Browser/Interop.Locale.CoreCLR.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ internal static partial class Interop
88
{
99
internal static unsafe partial class JsGlobalization
1010
{
11-
[LibraryImport(Libraries.JavaScriptNative, EntryPoint = "SystemJS_GetLocaleInfo")]
11+
[LibraryImport(Libraries.SystemBrowserNative, EntryPoint = "SystemJS_GetLocaleInfo")]
1212
public static unsafe partial nint GetLocaleInfo(char* locale, int localeLength, char* culture, int cultureLength, char* buffer, int bufferLength, out int resultLength);
1313
}
1414
}

src/libraries/Common/src/Interop/Browser/Interop.Locale.cs renamed to src/libraries/Common/src/Interop/Browser/Interop.Locale.Mono.cs

File renamed without changes.

src/libraries/Common/src/Interop/Unix/Interop.Libraries.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ internal static partial class Libraries
1313
internal const string CryptoNative = "libSystem.Security.Cryptography.Native.OpenSsl";
1414
internal const string CompressionNative = "libSystem.IO.Compression.Native";
1515
internal const string GlobalizationNative = "libSystem.Globalization.Native";
16+
internal const string JavaScriptNative = "libSystem.Runtime.InteropServices.JavaScript.Native";
1617
internal const string IOPortsNative = "libSystem.IO.Ports.Native";
1718
internal const string HostPolicy = "libhostpolicy";
18-
internal const string JavaScriptNative = "libSystem.JavaScript.Native";
19+
internal const string SystemBrowserNative = "libSystem.Native.Browser";
1920
}
2021
}

src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1378,8 +1378,8 @@
13781378
<Compile Include="$(CommonPath)Interop\Browser\Interop.Locale.CoreCLR.cs" Condition="'$(TargetsBrowser)' == 'true' and '$(RuntimeFlavor)' == 'CoreCLR'">
13791379
<Link>Common\Interop\Browser\Interop.Locale.CoreCLR.cs</Link>
13801380
</Compile>
1381-
<Compile Include="$(CommonPath)Interop\Browser\Interop.Locale.cs" Condition="'$(TargetsBrowser)' == 'true' and '$(RuntimeFlavor)' == 'Mono'">
1382-
<Link>Common\Interop\Browser\Interop.Locale.cs</Link>
1381+
<Compile Include="$(CommonPath)Interop\Browser\Interop.Locale.Mono.cs" Condition="'$(TargetsBrowser)' == 'true' and '$(RuntimeFlavor)' == 'Mono'">
1382+
<Link>Common\Interop\Browser\Interop.Locale.Mono.cs</Link>
13831383
</Compile>
13841384
<Compile Include="$(CommonPath)Interop\Interop.Calendar.cs">
13851385
<Link>Common\Interop\Interop.Calendar.cs</Link>

src/libraries/externals.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
<RuntimeFiles Include="@(HostPolicyFile)" Condition="Exists('@(HostPolicyFile)')" />
8787
<RuntimeFiles Include="@(_HostSymbols)" Condition="Exists('@(_HostSymbols)')" IsNative="true" />
8888
<!-- CoreRun is not used for testing anymore, but we still use it for benchmarking and profiling -->
89-
<RuntimeFiles Include="$(CoreCLRArtifactsPath)\corerun*" Condition="'$(TargetsAndroid)' != 'true'" />
90-
<RuntimeFiles Include="$(CoreCLRArtifactsPath)\PDB\corerun*" Condition="'$(TargetsAndroid)' != 'true'" />
89+
<RuntimeFiles Include="$(CoreCLRArtifactsPath)\corerun*" Condition="'$(TargetsAndroid)' != 'true' and '$(TargetsBrowser)' != 'true'" />
90+
<RuntimeFiles Include="$(CoreCLRArtifactsPath)\PDB\corerun*" Condition="'$(TargetsAndroid)' != 'true' and '$(TargetsBrowser)' != 'true'" />
9191
<!-- Include cDAC reader library
9292
TODO: [cdac] Remove once cdacreader is added to shipping shared framework -->
9393
<RuntimeFiles Include="$(CoreCLRArtifactsPath)\*mscordaccore_universal*" />

src/native/corehost/browserhost/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ LIST(APPEND NATIVE_LIBS
7979
set(JS_SYSTEM_NATIVE_BROWSER
8080
"${SHARED_LIB_DESTINATION}/libSystem.Native.Browser.js")
8181
set(JS_SYSTEM_BROWSER_UTILS
82-
"${SHARED_LIB_DESTINATION}/libSystem.Browser.Utils.js")
82+
"${SHARED_LIB_DESTINATION}/libSystem.Native.Browser.Utils.js")
8383
set(JS_SYSTEM_RUNTIME_INTEROPSERVICES_JAVASCRIPT_NATIVE
8484
"${SHARED_LIB_DESTINATION}/libSystem.Runtime.InteropServices.JavaScript.Native.js")
8585
set(JS_BROWSER_HOST

src/native/corehost/browserhost/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Implements native part of the CoreCLR host and exposes it as an internal JavaScr
1717
It is **Emscripten application** statically linked from libraries.
1818

1919
- `libSystem.Native.Browser.js` linked -> `dotnet.native.js`
20-
- `libSystem.Browser.Utils.js` linked -> `dotnet.native.js`
20+
- `libSystem.Native.Browser.Utils.js` linked -> `dotnet.native.js`
2121
- `libSystem.Runtime.InteropServices.JavaScript.Native.js` linked -> `dotnet.native.js`
2222
- `libSystem.Native.Browser.a` linked -> `dotnet.native.wasm`
2323
- `libSystem.Runtime.InteropServices.JavaScript.Native.a` linked -> `dotnet.native.wasm`

src/native/corehost/browserhost/browserhost.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static const void* pinvoke_override(const char* library_name, const char* entry_
6868
{
6969
return SystemResolveDllImport(entry_point_name);
7070
}
71-
if (strcmp(library_name, "libSystem.JavaScript.Native") == 0)
71+
if (strcmp(library_name, "libSystem.Native.Browser") == 0)
7272
{
7373
return SystemJSResolveDllImport(entry_point_name);
7474
}

0 commit comments

Comments
 (0)