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 9fceb42a8b22123e8b61af89c9b3b20f9d028b25..dd6ca14400a5beab6d927ba1921275c00417ac9c 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/media/webrtc/webrtc_eventlog_host.h" |
| #include "content/browser/media/webrtc/webrtc_internals.h" |
| #include "content/browser/renderer_host/render_process_host_impl.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( |
| WebRTCEventLogHost* event_log_host) |
| : BrowserMessageFilter(PeerConnectionTrackerMsgStart), |
| render_process_id_(render_process_id), |
| + isScreenCapture_(false), |
| event_log_host_(event_log_host) { |
| DCHECK(event_log_host); |
| } |
| @@ -111,6 +113,10 @@ void PeerConnectionTrackerHost::OnGetUserMedia( |
| video, |
| audio_constraints, |
| video_constraints); |
| +#if defined(OS_ANDROID) |
| + isScreenCapture_ = |
| + video_constraints.find(kMediaStreamSourceScreen) != std::string::npos; |
|
miu
2016/07/14 22:25:53
This feels fragile. Is the |video_constraints| str
braveyao
2016/07/18 20:46:31
Done. Found a more solid method: parse the blink::
|
| +#endif |
| } |
| void PeerConnectionTrackerHost::OnSuspend() { |
| @@ -122,7 +128,7 @@ void PeerConnectionTrackerHost::SendOnSuspendOnUIThread() { |
| DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| content::RenderProcessHost* host = |
| content::RenderProcessHost::FromID(render_process_id_); |
| - if (host) |
| + if (host && !isScreenCapture_) |
| host->Send(new PeerConnectionTracker_OnSuspend()); |
| } |