LCOV - code coverage report

Current view
top level - src/_impl/web - _local_worker.dart
Test
lcov.info
Date
2024-11-13
Legend
Lines
hit
not hit
Branches
taken
not taken
# not executed
HitTotalCoverage
Lines99100.0%
Functions00-
Branches00-
Each row represents a line of source code
LineBranchHitsSource code
1import 'dart:async';
2import 'dart:js_interop';
3
4import 'package:web/web.dart' as web;
5
6import '../../channel.dart';
7import '../../exceptions/exception_manager.dart';
8import '../../local_worker/local_worker.dart';
9import '../../worker_service.dart';
10import '../xplat/_worker_runner.dart';
11import '_worker_runner.dart';
12
13base class _WebLocalWorker<W extends WorkerService> extends LocalWorker<W> {
141 _WebLocalWorker._(super.service, ExceptionManager exceptionManager) {
151 final runner = WorkerRunner.use(this);
161 _port.port1.onmessage = runner.handle.toJS;
17 _channel = Channel.deserialize(
181 _port.port2, runner.internalLogger, exceptionManager);
19 }
20
21 final _port = web.MessageChannel();
221 late Channel? _channel;
23
24 @override
25 Channel? get channel => _channel;
26
27 @override
28 void stop() {
291 _port.port1.close();
30 _port.port2.close();
311 _channel?.close();
32 _channel = null;
33 }
34
35 @override
361 ExceptionManager get exceptionManager =>
371 (_exceptionManager ??= ExceptionManager());
38 ExceptionManager? _exceptionManager;
39
40 @override
41 FutureOr<void> start() {}
42}
43
44/// Creates a [LocalWorker] on a browser platform.
45LocalWorker<W> createLocalWorker<W extends WorkerService>(
46 W service, ExceptionManager exceptionManager) =>
47 _WebLocalWorker._(service, exceptionManager);
Choose Features