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

Unified Diff: content/browser/media/webrtc_internals.h

Issue 448953002: Impose PowerSaveBlock while remoting content via Cast or WebRTC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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/cast_transport_host_filter.cc ('k') | content/browser/media/webrtc_internals.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/media/webrtc_internals.h
diff --git a/content/browser/media/webrtc_internals.h b/content/browser/media/webrtc_internals.h
index 6f22a999106e44dc1ccec7b0b2cb1d2972263188..1f30ce8f069b7b39a1edbd66ce7951880df3950f 100644
--- a/content/browser/media/webrtc_internals.h
+++ b/content/browser/media/webrtc_internals.h
@@ -6,6 +6,7 @@
#define CONTENT_BROWSER_MEDIA_WEBRTC_INTERNALS_H_
#include "base/gtest_prod_util.h"
+#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "base/observer_list.h"
#include "base/process/process.h"
@@ -16,6 +17,8 @@
#include "ui/shell_dialogs/select_file_dialog.h"
namespace content {
+
+class PowerSaveBlocker;
class WebContents;
class WebRTCInternalsUIObserver;
@@ -131,6 +134,11 @@ class CONTENT_EXPORT WebRTCInternals : public NotificationObserver,
void EnableAecDumpOnAllRenderProcessHosts();
#endif
+ // Called whenever an element is added to or removed from
+ // |peer_connection_data_| to impose/release a block on suspending the current
+ // application for power-saving.
+ void CreateOrReleasePowerSaveBlocker();
+
ObserverList<WebRTCInternalsUIObserver> observers_;
// |peer_connection_data_| is a list containing all the PeerConnection
@@ -166,6 +174,11 @@ class CONTENT_EXPORT WebRTCInternals : public NotificationObserver,
// AEC dump (diagnostic echo canceller recording) state.
bool aec_dump_enabled_;
base::FilePath aec_dump_file_path_;
+
+ // While |peer_connection_data_| is non-empty, hold an instance of
+ // PowerSaveBlocker. This prevents the application from being suspended while
+ // remoting.
+ scoped_ptr<PowerSaveBlocker> power_save_blocker_;
};
} // namespace content
« no previous file with comments | « chrome/browser/media/cast_transport_host_filter.cc ('k') | content/browser/media/webrtc_internals.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698