Chromium Code Reviews| Index: chrome/browser/media/cast_transport_host_filter.h |
| diff --git a/chrome/browser/media/cast_transport_host_filter.h b/chrome/browser/media/cast_transport_host_filter.h |
| index 82aac94c4c3fb8c358d6511376d135d0fe05db93..29be61c18e4bc9959a60db2e5907e2806e66205f 100644 |
| --- a/chrome/browser/media/cast_transport_host_filter.h |
| +++ b/chrome/browser/media/cast_transport_host_filter.h |
| @@ -15,15 +15,13 @@ |
| #include "base/time/default_tick_clock.h" |
| #include "chrome/browser/media/cast_remoting_sender.h" |
| #include "content/public/browser/browser_message_filter.h" |
| +#include "content/public/common/service_manager_connection.h" |
|
Ken Rockot(use gerrit already)
2017/05/31 11:50:49
Please move this include to the cc file, ServiceMa
ke.he
2017/05/31 12:45:10
Done.
|
| +#include "device/wake_lock/public/interfaces/wake_lock_service.mojom.h" |
| #include "media/cast/cast_sender.h" |
| #include "media/cast/logging/logging_defines.h" |
| #include "media/cast/net/cast_transport.h" |
| #include "media/cast/net/udp_transport.h" |
| -namespace device { |
| -class PowerSaveBlocker; |
| -} // namespace device |
| - |
| namespace cast { |
| class CastTransportHostFilter : public content::BrowserMessageFilter { |
| @@ -33,6 +31,9 @@ class CastTransportHostFilter : public content::BrowserMessageFilter { |
| private: |
| ~CastTransportHostFilter() override; |
| + static void BindConnectorRequest( |
|
Ken Rockot(use gerrit already)
2017/05/31 11:50:49
Please remove this from the class. It can be defin
ke.he
2017/05/31 12:45:10
Done.
|
| + service_manager::mojom::ConnectorRequest connector_request); |
| + |
| // Status callback to create UdpTransport. |
| void OnStatusChanged(int32_t channel_id, |
| media::cast::CastTransportStatus status); |
| @@ -93,15 +94,19 @@ class CastTransportHostFilter : public content::BrowserMessageFilter { |
| int32_t channel_id, |
| const std::vector<media::cast::FrameEvent>& events); |
| + device::mojom::WakeLockService* GetWakeLockService(); |
| + |
| IDMap<std::unique_ptr<media::cast::CastTransport>> id_map_; |
| // Clock used by Cast transport. |
| base::DefaultTickClock clock_; |
| - // While |id_map_| is non-empty, hold an instance of |
| - // device::PowerSaveBlocker. This prevents Chrome from being suspended while |
| - // remoting content. |
| - std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; |
| + // While |id_map_| is non-empty, request the WakeLockService to hold a wake |
|
Ken Rockot(use gerrit already)
2017/05/31 11:50:49
How about "While |id_map_| is is non-empty, we use
ke.he
2017/05/31 12:45:10
Done.
|
| + // lock. This prevents Chrome from being suspended while remoting content. |
| + // Destruction of wake_lock_service_ will trigger |
| + // WakeLockServicImpl::OnConnectionError on the service side, so there is no |
| + // need to call CancelWakeLock() in the destructor. |
| + device::mojom::WakeLockServicePtr wake_lock_service_; |
|
Ken Rockot(use gerrit already)
2017/05/31 11:50:49
super nit: can we please just call this |wake_lock
ke.he
2017/05/31 12:45:10
Done.
|
| // This map records all active remoting senders. It uses the unique RTP |
| // stream ID as the key. |