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

Unified Diff: chrome/browser/media/cast_transport_host_filter.h

Issue 2891293002: Convert CastTransportHostFilter to be client of wake lock service. (Closed)
Patch Set: Addressed Ken's review comments. Created 3 years, 7 months 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 | « chrome/browser/media/DEPS ('k') | chrome/browser/media/cast_transport_host_filter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..56dc3ff27cf58f3a8d55abc57cdb0e0f58dc3b29 100644
--- a/chrome/browser/media/cast_transport_host_filter.h
+++ b/chrome/browser/media/cast_transport_host_filter.h
@@ -15,15 +15,12 @@
#include "base/time/default_tick_clock.h"
#include "chrome/browser/media/cast_remoting_sender.h"
#include "content/public/browser/browser_message_filter.h"
+#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 {
@@ -93,15 +90,18 @@ 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, we use |wake_lock_| to request and
+ // hold a wake lock. This prevents Chrome from being suspended while remoting
+ // content. If any wake lock is held upon destruction, it's implicitly
+ // canceled when this object is destroyed.
+ device::mojom::WakeLockServicePtr wake_lock_;
// This map records all active remoting senders. It uses the unique RTP
// stream ID as the key.
« no previous file with comments | « chrome/browser/media/DEPS ('k') | chrome/browser/media/cast_transport_host_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698