Introduce CoreAudioUtil class with LogCallback [chromium/src : main]

0 views
Skip to first unread message

Olga Sharonova (Gerrit)

unread,
Mar 3, 2026, 1:38:57 PM (2 days ago) Mar 3
to Palak Agarwal, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org
Attention needed from Palak Agarwal

Olga Sharonova added 4 comments

Patchset-level comments
File-level comment, Patchset 3 (Latest):
Olga Sharonova . resolved

I took a look because was looking for the context for previous CLs; some comments which I think makes sense to share early

File media/audio/mac/audio_device_listener_mac.h
Line 131, Patchset 3 (Latest): std::unique_ptr<core_audio_mac::CoreAudioUtil> core_audio_util_;
Olga Sharonova . unresolved

Everywhere: does not need to be a unique_ptr, just CoreAudioUtilHelper which takes a logging callback in the constructor? (Why do we need a lazy initialization?)

File media/audio/mac/core_audio_util_mac.h
Line 23, Patchset 3 (Latest):class MEDIA_EXPORT CoreAudioUtil {
Olga Sharonova . unresolved

This does not need to sit in core_audo_util, it's just a helper class.

Line 17, Patchset 3 (Latest):#include "media/audio/audio_manager.h"
Olga Sharonova . unresolved

Please don't introduce this dependancy. We can just use a generic log callback.

Open in Gerrit

Related details

Attention is currently required from:
  • Palak Agarwal
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I290223ebd43a01e620b2d893618ec91aff6d2b3f
Gerrit-Change-Number: 7628697
Gerrit-PatchSet: 3
Gerrit-Owner: Palak Agarwal <agp...@chromium.org>
Gerrit-Reviewer: Palak Agarwal <agp...@chromium.org>
Gerrit-CC: Olga Sharonova <ol...@chromium.org>
Gerrit-Attention: Palak Agarwal <agp...@chromium.org>
Gerrit-Comment-Date: Tue, 03 Mar 2026 18:38:44 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Palak Agarwal (Gerrit)

unread,
Mar 4, 2026, 8:31:31 AM (yesterday) Mar 4
to Olga Sharonova, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org
Attention needed from Olga Sharonova

Palak Agarwal added 3 comments

File media/audio/mac/audio_device_listener_mac.h
Line 131, Patchset 3: std::unique_ptr<core_audio_mac::CoreAudioUtil> core_audio_util_;
Olga Sharonova . unresolved

Everywhere: does not need to be a unique_ptr, just CoreAudioUtilHelper which takes a logging callback in the constructor? (Why do we need a lazy initialization?)

Palak Agarwal

I've removed the lazy construction but still kept the unique_ptr as we can't initialize it in the constructor (several tests crash) as it needs to be initialized on the Audio thread.

File media/audio/mac/core_audio_util_mac.h
Line 23, Patchset 3:class MEDIA_EXPORT CoreAudioUtil {
Olga Sharonova . resolved

This does not need to sit in core_audo_util, it's just a helper class.

Palak Agarwal

Done

Line 17, Patchset 3:#include "media/audio/audio_manager.h"
Olga Sharonova . resolved

Please don't introduce this dependancy. We can just use a generic log callback.

Palak Agarwal

Done

Open in Gerrit

Related details

Attention is currently required from:
  • Olga Sharonova
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I290223ebd43a01e620b2d893618ec91aff6d2b3f
Gerrit-Change-Number: 7628697
Gerrit-PatchSet: 8
Gerrit-Owner: Palak Agarwal <agp...@chromium.org>
Gerrit-Reviewer: Palak Agarwal <agp...@chromium.org>
Gerrit-CC: Olga Sharonova <ol...@chromium.org>
Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
Gerrit-Comment-Date: Wed, 04 Mar 2026 13:31:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Olga Sharonova <ol...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Palak Agarwal (Gerrit)

unread,
8:00 AM (6 hours ago) 8:00 AM
to Olga Sharonova, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org

Palak Agarwal abandoned this change.

View Change

Abandoned will create alternate change

Palak Agarwal abandoned this change

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: abandon
satisfied_requirement
unsatisfied_requirement
open
diffy

Palak Agarwal (Gerrit)

unread,
9:34 AM (5 hours ago) 9:34 AM
to Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org

Palak Agarwal voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Ibde90dbefe3938f0f4499bfd69e84492371ed873
Gerrit-Change-Number: 7623518
Gerrit-PatchSet: 10
Gerrit-Owner: Palak Agarwal <agp...@chromium.org>
Gerrit-Reviewer: Palak Agarwal <agp...@chromium.org>
Gerrit-Comment-Date: Thu, 05 Mar 2026 14:34:01 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Palak Agarwal (Gerrit)

unread,
9:34 AM (5 hours ago) 9:34 AM
to Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org

Palak Agarwal abandoned this change.

View Change

Abandoned alternate change

Palak Agarwal abandoned this change

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: abandon
satisfied_requirement
unsatisfied_requirement
open
diffy

Palak Agarwal (Gerrit)

unread,
9:36 AM (5 hours ago) 9:36 AM
to Olga Sharonova, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org
Attention needed from Olga Sharonova

Palak Agarwal voted Commit-Queue+1

Commit-Queue+1
Open in Gerrit

Related details

Attention is currently required from:
  • Olga Sharonova
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I9507c39b8d2b82b5a97de9524402c5065d0d5b62
Gerrit-Change-Number: 7638232
Gerrit-PatchSet: 2
Gerrit-Owner: Palak Agarwal <agp...@chromium.org>
Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
Gerrit-Reviewer: Palak Agarwal <agp...@chromium.org>
Gerrit-Attention: Olga Sharonova <ol...@chromium.org>
Gerrit-Comment-Date: Thu, 05 Mar 2026 14:36:10 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
satisfied_requirement
unsatisfied_requirement
open
diffy

Olga Sharonova (Gerrit)

unread,
10:17 AM (4 hours ago) 10:17 AM
to Palak Agarwal, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org
Attention needed from Palak Agarwal

Olga Sharonova added 6 comments

File media/audio/mac/audio_device_listener_mac.cc
Line 20, Patchset 2 (Latest):#include "media/audio/mac/core_audio_util_mac.h"
Olga Sharonova . unresolved

not needed?

Line 246, Patchset 2 (Latest):// TODO(crbug.com/484894482): Provide non-empty callback to `core_audio_util_`
Olga Sharonova . unresolved

What is the problem with providing the callback right away? If it's complicated or if we want to do it in a follow-up - let's not touch the class at all.

File media/audio/mac/audio_manager_mac.h
Line 230, Patchset 2 (Latest): std::unique_ptr<core_audio_mac::CoreAudioUtil> core_audio_util_;
Olga Sharonova . unresolved

forward-declare the class

File media/audio/mac/core_audio_util_mac.h
Line 71, Patchset 2 (Latest):std::optional<std::string> GetDeviceUniqueID(
Olga Sharonova . unresolved

Why some of them are moved to the class but not the others? That is confusing.

Line 23, Patchset 2 (Latest):class CoreAudioUtil {
Olga Sharonova . unresolved

Helper. It's not all CoreAudio utils there are.

File media/audio/mac/core_audio_util_mac.cc
Line 306, Patchset 2 (Latest):std::optional<std::string> GetDeviceUniqueID(AudioObjectID device_id,
const LogCallback& log_callback) {
return GetDeviceStringProperty(device_id, kAudioDevicePropertyDeviceUID,
log_callback);
}
Olga Sharonova . unresolved

I understand that you did it to minimize the diff, but it makes the file a mess: public functions mixed up with class methods.

How about we just ADD CoreAudioUtilHelper class (a helper wrapper than provide logging capabilities, not meant to replace all access to CoreAudio) and KEEP all the public function as they are?

Open in Gerrit

Related details

Attention is currently required from:
  • Palak Agarwal
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9507c39b8d2b82b5a97de9524402c5065d0d5b62
    Gerrit-Change-Number: 7638232
    Gerrit-PatchSet: 2
    Gerrit-Owner: Palak Agarwal <agp...@chromium.org>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Reviewer: Palak Agarwal <agp...@chromium.org>
    Gerrit-Attention: Palak Agarwal <agp...@chromium.org>
    Gerrit-Comment-Date: Thu, 05 Mar 2026 15:16:54 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy

    Olga Sharonova (Gerrit)

    unread,
    10:25 AM (4 hours ago) 10:25 AM
    to Palak Agarwal, Chromium LUCI CQ, chromium...@chromium.org, feature-me...@chromium.org, mac-r...@chromium.org
    Attention needed from Palak Agarwal

    Olga Sharonova added 3 comments

    File media/audio/mac/audio_manager_mac.cc
    Line 118, Patchset 2 (Latest):// TODO(crbug.com/484894482): Merge this with CoreAudioUtil::GetDefaultDevice.
    Olga Sharonova . unresolved

    I don't understand all these TODOs. What is the plan for them?

    Line 243, Patchset 2 (Latest):// GetEnumerationCallback to core_audio_mac::GetDefaultDevice.
    Olga Sharonova . unresolved

    What's up here?

    Line 1012, Patchset 2 (Latest): // TODO(crbug.com/484894482): Add logging here through enumeration callback.
    Olga Sharonova . unresolved

    Why can't we do it now? Is it complicated?

    Open in Gerrit

    Related details

    Attention is currently required from:
    • Palak Agarwal
    Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement is not satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I9507c39b8d2b82b5a97de9524402c5065d0d5b62
    Gerrit-Change-Number: 7638232
    Gerrit-PatchSet: 2
    Gerrit-Owner: Palak Agarwal <agp...@chromium.org>
    Gerrit-Reviewer: Olga Sharonova <ol...@chromium.org>
    Gerrit-Reviewer: Palak Agarwal <agp...@chromium.org>
    Gerrit-Attention: Palak Agarwal <agp...@chromium.org>
    Gerrit-Comment-Date: Thu, 05 Mar 2026 15:25:08 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages