Skip to content

Commit b5ddf3e

Browse files
authored
Merge pull request #289 from Voltstro-Studios/master
Release 2.1.1
2 parents d98d93f + 527fd8a commit b5ddf3e

File tree

38 files changed

+1138
-50
lines changed

38 files changed

+1138
-50
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.1.1] - 2024-03-22
8+
9+
### Added
10+
11+
- Added Dynamic Runtime Sample
12+
13+
### Changed
14+
15+
- Bump deps
16+
- Updated CEF to 122.1.13
17+
- Updated basic sample description
18+
19+
### Fixed
20+
21+
- Implemented a handful of fixes to attempt to resolve issue #166
22+
- Prevent engine process lingering when main parent process dies
23+
- Uses Job Objects on Windows
24+
- Uses prctl on Linux
25+
- Errors related to binding ports are no longer swallowed
26+
727
## [2.1.0] - 2024-02-18
828

929
### Added

src/Packages/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
**/*.dll
22
!**/*.prefab
3-
!**/*.meta
3+
!**/*.meta
4+
!Samples~

src/Packages/UnityWebBrowser.Engine.Cef.Linux-x64/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
"changelogUrl": "https://projects.voltstro.dev/UnityWebBrowser/changelog/",
1414
"unity": "2021.2",
1515
"dependencies": {
16-
"dev.voltstro.unitywebbrowser.engine.cef": "2.1.0-121.3.13",
16+
"dev.voltstro.unitywebbrowser.engine.cef": "2.1.1-122.1.13",
1717
"dev.voltstro.unitywebbrowser.unix-support": "1.0.0"
1818
},
1919
"documentationUrl": "https://projects.voltstro.dev/UnityWebBrowser/",
2020
"description": "CEF Engine for Unity Web Browser (Linux x64)",
2121
"displayName": "Unity Web Browser CEF Engine (Linux x64)",
22-
"version": "2.1.0-121.3.13"
22+
"version": "2.1.1-122.1.13"
2323
}

src/Packages/UnityWebBrowser.Engine.Cef.Win-x64/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
"changelogUrl": "https://projects.voltstro.dev/UnityWebBrowser/changelog/",
1414
"unity": "2021.2",
1515
"dependencies": {
16-
"dev.voltstro.unitywebbrowser.engine.cef": "2.1.0-121.3.13"
16+
"dev.voltstro.unitywebbrowser.engine.cef": "2.1.1-122.1.13"
1717
},
1818
"documentationUrl": "https://projects.voltstro.dev/UnityWebBrowser/",
1919
"description": "CEF Engine for Unity Web Browser (Windows x64)",
2020
"displayName": "Unity Web Browser CEF Engine (Windows x64)",
21-
"version": "2.1.0-121.3.13"
21+
"version": "2.1.1-122.1.13"
2222
}

src/Packages/UnityWebBrowser.Engine.Cef/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"changelogUrl": "https://projects.voltstro.dev/UnityWebBrowser/changelog/",
44
"description": "CEF Engine for Unity Web Browser",
55
"documentationUrl": "https://projects.voltstro.dev/UnityWebBrowser/",
6-
"version": "2.1.0-121.3.13",
6+
"version": "2.1.1-122.1.13",
77
"author": {
88
"email": "[email protected]",
99
"url": "https://voltstro.dev",
1010
"name": "Voltstro"
1111
},
1212
"unity": "2021.3",
1313
"dependencies": {
14-
"dev.voltstro.unitywebbrowser": "2.0.2"
14+
"dev.voltstro.unitywebbrowser": "2.1.1"
1515
},
1616
"licensesUrl": "https://github.com/Voltstro-Studios/UnityWebBrowser/blob/master/LICENSE.md",
1717
"repository": {

src/Packages/UnityWebBrowser/Runtime/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
// You can specify all the values or you can default the Build and Revision Numbers
3535
// by using the '*' as shown below:
3636
// [assembly: AssemblyVersion("1.0.*")]
37-
[assembly: AssemblyVersion("2.1.0")]
38-
[assembly: AssemblyFileVersion("2.1.0")]
37+
[assembly: AssemblyVersion("2.1.1")]
38+
[assembly: AssemblyFileVersion("2.1.1")]
3939

4040
[assembly: InternalsVisibleTo("VoltstroStudios.UnityWebBrowser.Prj")]
4141
[assembly: InternalsVisibleTo("VoltstroStudios.UnityWebBrowser.Editor")]
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
// UnityWebBrowser (UWB)
2+
// Copyright (c) 2021-2024 Voltstro-Studios
3+
//
4+
// This project is under the MIT license. See the LICENSE.md file for more details.
5+
6+
using System;
7+
using System.Diagnostics;
8+
using VoltstroStudios.UnityWebBrowser.Core.Engines.Process;
9+
using VoltstroStudios.UnityWebBrowser.Helper;
10+
using VoltstroStudios.UnityWebBrowser.Logging;
11+
12+
namespace VoltstroStudios.UnityWebBrowser.Core.Engines
13+
{
14+
/// <summary>
15+
/// Handler for the engine process
16+
/// </summary>
17+
internal sealed class EngineProcess : IDisposable
18+
{
19+
private readonly IProcess processHandle;
20+
private readonly Engine engine;
21+
private readonly IWebBrowserLogger logger;
22+
23+
/// <summary>
24+
/// Creates a new <see cref="EngineProcess"/> instance
25+
/// </summary>
26+
/// <param name="engine"></param>
27+
/// <param name="logger"></param>
28+
public EngineProcess(Engine engine, IWebBrowserLogger logger)
29+
{
30+
#if UNITY_STANDALONE_WIN
31+
processHandle = new WindowProcess();
32+
#elif UNITY_STANDALONE_LINUX
33+
processHandle = new LinuxProcess(logger);
34+
#endif
35+
36+
this.engine = engine;
37+
this.logger = logger;
38+
}
39+
40+
/// <summary>
41+
/// Has the process exited?
42+
/// </summary>
43+
public bool HasExited => processHandle.HasExited;
44+
45+
/// <summary>
46+
/// What was the exit code of the process
47+
/// </summary>
48+
public int ExitCode => processHandle.ExitCode;
49+
50+
/// <summary>
51+
/// Starts the engine process
52+
/// </summary>
53+
/// <param name="arguments"></param>
54+
/// <param name="onLogEvent"></param>
55+
/// <param name="onErrorLogEvent"></param>
56+
public void StartProcess(string arguments, DataReceivedEventHandler onLogEvent, DataReceivedEventHandler onErrorLogEvent)
57+
{
58+
string engineFullProcessPath = WebBrowserUtils.GetBrowserEngineProcessPath(engine);
59+
string engineDirectory = WebBrowserUtils.GetBrowserEnginePath(engine);
60+
61+
logger.Debug($"Process Path: '{engineFullProcessPath}'\nWorking: '{engineDirectory}'");
62+
logger.Debug($"Arguments: '{arguments}'");
63+
64+
processHandle.StartProcess(engineFullProcessPath, engineDirectory, arguments, onLogEvent, onErrorLogEvent);
65+
}
66+
67+
/// <summary>
68+
/// Kills the engine process
69+
/// </summary>
70+
public void KillProcess()
71+
{
72+
processHandle.KillProcess();
73+
}
74+
75+
public void Dispose()
76+
{
77+
processHandle.Dispose();
78+
}
79+
}
80+
}

src/Packages/UnityWebBrowser/Runtime/Core/Engines/EngineProcess.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Packages/UnityWebBrowser/Runtime/Core/Engines/Process.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// UnityWebBrowser (UWB)
2+
// Copyright (c) 2021-2024 Voltstro-Studios
3+
//
4+
// This project is under the MIT license. See the LICENSE.md file for more details.
5+
6+
using System;
7+
using System.Diagnostics;
8+
9+
namespace VoltstroStudios.UnityWebBrowser.Core.Engines.Process
10+
{
11+
internal interface IProcess : IDisposable
12+
{
13+
public void StartProcess(string executable, string workingDir, string arguments, DataReceivedEventHandler onLogEvent, DataReceivedEventHandler onErrorLogEvent);
14+
15+
public void KillProcess();
16+
17+
public bool HasExited { get; }
18+
19+
public int ExitCode { get; }
20+
}
21+
}

0 commit comments

Comments
 (0)