WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
226761
MediaPlayerPrivateRemote::didLoadingProgress should not send synchronous message to GPU process
https://bugs.webkit.org/show_bug.cgi?id=226761
Summary
MediaPlayerPrivateRemote::didLoadingProgress should not send synchronous mess...
Jean-Yves Avenard [:jya]
Reported
2021-06-08 01:30:28 PDT
MediaPlayerPrivateRemote::didLoadingProgress should not send synchronous message to GPU process
Attachments
Patch
(10.95 KB, patch)
2021-06-08 02:34 PDT
,
Jean-Yves Avenard [:jya]
no flags
Details
Formatted Diff
Diff
Patch
(10.80 KB, patch)
2021-06-08 18:37 PDT
,
Jean-Yves Avenard [:jya]
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
Jean-Yves Avenard [:jya]
Comment 1
2021-06-08 01:31:24 PDT
rdar://78834312
Jean-Yves Avenard [:jya]
Comment 2
2021-06-08 02:34:41 PDT
Created
attachment 430821
[details]
Patch
Chris Dumez
Comment 3
2021-06-08 15:56:49 PDT
Comment on
attachment 430821
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430821&action=review
> Source/WebCore/platform/graphics/MediaPlayer.h:428 > + using DidLoadingProgressCompletionHandler = CompletionHandler<void(bool)>;
Not sure why we need this alias considering it is longer than the underlying type.
> Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp:271 > + m_player->didLoadingProgress([completionHandler = WTFMove(completionHandler)](bool progress) mutable {
Can't this be simplified as: m_player->didLoadingProgress(WTFMove(completionHandler)); ?
> Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:288 > + ASSERT(false, "Should always be using didLoadingProgressAsync");
ASSERT_NOT_REACHED()
> Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:294 > + connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::DidLoadingProgress(), [callback = WTFMove(callback)](bool progress) mutable {
can this be: connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::DidLoadingProgress(), WTFMove(callback), m_id); ?
Chris Dumez
Comment 4
2021-06-08 15:57:36 PDT
(In reply to Chris Dumez from
comment #3
)
> Comment on
attachment 430821
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=430821&action=review
> > > Source/WebCore/platform/graphics/MediaPlayer.h:428 > > + using DidLoadingProgressCompletionHandler = CompletionHandler<void(bool)>; > > Not sure why we need this alias considering it is longer than the underlying > type. > > > Source/WebKit/GPUProcess/media/RemoteMediaPlayerProxy.cpp:271 > > + m_player->didLoadingProgress([completionHandler = WTFMove(completionHandler)](bool progress) mutable { > > Can't this be simplified as: > m_player->didLoadingProgress(WTFMove(completionHandler)); > ? > > > Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:288 > > + ASSERT(false, "Should always be using didLoadingProgressAsync"); > > ASSERT_NOT_REACHED()
or ASSERT_NOT_REACHED_WITH_MESSAGE("Should always be using didLoadingProgressAsync")
> > > Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:294 > > + connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::DidLoadingProgress(), [callback = WTFMove(callback)](bool progress) mutable { > > can this be: > connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy:: > DidLoadingProgress(), WTFMove(callback), m_id); > ?
Jean-Yves Avenard [:jya]
Comment 5
2021-06-08 16:23:13 PDT
Comment on
attachment 430821
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430821&action=review
>>> Source/WebCore/platform/graphics/MediaPlayer.h:428 >>> + using DidLoadingProgressCompletionHandler = CompletionHandler<void(bool)>; >> >> Not sure why we need this alias considering it is longer than the underlying type. > > or ASSERT_NOT_REACHED_WITH_MESSAGE("Should always be using didLoadingProgressAsync")
so if we ever change the type in the future, you don't have to edit it everywhere. I think it's good practice.
Chris Dumez
Comment 6
2021-06-08 16:25:32 PDT
(In reply to Jean-Yves Avenard [:jya] from
comment #5
)
> Comment on
attachment 430821
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=430821&action=review
> > >>> Source/WebCore/platform/graphics/MediaPlayer.h:428 > >>> + using DidLoadingProgressCompletionHandler = CompletionHandler<void(bool)>; > >> > >> Not sure why we need this alias considering it is longer than the underlying type. > > > > or ASSERT_NOT_REACHED_WITH_MESSAGE("Should always be using didLoadingProgressAsync") > > so if we ever change the type in the future, you don't have to edit it > everywhere. I think it's good practice.
OK, if that's your preference. I don't feel strongly about having an alias or not.
Jean-Yves Avenard [:jya]
Comment 7
2021-06-08 17:26:11 PDT
Comment on
attachment 430821
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430821&action=review
>>> Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:294 >>> + connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::DidLoadingProgress(), [callback = WTFMove(callback)](bool progress) mutable { >> >> can this be: >> connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::DidLoadingProgress(), WTFMove(callback), m_id); >> ? > >
It can. I guess, conceptually I've seen them as different, it just happens to be the same underlying type.
Chris Dumez
Comment 8
2021-06-08 17:44:58 PDT
(In reply to Jean-Yves Avenard [:jya] from
comment #7
)
> Comment on
attachment 430821
[details]
> Patch > > View in context: >
https://bugs.webkit.org/attachment.cgi?id=430821&action=review
> > >>> Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:294 > >>> + connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::DidLoadingProgress(), [callback = WTFMove(callback)](bool progress) mutable { > >> > >> can this be: > >> connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::DidLoadingProgress(), WTFMove(callback), m_id); > >> ? > > > > > > It can. > I guess, conceptually I've seen them as different, it just happens to be the > same underlying type.
If you create a lambda whose only thing it does is calling a lambda, then it's a tell-tell sign you may not need to wrap the lambda.
Jean-Yves Avenard [:jya]
Comment 9
2021-06-08 17:57:46 PDT
Comment on
attachment 430821
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430821&action=review
>>>>> Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:294 >>>>> + connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::DidLoadingProgress(), [callback = WTFMove(callback)](bool progress) mutable { >>>> >>>> can this be: >>>> connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::DidLoadingProgress(), WTFMove(callback), m_id); >>>> ? >>> >>> >> >> It can. >> I guess, conceptually I've seen them as different, it just happens to be the same underlying type. > > If you create a lambda whose only thing it does is calling a lambda, then it's a tell-tell sign you may not need to wrap the lambda.
There are so many ways you can define a template with varying parameters; yet they are to be used in the same manner, that it's unfortunately far from being the norm. Luckily, WK's IPC bindings makes it much easier than the ones I'm used to work with.
Jean-Yves Avenard [:jya]
Comment 10
2021-06-08 18:04:56 PDT
Comment on
attachment 430821
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=430821&action=review
>>>>>> Source/WebKit/WebProcess/GPU/media/MediaPlayerPrivateRemote.cpp:294 >>>>>> + connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::DidLoadingProgress(), [callback = WTFMove(callback)](bool progress) mutable { >>>>> >>>>> can this be: >>>>> connection().sendWithAsyncReply(Messages::RemoteMediaPlayerProxy::DidLoadingProgress(), WTFMove(callback), m_id); >>>>> ? >>>> >>>> >>> >>> It can. >>> I guess, conceptually I've seen them as different, it just happens to be the same underlying type. >> >> If you create a lambda whose only thing it does is calling a lambda, then it's a tell-tell sign you may not need to wrap the lambda. > > There are so many ways you can define a template with varying parameters; yet they are to be used in the same manner, that it's unfortunately far from being the norm. > Luckily, WK's IPC bindings makes it much easier than the ones I'm used to work with.
I meant earlier: conceptually, the IPC's method is called with DidLoadingProgressAsyncReply, the other MediaPlayer::DidLoadingProgressCompletionHandler&
Jean-Yves Avenard [:jya]
Comment 11
2021-06-08 18:37:53 PDT
Created
attachment 430932
[details]
Patch
EWS
Comment 12
2021-06-08 21:38:42 PDT
Committed
r278646
(
238628@main
): <
https://commits.webkit.org/238628@main
> All reviewed patches have been landed. Closing bug and clearing flags on
attachment 430932
[details]
.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug