Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1246)

Unified Diff: media/remoting/remote_renderer_impl.cc

Issue 2566223005: Media Remoting: Update remoting interstitial when status changes. (Closed)
Patch Set: Removed unused declare. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/remoting/remote_renderer_impl.h ('k') | media/remoting/remoting_interstitial_ui.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/remoting/remote_renderer_impl.cc
diff --git a/media/remoting/remote_renderer_impl.cc b/media/remoting/remote_renderer_impl.cc
index 77fac89d7e2830952d9dc85900584182d5786530..af67128b9b20c42a213cb3db0a16c83d9935c523 100644
--- a/media/remoting/remote_renderer_impl.cc
+++ b/media/remoting/remote_renderer_impl.cc
@@ -36,14 +36,14 @@ RemoteRendererImpl::RemoteRendererImpl(
rpc_broker_(remoting_renderer_controller_->GetRpcBroker()),
rpc_handle_(remoting::RpcBroker::GetUniqueHandle()),
remote_renderer_handle_(remoting::kInvalidHandle),
- interstitial_ui_(video_renderer_sink,
- remoting_renderer_controller->pipeline_metadata()),
+ remoting_interstitial_ui_(video_renderer_sink),
weak_factory_(this) {
VLOG(2) << __FUNCTION__;
// The constructor is running on the main thread.
- DCHECK(remoting_renderer_controller);
-
- UpdateInterstitial();
+ DCHECK(remoting_renderer_controller_);
+ remoting_renderer_controller_->SetShowInterstitialCallback(
+ base::Bind(&RemotingInterstitialUI::ShowInterstitialOnSink,
miu 2016/12/13 22:39:09 As discussed face-to-face, consider: base::Bind(&
xjz 2016/12/14 00:29:50 Done. Use static function instead, as this doesn't
+ remoting_interstitial_ui_.GetWeakPtr()));
const remoting::RpcBroker::ReceiveMessageCallback receive_callback =
base::Bind(&RemoteRendererImpl::OnMessageReceivedOnMainThread,
@@ -555,10 +555,6 @@ void RemoteRendererImpl::OnFatalError(PipelineStatus error) {
if (state_ == STATE_ERROR)
return;
- main_task_runner_->PostTask(
- FROM_HERE, base::Bind(&RemoteRendererImpl::UpdateInterstitial,
- weak_factory_.GetWeakPtr()));
-
const State old_state = state_;
state_ = STATE_ERROR;
@@ -576,12 +572,4 @@ void RemoteRendererImpl::OnFatalError(PipelineStatus error) {
client_->OnError(error);
}
-void RemoteRendererImpl::UpdateInterstitial() {
- DCHECK(main_task_runner_->BelongsToCurrentThread());
-
- interstitial_ui_.ShowInterstitial(
- remoting_renderer_controller_->remoting_source()->state() ==
- RemotingSessionState::SESSION_STARTED);
-}
-
} // namespace media
« no previous file with comments | « media/remoting/remote_renderer_impl.h ('k') | media/remoting/remoting_interstitial_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698