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

Side by Side Diff: content/browser/media/webrtc_internals.cc

Issue 946643002: Use PowerSaveBlocker for audio and video on Chrome OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: apply nits Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/media/webrtc_internals.h" 5 #include "content/browser/media/webrtc_internals.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "content/browser/media/webrtc_internals_ui_observer.h" 8 #include "content/browser/media/webrtc_internals_ui_observer.h"
9 #include "content/browser/web_contents/web_contents_view.h" 9 #include "content/browser/web_contents/web_contents_view.h"
10 #include "content/public/browser/browser_thread.h" 10 #include "content/public/browser/browser_thread.h"
(...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 void WebRTCInternals::CreateOrReleasePowerSaveBlocker() { 370 void WebRTCInternals::CreateOrReleasePowerSaveBlocker() {
371 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 371 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
372 372
373 if (peer_connection_data_.empty() && power_save_blocker_) { 373 if (peer_connection_data_.empty() && power_save_blocker_) {
374 DVLOG(1) << ("Releasing the block on application suspension since no " 374 DVLOG(1) << ("Releasing the block on application suspension since no "
375 "PeerConnections are active anymore."); 375 "PeerConnections are active anymore.");
376 power_save_blocker_.reset(); 376 power_save_blocker_.reset();
377 } else if (!peer_connection_data_.empty() && !power_save_blocker_) { 377 } else if (!peer_connection_data_.empty() && !power_save_blocker_) {
378 DVLOG(1) << ("Preventing the application from being suspended while one or " 378 DVLOG(1) << ("Preventing the application from being suspended while one or "
379 "more PeerConnections are active."); 379 "more PeerConnections are active.");
380 power_save_blocker_ = content::PowerSaveBlocker::Create( 380 power_save_blocker_ =
381 content::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, 381 content::PowerSaveBlocker::Create(
382 "WebRTC has active PeerConnections.").Pass(); 382 PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension,
383 PowerSaveBlocker::kReasonOther,
384 "WebRTC has active PeerConnections").Pass();
383 } 385 }
384 } 386 }
385 387
386 } // namespace content 388 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/capture/desktop_capture_device_aura.cc ('k') | content/browser/power_save_blocker_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698