Commit f21973e
committed
[MediaSession] Small refactoring of MediaSession implementation classes
https://bugs.webkit.org/show_bug.cgi?id=224141
Reviewed by Eric Carlson.
A smorgasboard of small refactoring changes:
Source/WebCore:
- Don't call action handlers by default in response to coordinator requests.
- Since we don't call the action handlers, we don't need the internal methods.
- Simplify the call site by defining the action details inline.
* Modules/mediasession/MediaSessionCoordinator.cpp:
(WebCore::MediaSessionCoordinator::seekSessionToTime):
(WebCore::MediaSessionCoordinator::playSession):
(WebCore::MediaSessionCoordinator::pauseSession):
(WebCore::MediaSessionCoordinator::setSessionTrack):
(WebCore::MediaSessionCoordinator::internalSeekTo): Deleted.
(WebCore::MediaSessionCoordinator::internalPlay): Deleted.
(WebCore::MediaSessionCoordinator::internalPause): Deleted.
(WebCore::MediaSessionCoordinator::internalSetTrack): Deleted.
* Modules/mediasession/MediaSessionCoordinator.h:
* Modules/mediasession/MediaSessionCoordinatorPrivate.h:
Source/WebKit:
- MediaSessionCoordinatorProxyPrivate should use an Optional<ExceptionData> rather than
an actual ExceptionData, to handle the case where no exception was encoutered.
- RemoteMediaSessionCoordinatorProxy::create() should just return a Ref, not a RefPtr.
- Logging inside a completion handler requires access to this.
- Add RemoteMediaSessionCoordinatorProxy.cpp to the build.
* UIProcess/Media/MediaSessionCoordinatorProxyPrivate.h:
* UIProcess/Media/RemoteMediaSessionCoordinatorProxy.cpp:
(WebKit::RemoteMediaSessionCoordinatorProxy::create):
(WebKit::RemoteMediaSessionCoordinatorProxy::RemoteMediaSessionCoordinatorProxy):
(WebKit::RemoteMediaSessionCoordinatorProxy::join):
(WebKit::RemoteMediaSessionCoordinatorProxy::coordinateSeekTo):
(WebKit::RemoteMediaSessionCoordinatorProxy::coordinatePlay):
(WebKit::RemoteMediaSessionCoordinatorProxy::coordinatePause):
(WebKit::RemoteMediaSessionCoordinatorProxy::coordinateSetTrack):
(WebKit::RemoteMediaSessionCoordinatorProxy::pauseSession):
(WebKit::RemoteMediaSessionCoordinatorProxy::setSessionTrack):
(WebKit::RemoteMediaSessionCoordinatorProxy::logChannel const):
(WebKit::RemoteMediaSessionCoordinatorProxy::::coordinateSetTrack): Deleted.
* UIProcess/Media/RemoteMediaSessionCoordinatorProxy.h:
(WebKit::RemoteMediaSessionCoordinatorProxy::logger const):
(WebKit::RemoteMediaSessionCoordinatorProxy::logIdentifier const):
(WebKit::RemoteMediaSessionCoordinatorProxy::logClassName const):
Canonical link: https://commits.webkit.org/236118@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275458 268f45cc-cd09-0410-ab3c-d52691b4dbfc1 parent d98d247 commit f21973eCopy full SHA for f21973e
9 files changed
+131-96Lines changed: 131 additions & 96 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- Source
- WebCore
- Modules/mediasession
- WebKit
- UIProcess/Media
- WebKit.xcodeproj
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+25Lines changed: 25 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
1 | 26 | |
2 | 27 | |
3 | 28 | |
|
Collapse file
Source/WebCore/Modules/mediasession/MediaSessionCoordinator.cpp
Copy file name to clipboardExpand all lines: Source/WebCore/Modules/mediasession/MediaSessionCoordinator.cpp+10-60Lines changed: 10 additions & 60 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
292 | 292 | |
293 | 293 | |
294 | 294 | |
295 | | - |
| 295 | + |
| 296 | + |
296 | 297 | |
297 | 298 | |
298 | 299 | |
| ||
304 | 305 | |
305 | 306 | |
306 | 307 | |
307 | | - |
| 308 | + |
| 309 | + |
308 | 310 | |
309 | 311 | |
310 | | - |
| 312 | + |
311 | 313 | |
312 | 314 | |
313 | 315 | |
| ||
316 | 318 | |
317 | 319 | |
318 | 320 | |
319 | | - |
| 321 | + |
| 322 | + |
320 | 323 | |
321 | 324 | |
322 | | - |
| 325 | + |
323 | 326 | |
324 | 327 | |
325 | 328 | |
| ||
328 | 331 | |
329 | 332 | |
330 | 333 | |
331 | | - |
332 | | - |
333 | | - |
334 | | - |
335 | | - |
336 | | - |
337 | | - |
338 | | - |
339 | | - |
340 | | - |
341 | | - |
342 | | - |
343 | | - |
344 | | - |
345 | | - |
346 | | - |
347 | | - |
348 | | - |
349 | | - |
350 | | - |
351 | | - |
352 | | - |
353 | | - |
354 | | - |
355 | | - |
356 | | - |
357 | | - |
358 | | - |
359 | | - |
360 | | - |
361 | | - |
362 | | - |
363 | | - |
364 | | - |
365 | | - |
366 | | - |
367 | | - |
368 | | - |
369 | | - |
370 | | - |
371 | | - |
372 | | - |
373 | | - |
374 | | - |
375 | | - |
376 | | - |
377 | | - |
378 | | - |
379 | | - |
380 | | - |
381 | | - |
382 | | - |
383 | | - |
384 | | - |
385 | | - |
| 334 | + |
| 335 | + |
386 | 336 | |
387 | 337 | |
388 | 338 | |
|
Collapse file
Source/WebCore/Modules/mediasession/MediaSessionCoordinator.h
Copy file name to clipboardExpand all lines: Source/WebCore/Modules/mediasession/MediaSessionCoordinator.h+2-7Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
73 | 73 | |
74 | 74 | |
75 | 75 | |
76 | | - |
77 | | - |
78 | | - |
79 | | - |
80 | | - |
81 | | - |
82 | | - |
| 76 | + |
| 77 | + |
83 | 78 | |
84 | 79 | |
85 | 80 | |
|
Collapse file
Source/WebCore/Modules/mediasession/MediaSessionCoordinatorPrivate.h
Copy file name to clipboardExpand all lines: Source/WebCore/Modules/mediasession/MediaSessionCoordinatorPrivate.h+3-2Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
33 | 33 | |
34 | 34 | |
35 | 35 | |
| 36 | + |
36 | 37 | |
37 | 38 | |
38 | 39 | |
| ||
46 | 47 | |
47 | 48 | |
48 | 49 | |
49 | | - |
50 | | - |
| 50 | + |
| 51 | + |
51 | 52 | |
52 | 53 | |
53 | 54 | |
|
Collapse file
+33Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
1 | 34 | |
2 | 35 | |
3 | 36 | |
|
Collapse file
Source/WebKit/UIProcess/Media/MediaSessionCoordinatorProxyPrivate.h
Copy file name to clipboardExpand all lines: Source/WebKit/UIProcess/Media/MediaSessionCoordinatorProxyPrivate.h+7-4Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
27 | 27 | |
28 | 28 | |
29 | 29 | |
| 30 | + |
30 | 31 | |
31 | 32 | |
32 | 33 | |
| ||
41 | 42 | |
42 | 43 | |
43 | 44 | |
44 | | - |
45 | | - |
46 | | - |
47 | | - |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
48 | 51 | |
49 | 52 | |
50 | 53 | |
|
Collapse file
Source/WebKit/UIProcess/Media/RemoteMediaSessionCoordinatorProxy.cpp
Copy file name to clipboardExpand all lines: Source/WebKit/UIProcess/Media/RemoteMediaSessionCoordinatorProxy.cpp+30-14Lines changed: 30 additions & 14 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
30 | 30 | |
31 | 31 | |
32 | 32 | |
| 33 | + |
33 | 34 | |
34 | 35 | |
35 | 36 | |
| 37 | + |
| 38 | + |
36 | 39 | |
37 | 40 | |
38 | 41 | |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
39 | 46 | |
40 | 47 | |
41 | 48 | |
42 | | - |
| 49 | + |
43 | 50 | |
44 | 51 | |
45 | 52 | |
46 | 53 | |
47 | 54 | |
48 | 55 | |
49 | 56 | |
| 57 | + |
50 | 58 | |
51 | | - |
| 59 | + |
| 60 | + |
52 | 61 | |
53 | 62 | |
54 | 63 | |
| ||
58 | 67 | |
59 | 68 | |
60 | 69 | |
61 | | - |
| 70 | + |
62 | 71 | |
63 | 72 | |
64 | 73 | |
65 | 74 | |
66 | | - |
| 75 | + |
67 | 76 | |
68 | 77 | |
69 | 78 | |
| ||
76 | 85 | |
77 | 86 | |
78 | 87 | |
79 | | - |
| 88 | + |
80 | 89 | |
81 | 90 | |
82 | 91 | |
83 | 92 | |
84 | | - |
| 93 | + |
85 | 94 | |
86 | 95 | |
87 | 96 | |
88 | 97 | |
89 | 98 | |
90 | | - |
| 99 | + |
91 | 100 | |
92 | 101 | |
93 | 102 | |
94 | 103 | |
95 | | - |
| 104 | + |
96 | 105 | |
97 | 106 | |
98 | 107 | |
99 | 108 | |
100 | 109 | |
101 | | - |
| 110 | + |
102 | 111 | |
103 | 112 | |
104 | 113 | |
105 | 114 | |
106 | | - |
| 115 | + |
107 | 116 | |
108 | 117 | |
109 | 118 | |
110 | 119 | |
111 | 120 | |
112 | | - |
| 121 | + |
113 | 122 | |
114 | 123 | |
115 | 124 | |
116 | 125 | |
117 | | - |
| 126 | + |
118 | 127 | |
119 | 128 | |
120 | 129 | |
| ||
148 | 157 | |
149 | 158 | |
150 | 159 | |
151 | | - |
| 160 | + |
152 | 161 | |
153 | 162 | |
154 | 163 | |
155 | 164 | |
156 | | - |
| 165 | + |
157 | 166 | |
158 | 167 | |
159 | 168 | |
| ||
164 | 173 | |
165 | 174 | |
166 | 175 | |
| 176 | + |
| 177 | + |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | + |
| 182 | + |
167 | 183 | |
168 | 184 | |
169 | 185 | |
0 commit comments