| OLD | NEW |
| 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 Loading... |
| 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 |
| OLD | NEW |