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

Unified Diff: content/browser/media/webrtc/webrtc_internals.cc

Issue 2163983006: Add unit test for WebRTCInternalsMessageHandler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add NON_EXPORTED_BASE annotation. Created 4 years, 5 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
Index: content/browser/media/webrtc/webrtc_internals.cc
diff --git a/content/browser/media/webrtc/webrtc_internals.cc b/content/browser/media/webrtc/webrtc_internals.cc
index ae8a7edef50004c06b6816256e30b1159dbcc6a5..3be45a2ad39151cd03a1262564102622f4580617 100644
--- a/content/browser/media/webrtc/webrtc_internals.cc
+++ b/content/browser/media/webrtc/webrtc_internals.cc
@@ -69,12 +69,14 @@ const base::Value* WebRTCInternals::PendingUpdate::value() const {
return value_.get();
}
-WebRTCInternals::WebRTCInternals() : WebRTCInternals(500) {}
+WebRTCInternals::WebRTCInternals() : WebRTCInternals(500, true) {}
-WebRTCInternals::WebRTCInternals(int aggregate_updates_ms)
+WebRTCInternals::WebRTCInternals(int aggregate_updates_ms,
+ bool should_block_power_saving)
: audio_debug_recordings_(false),
event_log_recordings_(false),
selecting_event_log_(false),
+ should_block_power_saving_(should_block_power_saving),
aggregate_updates_ms_(aggregate_updates_ms),
weak_factory_(this) {
// TODO(grunell): Shouldn't all the webrtc_internals* files be excluded from the
@@ -497,6 +499,8 @@ void WebRTCInternals::EnableEventLogRecordingsOnAllRenderProcessHosts() {
void WebRTCInternals::CreateOrReleasePowerSaveBlocker() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ if (!should_block_power_saving_)
+ return;
if (peer_connection_data_.empty() && power_save_blocker_) {
DVLOG(1) << ("Releasing the block on application suspension since no "
« no previous file with comments | « content/browser/media/webrtc/webrtc_internals.h ('k') | content/browser/media/webrtc/webrtc_internals_message_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698