Chromium Code Reviews| Index: content/browser/renderer_host/media/peer_connection_tracker_host.cc |
| diff --git a/content/browser/renderer_host/media/peer_connection_tracker_host.cc b/content/browser/renderer_host/media/peer_connection_tracker_host.cc |
| index 7afc300c9eb94d0b825a8e883b9864497ffae011..5c07430f80933ed6caf3c5e96b31efcfc9d80c39 100644 |
| --- a/content/browser/renderer_host/media/peer_connection_tracker_host.cc |
| +++ b/content/browser/renderer_host/media/peer_connection_tracker_host.cc |
| @@ -7,6 +7,7 @@ |
| #include "content/browser/renderer_host/render_process_host_impl.h" |
| #include "content/browser/webrtc/webrtc_eventlog_host.h" |
| #include "content/browser/webrtc/webrtc_internals.h" |
| +#include "content/common/media/media_stream_options.h" |
| #include "content/common/media/peer_connection_tracker_messages.h" |
| namespace content { |
| @@ -16,6 +17,7 @@ PeerConnectionTrackerHost::PeerConnectionTrackerHost( |
| const base::WeakPtr<WebRTCEventLogHost>& event_log_host) |
| : BrowserMessageFilter(PeerConnectionTrackerMsgStart), |
| render_process_id_(render_process_id), |
| + is_screen_capture_(false), |
| event_log_host_(event_log_host) { |
| DCHECK(event_log_host); |
| } |
| @@ -103,16 +105,21 @@ void PeerConnectionTrackerHost::OnAddStats(int lid, |
| void PeerConnectionTrackerHost::OnGetUserMedia( |
| const std::string& origin, |
| bool audio, |
| - bool video, |
| + const VideoInfo& video_info, |
| const std::string& audio_constraints, |
| const std::string& video_constraints) { |
| + base::AutoLock lock(lock_); |
|
Sergey Ulanov
2016/08/19 05:54:15
Why do you need this lock? If it's just for is_scr
braveyao
2016/08/23 21:18:55
Done.
|
| WebRTCInternals::GetInstance()->OnGetUserMedia(render_process_id_, |
| peer_pid(), |
| origin, |
| audio, |
| - video, |
| + video_info.video, |
| audio_constraints, |
| video_constraints); |
| +#if defined(OS_ANDROID) |
| + is_screen_capture_ = |
| + video_info.video_stream_source == kMediaStreamSourceScreen; |
| +#endif |
| } |
| void PeerConnectionTrackerHost::OnSuspend() { |
| @@ -121,10 +128,11 @@ void PeerConnectionTrackerHost::OnSuspend() { |
| } |
| void PeerConnectionTrackerHost::SendOnSuspendOnUIThread() { |
| + base::AutoLock lock(lock_); |
| DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| content::RenderProcessHost* host = |
| content::RenderProcessHost::FromID(render_process_id_); |
| - if (host) |
| + if (host && !is_screen_capture_) |
| host->Send(new PeerConnectionTracker_OnSuspend()); |
| } |