Chromium Code Reviews| Index: content/browser/webrtc/webrtc_internals.h |
| diff --git a/content/browser/webrtc/webrtc_internals.h b/content/browser/webrtc/webrtc_internals.h |
| index b98088a2e1174cbe328cb56785c06c5523e1923a..66f8cd1c4a15705e4737ef27901f052fa14df5e6 100644 |
| --- a/content/browser/webrtc/webrtc_internals.h |
| +++ b/content/browser/webrtc/webrtc_internals.h |
| @@ -7,6 +7,7 @@ |
| #include <memory> |
| #include <queue> |
| +#include <string> |
| #include "base/containers/hash_tables.h" |
| #include "base/gtest_prod_util.h" |
| @@ -108,6 +109,9 @@ class CONTENT_EXPORT WebRTCInternals : public RenderProcessHostObserver, |
| bool IsEventLogRecordingsEnabled() const; |
| const base::FilePath& GetEventLogFilePath() const; |
| + int num_open_connections() { return num_open_connections_; } |
|
tommi (sloooow) - chröme
2016/11/17 18:27:04
Make these const?
|
| + bool IsPowerSavingBlocked() { return !!power_save_blocker_; } |
| + |
| protected: |
| // Constructor/Destructor are protected to allow tests to derive from the |
| // class and do per-instance testing without having to use the global |
| @@ -153,9 +157,13 @@ class CONTENT_EXPORT WebRTCInternals : public RenderProcessHostObserver, |
| void EnableEventLogRecordingsOnAllRenderProcessHosts(); |
| #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. |
| + // Updates the number of open PeerConnections. Called when a PeerConnection |
| + // is stopped or removed. |
| + void MaybeClosePeerConnection(base::DictionaryValue* record); |
| + |
| + // Called whenever a PeerConnection is created or stopped in order to |
| + // impose/release a block on suspending the current application for power |
| + // saving. |
| void CreateOrReleasePowerSaveBlocker(); |
| // Called on a timer to deliver updates to javascript. |
| @@ -203,9 +211,10 @@ class CONTENT_EXPORT WebRTCInternals : public RenderProcessHostObserver, |
| bool selecting_event_log_; |
| base::FilePath event_log_recordings_file_path_; |
| - // While |peer_connection_data_| is non-empty, hold an instance of |
| + // While |num_open_connections_| is greater than zero, hold an instance of |
| // PowerSaveBlocker. This prevents the application from being suspended while |
| // remoting. |
| + int num_open_connections_; |
| std::unique_ptr<device::PowerSaveBlocker> power_save_blocker_; |
| const bool should_block_power_saving_; |