Skip to content

Commit f001ea2

Browse files
author
Nurhan Turgut
authored
adding windows platform to felt. fixing signal (flutter#15111)
1 parent 4e9e69d commit f001ea2

File tree

3 files changed

+50
-11
lines changed

3 files changed

+50
-11
lines changed

lib/web_ui/dev/browser_lock.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
chrome:
2-
# It seems Chrome can't always release from the same build for all operating
3-
# systems, so we specify per-OS build number.
4-
Linux: 695653
5-
Mac: 695656
6-
firefox:
7-
version: '71.0'
1+
chrome:
2+
# It seems Chrome can't always release from the same build for all operating
3+
# systems, so we specify per-OS build number.
4+
Linux: 695653
5+
Mac: 695656
6+
Win: 695655
7+
firefox:
8+
version: '71.0'

lib/web_ui/dev/common.dart

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ abstract class PlatformBinding {
3333
_instance = _LinuxBinding();
3434
} else if (io.Platform.isMacOS) {
3535
_instance = _MacBinding();
36+
} else if (io.Platform.isWindows) {
37+
_instance = _WindowsBinding();
3638
} else {
3739
throw '${io.Platform.operatingSystem} is not supported';
3840
}
@@ -54,6 +56,38 @@ abstract class PlatformBinding {
5456
const String _kBaseDownloadUrl =
5557
'https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o';
5658

59+
class _WindowsBinding implements PlatformBinding {
60+
@override
61+
int getChromeBuild(YamlMap browserLock) {
62+
final YamlMap chromeMap = browserLock['chrome'];
63+
return chromeMap['Win'];
64+
}
65+
66+
@override
67+
String getChromeDownloadUrl(String version) =>
68+
'https://www.googleapis.com/download/storage/v1/b/chromium-browser-snapshots/o/Win%2F${version}%2Fchrome-win32.zip?alt=media';
69+
70+
@override
71+
String getChromeExecutablePath(io.Directory versionDir) =>
72+
path.join(versionDir.path, 'chrome-win32', 'chrome');
73+
74+
@override
75+
String getFirefoxDownloadUrl(String version) =>
76+
'https://download-installer.cdn.mozilla.net/pub/firefox/releases/${version}/win64/en-US/firefox-${version}.exe';
77+
78+
@override
79+
String getFirefoxExecutablePath(io.Directory versionDir) =>
80+
path.join(versionDir.path, 'firefox', 'firefox');
81+
82+
@override
83+
String getFirefoxLatestVersionUrl() =>
84+
'https://download.mozilla.org/?product=firefox-latest&os=win&lang=en-US';
85+
86+
@override
87+
String getSafariSystemExecutablePath() =>
88+
throw UnsupportedError('Safari is not supported on Windows');
89+
}
90+
5791
class _LinuxBinding implements PlatformBinding {
5892
@override
5993
int getChromeBuild(YamlMap browserLock) {

lib/web_ui/dev/felt.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,12 @@ void _listenToShutdownSignals() {
5151
print('Received SIGINT. Shutting down.');
5252
io.exit(1);
5353
});
54-
io.ProcessSignal.sigterm.watch().listen((_) {
55-
print('Received SIGTERM. Shutting down.');
56-
io.exit(1);
57-
});
54+
// SIGTERM signals are not generated under Windows.
55+
// See https://docs.microsoft.com/en-us/previous-versions/xdkz3x12(v%3Dvs.140)
56+
if (!io.Platform.isWindows) {
57+
io.ProcessSignal.sigterm.watch().listen((_) {
58+
print('Received SIGTERM. Shutting down.');
59+
io.exit(1);
60+
});
61+
}
5862
}

0 commit comments

Comments
 (0)