Bug 217535 - [Media in GPU Process] Move AudioSessionRoutingArbitratorProxy to the GPU process
Summary: [Media in GPU Process] Move AudioSessionRoutingArbitratorProxy to the GPU pro...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jer Noble
URL:
Keywords: InRadar
Depends on:
Blocks: 223564
  Show dependency treegraph
 
Reported: 2020-10-09 14:06 PDT by Peng Liu
Modified: 2021-05-04 16:50 PDT (History)
7 users (show)

See Also:


Attachments
Patch (40.43 KB, patch)
2021-03-24 13:47 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (15.67 KB, patch)
2021-03-24 14:04 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (40.51 KB, patch)
2021-03-24 14:04 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch (40.55 KB, patch)
2021-03-24 14:18 PDT, Jer Noble
eric.carlson: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (47.77 KB, patch)
2021-05-04 09:59 PDT, Jer Noble
no flags Details | Formatted Diff | Diff
Patch for landing (47.76 KB, patch)
2021-05-04 10:00 PDT, Jer Noble
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
Patch for landing (47.85 KB, patch)
2021-05-04 13:55 PDT, Jer Noble
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peng Liu 2020-10-09 14:06:10 PDT
Currently AudioSessionRoutingArbitratorProxy is in the UI process.
Comment 1 Radar WebKit Bug Importer 2020-10-09 14:06:48 PDT
<rdar://problem/70152548>
Comment 2 Jer Noble 2021-03-24 13:47:38 PDT
Created attachment 424177 [details]
Patch
Comment 3 Peng Liu 2021-03-24 14:00:09 PDT
Comment on attachment 424177 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=424177&action=review

> Source/WebKit/ChangeLog:13
> +        moved into WebCore to be used both there and in tihs new object.

s/tihs/this/g.

> Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.h:53
> +    bool isInRoutingArbitrationForToken(Token&);

const Token&?

> Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm:123
> +    ASSERT(isInRoutingArbitrationForToken(token));

Not a problem of this patch. Is it possible that this function is called when `m_setupArbitrationOngoing` is true?

> Source/WebKit/GPUProcess/mac/LocalAudioSessionRoutingArbitrator.cpp:47
> +

Nit. An empty line.
Comment 4 Jer Noble 2021-03-24 14:04:12 PDT
Created attachment 424179 [details]
Patch
Comment 5 Jer Noble 2021-03-24 14:04:29 PDT
Created attachment 424180 [details]
Patch
Comment 6 Jer Noble 2021-03-24 14:10:08 PDT
(In reply to Peng Liu from comment #3)
> Comment on attachment 424177 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=424177&action=review
> 
> > Source/WebKit/ChangeLog:13
> > +        moved into WebCore to be used both there and in tihs new object.
> 
> s/tihs/this/g.

Whoops! Fixed.

> > Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.h:53
> > +    bool isInRoutingArbitrationForToken(Token&);
> 
> const Token&?

Sure.

> > Source/WebCore/platform/audio/mac/SharedRoutingArbitrator.mm:123
> > +    ASSERT(isInRoutingArbitrationForToken(token));
> 
> Not a problem of this patch. Is it possible that this function is called
> when `m_setupArbitrationOngoing` is true?

The caller shouldn't end arbitration until the begin arbitration callback is complete.  We do handle that case, however.

> > Source/WebKit/GPUProcess/mac/LocalAudioSessionRoutingArbitrator.cpp:47
> > +
> 
> Nit. An empty line.

Removed.
Comment 7 Jer Noble 2021-03-24 14:18:01 PDT
Created attachment 424181 [details]
Patch
Comment 8 Eric Carlson 2021-05-04 09:38:02 PDT
Comment on attachment 424181 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=424181&action=review

r=me once the bots are happy

> Source/WebKit/GPUProcess/GPUConnectionToWebProcess.cpp:204
> +    , m_routingArbitrator(LocalAudioSessionRoutingArbitrator::create())

Is it possible to create this lazily?

> Source/WebKit/GPUProcess/mac/LocalAudioSessionRoutingArbitrator.cpp:57
> +    m_arbitrationUpdateTime = WallTime::now();

MonotonicTime?

> Source/WebKit/GPUProcess/mac/LocalAudioSessionRoutingArbitrator.h:54
> +    WallTime arbitrationUpdateTime() const { return m_arbitrationUpdateTime; }

Ditto.
Comment 9 Jer Noble 2021-05-04 09:59:30 PDT
Created attachment 427679 [details]
Patch for landing
Comment 10 Jer Noble 2021-05-04 10:00:48 PDT
Created attachment 427680 [details]
Patch for landing
Comment 11 Jer Noble 2021-05-04 13:55:53 PDT
Created attachment 427697 [details]
Patch for landing
Comment 12 EWS 2021-05-04 16:50:13 PDT
Committed r276993 (237316@main): <https://commits.webkit.org/237316@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 427697 [details].