[Ash] Delete VideoConferenceManager mojom interface
This CL deletes the VideoConferenceManager mojom interface in
video_conference.mojom. This CL then cleans up all usage that is related
to this interface.
The deletion and clean-up was made possible by Lacros sunset.
This CL paves the way for separating video conference feature code from
crosapi, as crosapi is to be deleted too with the deletion of Lacros.
Bug: 354710097
Test: tryjob
Change-Id: I2f978815ed00b58a480ec65be9d8b1fa35d4f1e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6219906
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Commit-Queue: Di Wu <diwux@google.com>
Reviewed-by: Georg Neis <neis@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1413971}
diff --git a/chrome/browser/ash/crosapi/crosapi_ash.cc b/chrome/browser/ash/crosapi/crosapi_ash.cc
index f40928b9..b29796a 100644
--- a/chrome/browser/ash/crosapi/crosapi_ash.cc
+++ b/chrome/browser/ash/crosapi/crosapi_ash.cc
@@ -802,11 +802,6 @@
std::move(receiver));
}
-void CrosapiAsh::BindVideoConferenceManager(
- mojo::PendingReceiver<mojom::VideoConferenceManager> receiver) {
- video_conference_manager_ash_->BindReceiver(std::move(receiver));
-}
-
void CrosapiAsh::BindVirtualKeyboard(
mojo::PendingReceiver<mojom::VirtualKeyboard> receiver) {
virtual_keyboard_ash_->BindReceiver(std::move(receiver));
diff --git a/chrome/browser/ash/crosapi/crosapi_ash.h b/chrome/browser/ash/crosapi/crosapi_ash.h
index 138c6f5..33b3b66 100644
--- a/chrome/browser/ash/crosapi/crosapi_ash.h
+++ b/chrome/browser/ash/crosapi/crosapi_ash.h
@@ -338,8 +338,6 @@
void BindVideoCaptureDeviceFactory(
mojo::PendingReceiver<mojom::VideoCaptureDeviceFactory> receiver)
override;
- void BindVideoConferenceManager(
- mojo::PendingReceiver<mojom::VideoConferenceManager> receiver) override;
void BindVirtualKeyboard(
mojo::PendingReceiver<mojom::VirtualKeyboard> receiver) override;
void BindVolumeManager(
diff --git a/chrome/browser/ash/crosapi/video_conference_ash_browsertest.cc b/chrome/browser/ash/crosapi/video_conference_ash_browsertest.cc
index 991856b0..097e0433 100644
--- a/chrome/browser/ash/crosapi/video_conference_ash_browsertest.cc
+++ b/chrome/browser/ash/crosapi/video_conference_ash_browsertest.cc
@@ -19,7 +19,6 @@
#include "chromeos/crosapi/mojom/video_conference.mojom.h"
#include "content/public/test/browser_test.h"
#include "mojo/public/cpp/bindings/receiver.h"
-#include "mojo/public/cpp/bindings/remote.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace crosapi {
@@ -49,7 +48,6 @@
void StopAllScreenShare() override {}
mojo::Receiver<mojom::VideoConferenceManagerClient> receiver_{this};
- mojo::Remote<mojom::VideoConferenceManager> remote_;
base::UnguessableToken id_{base::UnguessableToken::Create()};
};
@@ -79,22 +77,6 @@
base::UnguessableToken id_{base::UnguessableToken::Create()};
};
-// Calls all crosapi::mojom::VideoConference methods over mojo.
-void CallVcManagerAshMethods(FakeVcManagerMojoClient& client) {
- base::test::TestFuture<bool> future1;
- client.remote_->NotifyMediaUsageUpdate(
- crosapi::mojom::VideoConferenceMediaUsageStatus::New(
- client.id_, true, false, true, false, true, false),
- future1.GetCallback());
- EXPECT_TRUE(future1.Take());
-
- base::test::TestFuture<bool> future2;
- client.remote_->NotifyDeviceUsedWhileDisabled(
- crosapi::mojom::VideoConferenceMediaDevice::kCamera, u"Test App",
- future2.GetCallback());
- EXPECT_TRUE(future2.Take());
-}
-
// Calls all crosapi::mojom::VideoConference methods directly.
void CallVcManagerAshMethods(FakeVcManagerCppClient& client,
ash::VideoConferenceManagerAsh* vc_manager) {
@@ -141,37 +123,12 @@
auto* vc_manager =
CrosapiManager::Get()->crosapi_ash()->video_conference_manager_ash();
{
- FakeVcManagerMojoClient mojo_client1;
- vc_manager->BindReceiver(mojo_client1.remote_.BindNewPipeAndPassReceiver());
-
- base::test::TestFuture<bool> future1;
- mojo_client1.remote_->RegisterMojoClient(
- mojo_client1.receiver_.BindNewPipeAndPassRemote(), mojo_client1.id_,
- future1.GetCallback());
- EXPECT_TRUE(future1.Take());
-
FakeVcManagerCppClient cpp_client1;
vc_manager->RegisterCppClient(&cpp_client1, cpp_client1.id_);
-
- CallVcManagerAshMethods(mojo_client1);
CallVcManagerAshMethods(cpp_client1, vc_manager);
}
-
- // Disconnect old clients and try again to ensure manager's API doesn't crash
- // after any client disconnects.
- FakeVcManagerMojoClient mojo_client2;
- vc_manager->BindReceiver(mojo_client2.remote_.BindNewPipeAndPassReceiver());
-
- base::test::TestFuture<bool> future2;
- mojo_client2.remote_->RegisterMojoClient(
- mojo_client2.receiver_.BindNewPipeAndPassRemote(), mojo_client2.id_,
- future2.GetCallback());
- EXPECT_TRUE(future2.Take());
-
FakeVcManagerCppClient cpp_client2;
vc_manager->RegisterCppClient(&cpp_client2, cpp_client2.id_);
-
- CallVcManagerAshMethods(mojo_client2);
CallVcManagerAshMethods(cpp_client2, vc_manager);
}
diff --git a/chrome/browser/ash/video_conference/video_conference_manager_ash.cc b/chrome/browser/ash/video_conference/video_conference_manager_ash.cc
index d18973d..d9839ea5 100644
--- a/chrome/browser/ash/video_conference/video_conference_manager_ash.cc
+++ b/chrome/browser/ash/video_conference/video_conference_manager_ash.cc
@@ -27,7 +27,6 @@
#include "chromeos/crosapi/mojom/video_conference.mojom-forward.h"
#include "chromeos/crosapi/mojom/video_conference.mojom.h"
#include "components/services/app_service/public/cpp/app_launch_util.h"
-#include "mojo/public/cpp/bindings/pending_remote.h"
namespace ash {
@@ -45,13 +44,6 @@
client_id_to_wrapper_.try_emplace(client_id, client, this);
}
-void VideoConferenceManagerAsh::BindReceiver(
- mojo::PendingReceiver<crosapi::mojom::VideoConferenceManager> receiver) {
- // At present the pending receiver should only be from lacros-chrome but
- // in the future there will be other mojo clients as well.
- receivers_.Add(this, std::move(receiver));
-}
-
void VideoConferenceManagerAsh::GetMediaApps(
base::OnceCallback<void(MediaApps)> ui_callback) {
// Because the lacros client communicates over mojo, the GetMediaApps method
@@ -130,7 +122,7 @@
void VideoConferenceManagerAsh::NotifyMediaUsageUpdate(
crosapi::mojom::VideoConferenceMediaUsageStatusPtr status,
- NotifyMediaUsageUpdateCallback callback) {
+ base::OnceCallback<void(bool)> callback) {
if (auto it = client_id_to_wrapper_.find(status->client_id);
it != client_id_to_wrapper_.end()) {
it->second.state() = {
@@ -151,19 +143,10 @@
std::move(callback).Run(true);
}
-void VideoConferenceManagerAsh::RegisterMojoClient(
- mojo::PendingRemote<crosapi::mojom::VideoConferenceManagerClient> client,
- const base::UnguessableToken& client_id,
- RegisterMojoClientCallback callback) {
- client_id_to_wrapper_.try_emplace(client_id, std::move(client), client_id,
- this);
- std::move(callback).Run(true);
-}
-
void VideoConferenceManagerAsh::NotifyDeviceUsedWhileDisabled(
crosapi::mojom::VideoConferenceMediaDevice device,
const std::u16string& app_name,
- NotifyDeviceUsedWhileDisabledCallback callback) {
+ base::OnceCallback<void(bool)> callback) {
// TODO(crbug.com/40240249): Remove this conditional check once it becomes
// possible to enable ash features in lacros browsertests.
if (ash::features::IsVideoConferenceEnabled()) {
diff --git a/chrome/browser/ash/video_conference/video_conference_manager_ash.h b/chrome/browser/ash/video_conference/video_conference_manager_ash.h
index c15d7e1..e7b4efa7 100644
--- a/chrome/browser/ash/video_conference/video_conference_manager_ash.h
+++ b/chrome/browser/ash/video_conference/video_conference_manager_ash.h
@@ -14,8 +14,6 @@
#include "base/functional/callback.h"
#include "chromeos/crosapi/mojom/video_conference.mojom-forward.h"
#include "chromeos/crosapi/mojom/video_conference.mojom.h"
-#include "mojo/public/cpp/bindings/pending_remote.h"
-#include "mojo/public/cpp/bindings/receiver_set.h"
namespace base {
class UnguessableToken;
@@ -34,9 +32,7 @@
// 2. Being the single source of truth for VC parameters like
// background blur, portrait relighting, apps using audio/camera, etc.
// and providing this information to the UI as needed.
-class VideoConferenceManagerAsh
- : public VideoConferenceManagerBase,
- public crosapi::mojom::VideoConferenceManager {
+class VideoConferenceManagerAsh : public VideoConferenceManagerBase {
public:
VideoConferenceManagerAsh();
@@ -60,24 +56,15 @@
void RegisterCppClient(crosapi::mojom::VideoConferenceManagerClient* client,
const base::UnguessableToken& client_id);
- // Binds a pending receiver connected to a lacros mojo client to the manager.
- void BindReceiver(
- mojo::PendingReceiver<crosapi::mojom::VideoConferenceManager> receiver);
-
- // crosapi::mojom::VideoConferenceManager overrides
void NotifyMediaUsageUpdate(
crosapi::mojom::VideoConferenceMediaUsageStatusPtr status,
- NotifyMediaUsageUpdateCallback callback) override;
- void RegisterMojoClient(
- mojo::PendingRemote<crosapi::mojom::VideoConferenceManagerClient> client,
- const base::UnguessableToken& client_id,
- RegisterMojoClientCallback callback) override;
+ base::OnceCallback<void(bool)> callback);
void NotifyDeviceUsedWhileDisabled(
crosapi::mojom::VideoConferenceMediaDevice device,
const std::u16string& app_name,
- NotifyDeviceUsedWhileDisabledCallback callback) override;
+ base::OnceCallback<void(bool)> callback);
void NotifyClientUpdate(
- crosapi::mojom::VideoConferenceClientUpdatePtr update) override;
+ crosapi::mojom::VideoConferenceClientUpdatePtr update);
// Removes entry corresponding to |client_id| from
// |client_id_to_wrapper_|. Called by the destructor of
@@ -108,7 +95,6 @@
// upon destruction of the client.
std::map<base::UnguessableToken, VideoConferenceClientWrapper>
client_id_to_wrapper_;
- mojo::ReceiverSet<crosapi::mojom::VideoConferenceManager> receivers_;
};
} // namespace ash
diff --git a/chromeos/crosapi/mojom/crosapi.mojom b/chromeos/crosapi/mojom/crosapi.mojom
index 2fac1f0..65ccc28 100644
--- a/chromeos/crosapi/mojom/crosapi.mojom
+++ b/chromeos/crosapi/mojom/crosapi.mojom
@@ -663,9 +663,7 @@
[MinVersion=20] BindVideoCaptureDeviceFactory@25(
pending_receiver<crosapi.mojom.VideoCaptureDeviceFactory> receiver);
- // Binds the video conference manager to video conference mojo clients.
- [MinVersion=98] BindVideoConferenceManager@102(
- pending_receiver<crosapi.mojom.VideoConferenceManager> receiver);
+ // BindVideoConferenceManager@102 was removed.
// VirtualKeyboard is a service that allows trusted extensions in Lacros
// to control the virtual keyboard. Implemented in Ash.
diff --git a/chromeos/crosapi/mojom/video_conference.mojom b/chromeos/crosapi/mojom/video_conference.mojom
index 95a9053..6e101a4 100644
--- a/chromeos/crosapi/mojom/video_conference.mojom
+++ b/chromeos/crosapi/mojom/video_conference.mojom
@@ -75,29 +75,6 @@
kCamera,
};
-// Interface between the Ash system and clients (lacros, ARC++, etc.)
-// for Video Conference Manager. Implemented in Ash.
-[Uuid="7dc5b924-abb8-4c0b-b2c0-676458afde5f"]
-interface VideoConferenceManager {
- // Notifies the manager of changes in media apps.
- NotifyMediaUsageUpdate@0(VideoConferenceMediaUsageStatus status)
- => (bool success);
-
- // Registers a mojo client on the manager.
- RegisterMojoClient@1(pending_remote<VideoConferenceManagerClient> client,
- mojo_base.mojom.UnguessableToken client_id)
- => (bool success);
-
- // Notifies the manager of an app trying to access a media device
- // while the device is system disabled.
- NotifyDeviceUsedWhileDisabled@2(VideoConferenceMediaDevice device,
- mojo_base.mojom.String16 app_name)
- => (bool success);
-
- // Notifies the manager of a client update.
- [MinVersion=1] NotifyClientUpdate@3(VideoConferenceClientUpdate update);
-};
-
// Note to keep this in sync with VideoConferenceAppType in enums.xml.
[Extensible]
enum VideoConferenceAppType {