1
- From e699ac35ac6c565f6cc24cb98719b922a319e600 Mon Sep 17 00:00:00 2001
1
+ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2
2
From: Reilly Grant <reillyg@chromium.org>
3
3
Date: Tue, 29 Oct 2024 22:45:33 +0000
4
- Subject: [PATCH] [M-130] serial: Cancel mojo::SimpleWatcher when source/sink become garbage
4
+ Subject: serial: Cancel mojo::SimpleWatcher when source/sink become garbage
5
5
6
6
SerialPortUnderlyingSink and SerialPortUnderlyingSource need
7
7
prefinalizers so that when they become garbage the mojo::SimpleWatcher
@@ -20,13 +20,12 @@ Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5976472
20
20
Commit-Queue: Reilly Grant <reillyg@chromium.org>
21
21
Cr-Commit-Position: refs/branch-heads/6723@{#1569}
22
22
Cr-Branched-From: 985f2961df230630f9cbd75bd6fe463009855a11-refs/heads/main@{#1356013}
23
- ---
24
23
25
24
diff --git a/third_party/blink/renderer/modules/serial/serial_port_underlying_sink.cc b/third_party/blink/renderer/modules/serial/serial_port_underlying_sink.cc
26
- index 6aefbb5..a469a00c 100644
25
+ index 6aefbb59425ff7fc9096deba9841d1e022cf8a05..a469a00c372499295bc947bfcc0230c9a1e911e7 100644
27
26
--- a/third_party/blink/renderer/modules/serial/serial_port_underlying_sink.cc
28
27
+++ b/third_party/blink/renderer/modules/serial/serial_port_underlying_sink.cc
29
- @@ -268,4 +268,10 @@
28
+ @@ -268,4 +268,10 @@ void SerialPortUnderlyingSink::PipeClosed() {
30
29
abort_handle_.Clear();
31
30
}
32
31
@@ -38,10 +37,10 @@ index 6aefbb5..a469a00c 100644
38
37
+
39
38
} // namespace blink
40
39
diff --git a/third_party/blink/renderer/modules/serial/serial_port_underlying_sink.h b/third_party/blink/renderer/modules/serial/serial_port_underlying_sink.h
41
- index a32b0421..b4e664a 100644
40
+ index a32b04212f968479465a495e0cf402402d1b7e4d..b4e664a6debfd3b7c319ef3972774f693da48857 100644
42
41
--- a/third_party/blink/renderer/modules/serial/serial_port_underlying_sink.h
43
42
+++ b/third_party/blink/renderer/modules/serial/serial_port_underlying_sink.h
44
- @@ -20,6 +20,8 @@
43
+ @@ -20,6 +20,8 @@ class SerialPort;
45
44
class WritableStreamDefaultController;
46
45
47
46
class SerialPortUnderlyingSink final : public UnderlyingSinkBase {
@@ -50,7 +49,7 @@ index a32b0421..b4e664a 100644
50
49
public:
51
50
SerialPortUnderlyingSink(SerialPort*, mojo::ScopedDataPipeProducerHandle);
52
51
53
- @@ -46,6 +48,7 @@
52
+ @@ -46,6 +48,7 @@ class SerialPortUnderlyingSink final : public UnderlyingSinkBase {
54
53
void OnFlushOrDrain();
55
54
void WriteData();
56
55
void PipeClosed();
@@ -59,10 +58,10 @@ index a32b0421..b4e664a 100644
59
58
mojo::ScopedDataPipeProducerHandle data_pipe_;
60
59
mojo::SimpleWatcher watcher_;
61
60
diff --git a/third_party/blink/renderer/modules/serial/serial_port_underlying_source.cc b/third_party/blink/renderer/modules/serial/serial_port_underlying_source.cc
62
- index 6d2911c..6753be0 100644
61
+ index 13ffa6e40e4f4c3a4888100a70b78e39cd2a9768..fdc88308a8d668268822e05285da5f0a2701b50c 100644
63
62
--- a/third_party/blink/renderer/modules/serial/serial_port_underlying_source.cc
64
63
+++ b/third_party/blink/renderer/modules/serial/serial_port_underlying_source.cc
65
- @@ -224,4 +224,10 @@
64
+ @@ -224,4 +224,10 @@ void SerialPortUnderlyingSource::Close() {
66
65
data_pipe_.reset();
67
66
}
68
67
@@ -74,7 +73,7 @@ index 6d2911c..6753be0 100644
74
73
+
75
74
} // namespace blink
76
75
diff --git a/third_party/blink/renderer/modules/serial/serial_port_underlying_source.h b/third_party/blink/renderer/modules/serial/serial_port_underlying_source.h
77
- index 4066e98..0de89d2d 100644
76
+ index 4066e9822197f1a94c58b4784d5dcbe73885ea04..0de89d2d991b364e700d756f48eea81f51e0f468 100644
78
77
--- a/third_party/blink/renderer/modules/serial/serial_port_underlying_source.h
79
78
+++ b/third_party/blink/renderer/modules/serial/serial_port_underlying_source.h
80
79
@@ -12,6 +12,7 @@
@@ -85,7 +84,7 @@ index 4066e98..0de89d2d 100644
85
84
86
85
namespace blink {
87
86
88
- @@ -20,6 +21,8 @@
87
+ @@ -20,6 +21,8 @@ class SerialPort;
89
88
90
89
class SerialPortUnderlyingSource : public UnderlyingByteSourceBase,
91
90
ExecutionContextLifecycleObserver {
@@ -94,7 +93,7 @@ index 4066e98..0de89d2d 100644
94
93
public:
95
94
SerialPortUnderlyingSource(ScriptState*,
96
95
SerialPort*,
97
- @@ -47,6 +50,7 @@
96
+ @@ -47,6 +50,7 @@ class SerialPortUnderlyingSource : public UnderlyingByteSourceBase,
98
97
void OnFlush(ScriptPromiseResolver<IDLUndefined>*);
99
98
void PipeClosed();
100
99
void Close();
0 commit comments