Commit ebbccb02 authored by Mario Sanchez Prada's avatar Mario Sanchez Prada Committed by Commit Bot

Migrate references to the viz::mojom::FrameSinkVideoCaptureOverlay interface

Convert the remaining bits in both the implementation and clients from
the browser and renderer processes for the FrameSinkVideoCaptureOverlay
interface, and adapt unit tests.

Bug: 955171, 978694
Change-Id: Ib835dfbe4a84a8ac5abfef5bbaf3945ad5f3fa61
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1863291Reviewed-by: default avatarenne <enne@chromium.org>
Reviewed-by: default avatarOksana Zhuravlova <oksamyt@chromium.org>
Commit-Queue: Mario Sanchez Prada <mario@igalia.com>
Cr-Commit-Position: refs/heads/master@{#708958}
parent 06c102ef
...@@ -267,12 +267,12 @@ void ClientFrameSinkVideoCapturer::Overlay::EstablishConnection( ...@@ -267,12 +267,12 @@ void ClientFrameSinkVideoCapturer::Overlay::EstablishConnection(
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
DCHECK(client_capturer_); DCHECK(client_capturer_);
capturer->CreateOverlay(stacking_index_, mojo::MakeRequest(&overlay_)); capturer->CreateOverlay(stacking_index_,
// Note: There's no need to add a connection error handler on the overlay_.BindNewPipeAndPassReceiver());
// InterfacePtr. If the connection to the service is lost, the // Note: There's no need to add a connection error handler on the remote. If
// ClientFrameSinkVideoCapturer will realize this when the // the connection to the service is lost, the ClientFrameSinkVideoCapturer
// FrameSinkVideoCapturer's binding is lost, and re-establish a connection to // will realize this when the FrameSinkVideoCapturer's binding is lost, and
// both that and this overlay. // re-establish a connection to both that and this overlay.
if (!image_.isNull()) if (!image_.isNull())
overlay_->SetImageAndBounds(image_, bounds_); overlay_->SetImageAndBounds(image_, bounds_);
......
...@@ -58,7 +58,7 @@ class VIZ_HOST_EXPORT ClientFrameSinkVideoCapturer ...@@ -58,7 +58,7 @@ class VIZ_HOST_EXPORT ClientFrameSinkVideoCapturer
base::WeakPtr<ClientFrameSinkVideoCapturer> client_capturer_; base::WeakPtr<ClientFrameSinkVideoCapturer> client_capturer_;
const int32_t stacking_index_; const int32_t stacking_index_;
mojom::FrameSinkVideoCaptureOverlayPtr overlay_; mojo::Remote<mojom::FrameSinkVideoCaptureOverlay> overlay_;
SkBitmap image_; SkBitmap image_;
gfx::RectF bounds_; gfx::RectF bounds_;
......
...@@ -129,16 +129,17 @@ class VideoCaptureOverlayTest : public testing::Test { ...@@ -129,16 +129,17 @@ class VideoCaptureOverlayTest : public testing::Test {
DISALLOW_COPY_AND_ASSIGN(VideoCaptureOverlayTest); DISALLOW_COPY_AND_ASSIGN(VideoCaptureOverlayTest);
}; };
// Tests that, when the VideoCaptureOverlay binds to a mojo request, it reports // Tests that, when the VideoCaptureOverlay binds to a mojo pending receiver, it
// when the binding is closed. // reports when the receiver is closed.
TEST_F(VideoCaptureOverlayTest, ReportsLostMojoConnection) { TEST_F(VideoCaptureOverlayTest, ReportsLostMojoConnection) {
mojom::FrameSinkVideoCaptureOverlayPtr overlay_ptr; mojo::Remote<mojom::FrameSinkVideoCaptureOverlay> overlay_remote;
VideoCaptureOverlay overlay(frame_source(), mojo::MakeRequest(&overlay_ptr)); VideoCaptureOverlay overlay(frame_source(),
ASSERT_TRUE(overlay_ptr); overlay_remote.BindNewPipeAndPassReceiver());
ASSERT_TRUE(overlay_remote);
RunUntilIdle(); // Propagate mojo tasks. RunUntilIdle(); // Propagate mojo tasks.
EXPECT_CALL(*frame_source(), OnOverlayConnectionLost(&overlay)); EXPECT_CALL(*frame_source(), OnOverlayConnectionLost(&overlay));
overlay_ptr.reset(); overlay_remote.reset();
RunUntilIdle(); // Propagate mojo tasks. RunUntilIdle(); // Propagate mojo tasks.
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment