Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 35dc889

Browse files
committed
Remove additional instances
1 parent 016301b commit 35dc889

File tree

7 files changed

+17
-151
lines changed

7 files changed

+17
-151
lines changed

analysis_options.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# - "sort_constructors_first" disabled (because we have private fake
88
# constructors),
99
# - "prefer_final_fields" disabled (because we do weird things with
10-
# private fields, especially on the Window object):
10+
# private fields, especially on the PlatformDispatcher object):
1111

1212
analyzer:
1313
enable-experiment:

common/settings.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,11 @@ struct Settings {
221221
FrameRasterizedCallback frame_rasterized_callback;
222222

223223
// This data will be available to the isolate immediately on launch via the
224-
// Window.getPersistentIsolateData callback. This is meant for information
225-
// that the isolate cannot request asynchronously (platform messages can be
226-
// used for that purpose). This data is held for the lifetime of the shell and
227-
// is available on isolate restarts in the shell instance. Due to this,
228-
// the buffer must be as small as possible.
224+
// PlatformDispatcher.getPersistentIsolateData callback. This is meant for
225+
// information that the isolate cannot request asynchronously (platform
226+
// messages can be used for that purpose). This data is held for the lifetime
227+
// of the shell and is available on isolate restarts in the shell instance.
228+
// Due to this, the buffer must be as small as possible.
229229
std::shared_ptr<const fml::Mapping> persistent_isolate_data;
230230

231231
/// Max size of old gen heap size in MB, or 0 for unlimited, -1 for default

lib/web_ui/lib/src/engine/dom_renderer.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -478,8 +478,8 @@ flt-glass-pane * {
478478
///
479479
/// When there is a text editing going on in mobile devices, do not change
480480
/// the physicalSize, change the [window.viewInsets]. See:
481-
/// https://api.flutter.dev/flutter/dart-ui/Window/viewInsets.html
482-
/// https://api.flutter.dev/flutter/dart-ui/Window/physicalSize.html
481+
/// https://api.flutter.dev/flutter/dart-ui/FlutterView/viewInsets.html
482+
/// https://api.flutter.dev/flutter/dart-ui/FlutterView/physicalSize.html
483483
///
484484
/// Note: always check for rotations for a mobile device. Update the physical
485485
/// size if the change is caused by a rotation.

lib/web_ui/lib/src/engine/semantics/semantics.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,11 +1265,11 @@ class EngineSemanticsOwner {
12651265

12661266
final SemanticsHelper semanticsHelper = SemanticsHelper();
12671267

1268-
/// Whether the user has requested that [updateSemantics] be called when
1269-
/// the semantic contents of window changes.
1268+
/// Whether the user has requested that [updateSemantics] be called when the
1269+
/// semantic contents of window changes.
12701270
///
1271-
/// The [ui.Window.onSemanticsEnabledChanged] callback is called whenever this
1272-
/// value changes.
1271+
/// The [ui.PlatformDispatcher.onSemanticsEnabledChanged] callback is called
1272+
/// whenever this value changes.
12731273
///
12741274
/// This is separate from accessibility [mode], which controls how gestures
12751275
/// are interpreted when this value is true.

lib/web_ui/lib/src/engine/window.dart

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,8 @@ set customUrlStrategy(UrlStrategy? strategy) {
2222
_customUrlStrategy = strategy;
2323
}
2424

25-
/// The Web implementation of [ui.Window].
26-
// TODO(gspencergoog): Once the framework no longer uses ui.Window, make this extend
27-
// ui.SingletonFlutterWindow instead.
28-
class EngineFlutterWindow extends ui.Window {
25+
/// The Web implementation of [ui.SingletonFlutterWindow].
26+
class EngineFlutterWindow extends ui.SingletonFlutterWindow {
2927
EngineFlutterWindow(this._windowId, this.platformDispatcher) {
3028
final EnginePlatformDispatcher engineDispatcher = platformDispatcher as EnginePlatformDispatcher;
3129
engineDispatcher._windows[_windowId] = this;
@@ -245,7 +243,7 @@ UrlStrategy? _createDefaultUrlStrategy() {
245243
: const HashUrlStrategy();
246244
}
247245

248-
/// The Web implementation of [ui.Window].
246+
/// The Web implementation of [ui.SingletonFlutterWindow].
249247
class EngineSingletonFlutterWindow extends EngineFlutterWindow {
250248
EngineSingletonFlutterWindow(Object windowId, ui.PlatformDispatcher platformDispatcher) : super(windowId, platformDispatcher);
251249

lib/web_ui/lib/src/ui/window.dart

Lines changed: 1 addition & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -124,138 +124,6 @@ abstract class SingletonFlutterWindow extends FlutterWindow {
124124
void setIsolateDebugName(String name) => PlatformDispatcher.instance.setIsolateDebugName(name);
125125
}
126126

127-
// This class will go away entirely once references to it are removed from the
128-
// framework. The many explicit overrides are an artifact of needing to add the
129-
// same overrides to the one in dart:ui in order to get dartdoc to find the docs
130-
// for them.
131-
abstract class Window extends SingletonFlutterWindow {
132-
@override
133-
double get devicePixelRatio;
134-
135-
@override
136-
Rect get physicalGeometry;
137-
138-
@override
139-
Size get physicalSize;
140-
141-
@override
142-
WindowPadding get viewInsets;
143-
144-
@override
145-
WindowPadding get viewPadding;
146-
147-
@override
148-
WindowPadding get systemGestureInsets;
149-
150-
@override
151-
WindowPadding get padding;
152-
153-
@override
154-
void render(Scene scene);
155-
156-
@override
157-
VoidCallback? get onMetricsChanged;
158-
@override
159-
set onMetricsChanged(VoidCallback? callback);
160-
161-
@override
162-
Locale? get locale => super.locale;
163-
164-
@override
165-
List<Locale>? get locales => super.locales;
166-
167-
@override
168-
Locale? computePlatformResolvedLocale(List<Locale> supportedLocales);
169-
170-
@override
171-
VoidCallback? get onLocaleChanged;
172-
@override
173-
set onLocaleChanged(VoidCallback? callback);
174-
175-
@override
176-
String get initialLifecycleState;
177-
178-
@override
179-
double get textScaleFactor;
180-
181-
@override
182-
bool get alwaysUse24HourFormat;
183-
184-
@override
185-
VoidCallback? get onTextScaleFactorChanged;
186-
@override
187-
set onTextScaleFactorChanged(VoidCallback? callback);
188-
189-
@override
190-
Brightness get platformBrightness;
191-
192-
@override
193-
VoidCallback? get onPlatformBrightnessChanged;
194-
@override
195-
set onPlatformBrightnessChanged(VoidCallback? callback);
196-
197-
@override
198-
FrameCallback? get onBeginFrame;
199-
@override
200-
set onBeginFrame(FrameCallback? callback);
201-
202-
@override
203-
VoidCallback? get onDrawFrame;
204-
@override
205-
set onDrawFrame(VoidCallback? callback);
206-
207-
@override
208-
TimingsCallback? get onReportTimings;
209-
@override
210-
set onReportTimings(TimingsCallback? callback);
211-
212-
@override
213-
PointerDataPacketCallback? get onPointerDataPacket;
214-
@override
215-
set onPointerDataPacket(PointerDataPacketCallback? callback);
216-
217-
@override
218-
String get defaultRouteName;
219-
220-
@override
221-
void scheduleFrame();
222-
223-
@override
224-
bool get semanticsEnabled;
225-
226-
@override
227-
VoidCallback? get onSemanticsEnabledChanged;
228-
@override
229-
set onSemanticsEnabledChanged(VoidCallback? callback);
230-
231-
@override
232-
SemanticsActionCallback? get onSemanticsAction;
233-
@override
234-
set onSemanticsAction(SemanticsActionCallback? callback);
235-
236-
@override
237-
AccessibilityFeatures get accessibilityFeatures;
238-
239-
@override
240-
VoidCallback? get onAccessibilityFeaturesChanged;
241-
@override
242-
set onAccessibilityFeaturesChanged(VoidCallback? callback);
243-
244-
@override
245-
void updateSemantics(SemanticsUpdate update);
246-
247-
@override
248-
void sendPlatformMessage(String name, ByteData? data, PlatformMessageResponseCallback? callback);
249-
250-
@override
251-
PlatformMessageCallback? get onPlatformMessage;
252-
@override
253-
set onPlatformMessage(PlatformMessageCallback? callback);
254-
255-
@override
256-
void setIsolateDebugName(String name);
257-
}
258-
259127
class AccessibilityFeatures {
260128
const AccessibilityFeatures._(this._index);
261129

@@ -368,4 +236,4 @@ class IsolateNameServer {
368236
}
369237
}
370238

371-
Window get window => engine.window;
239+
SingletonFlutterWindow window => engine.window;

lib/web_ui/test/engine/window_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ void testMain() {
271271
expect(responded, true);
272272
});
273273

274-
test('Window implements locale, locales, and locale change notifications', () async {
274+
test('SingletonFlutterWindow implements locale, locales, and locale change notifications', () async {
275275
// This will count how many times we notified about locale changes.
276276
int localeChangedCount = 0;
277277
window.onLocaleChanged = () {

0 commit comments

Comments
 (0)