Commit 09ccc6e0 authored by Darren Shen's avatar Darren Shen Committed by Commit Bot

Revert "[Cast MRP] Stop mirroring immediately when a the tab is closed."

This reverts commit f51b93d7.

Reason for revert: Suspecting as cause of crbug.com/1123786.

Original change's description:
> [Cast MRP] Stop mirroring immediately when a the tab is closed.
> 
> Bug: 1095764, b/159154368
> Change-Id: I36829467e3a6477499c76ae0b15e110acba00c89
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2346911
> Reviewed-by: Yuri Wiitala <miu@chromium.org>
> Commit-Queue: John Williams <jrw@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#803343}

TBR=miu@chromium.org,dominickn@chromium.org,jrw@chromium.org

Change-Id: I3c8e562ee39e8cbf7ef5a5bb0312c9d51da7acc3
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1095764
Bug: b/159154368
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2386439Reviewed-by: default avatarDarren Shen <shend@chromium.org>
Commit-Queue: Darren Shen <shend@chromium.org>
Cr-Commit-Position: refs/heads/master@{#803377}
parent b8446efe
...@@ -182,18 +182,6 @@ class CastMirroringServiceHostBrowserTest ...@@ -182,18 +182,6 @@ class CastMirroringServiceHostBrowserTest
host_.reset(); host_.reset();
} }
void CloseWebContents() {
TabStripModel* const tab_strip = browser()->tab_strip_model();
content::WebContents* const web_contents =
tab_strip->GetActiveWebContents();
// Add a new tab so the browser doesn't close.
AddBlankTabAndShow(browser());
EXPECT_CALL(*this, DidStop()).Times(1);
tab_strip->CloseWebContentsAt(
tab_strip->GetIndexOfWebContents(web_contents),
TabStripModel::CLOSE_CREATE_HISTORICAL_TAB);
}
void RequestRefreshFrame() { void RequestRefreshFrame() {
base::RunLoop run_loop; base::RunLoop run_loop;
EXPECT_CALL(*video_frame_receiver_, OnBufferReadyCall(_)) EXPECT_CALL(*video_frame_receiver_, OnBufferReadyCall(_))
...@@ -267,11 +255,6 @@ IN_PROC_BROWSER_TEST_F(CastMirroringServiceHostBrowserTest, CaptureTabAudio) { ...@@ -267,11 +255,6 @@ IN_PROC_BROWSER_TEST_F(CastMirroringServiceHostBrowserTest, CaptureTabAudio) {
StopMirroring(); StopMirroring();
} }
IN_PROC_BROWSER_TEST_F(CastMirroringServiceHostBrowserTest, TabClosed) {
StartTabMirroring();
CloseWebContents();
}
IN_PROC_BROWSER_TEST_F(CastMirroringServiceHostBrowserTest, TabIndicator) { IN_PROC_BROWSER_TEST_F(CastMirroringServiceHostBrowserTest, TabIndicator) {
content::WebContents* const contents = content::WebContents* const contents =
browser()->tab_strip_model()->GetActiveWebContents(); browser()->tab_strip_model()->GetActiveWebContents();
......
...@@ -15,10 +15,7 @@ MirroringService::MirroringService( ...@@ -15,10 +15,7 @@ MirroringService::MirroringService(
mojo::PendingReceiver<mojom::MirroringService> receiver, mojo::PendingReceiver<mojom::MirroringService> receiver,
scoped_refptr<base::SingleThreadTaskRunner> io_task_runner) scoped_refptr<base::SingleThreadTaskRunner> io_task_runner)
: receiver_(this, std::move(receiver)), : receiver_(this, std::move(receiver)),
io_task_runner_(std::move(io_task_runner)) { io_task_runner_(std::move(io_task_runner)) {}
receiver_.set_disconnect_handler(
base::BindOnce(&MirroringService::OnDisconnect, base::Unretained(this)));
}
MirroringService::~MirroringService() = default; MirroringService::~MirroringService() = default;
...@@ -36,8 +33,4 @@ void MirroringService::Start( ...@@ -36,8 +33,4 @@ void MirroringService::Start(
std::move(inbound_channel), io_task_runner_); std::move(inbound_channel), io_task_runner_);
} }
void MirroringService::OnDisconnect() {
session_.reset();
}
} // namespace mirroring } // namespace mirroring
...@@ -33,8 +33,6 @@ class COMPONENT_EXPORT(MIRRORING_SERVICE) MirroringService final ...@@ -33,8 +33,6 @@ class COMPONENT_EXPORT(MIRRORING_SERVICE) MirroringService final
mojo::PendingReceiver<mojom::CastMessageChannel> inbound_channel) mojo::PendingReceiver<mojom::CastMessageChannel> inbound_channel)
override; override;
void OnDisconnect();
mojo::Receiver<mojom::MirroringService> receiver_; mojo::Receiver<mojom::MirroringService> receiver_;
const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; const scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
std::unique_ptr<Session> session_; // Current mirroring session. std::unique_ptr<Session> session_; // Current mirroring session.
......
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