| 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/webrtc_internals.h" | 5 #include "content/browser/media/webrtc/webrtc_internals.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 DVLOG(1) << ("Releasing the block on application suspension since no " | 502 DVLOG(1) << ("Releasing the block on application suspension since no " |
| 503 "PeerConnections are active anymore."); | 503 "PeerConnections are active anymore."); |
| 504 power_save_blocker_.reset(); | 504 power_save_blocker_.reset(); |
| 505 } else if (!peer_connection_data_.empty() && !power_save_blocker_) { | 505 } else if (!peer_connection_data_.empty() && !power_save_blocker_) { |
| 506 DVLOG(1) << ("Preventing the application from being suspended while one or " | 506 DVLOG(1) << ("Preventing the application from being suspended while one or " |
| 507 "more PeerConnections are active."); | 507 "more PeerConnections are active."); |
| 508 power_save_blocker_.reset(new device::PowerSaveBlocker( | 508 power_save_blocker_.reset(new device::PowerSaveBlocker( |
| 509 device::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, | 509 device::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, |
| 510 device::PowerSaveBlocker::kReasonOther, | 510 device::PowerSaveBlocker::kReasonOther, |
| 511 "WebRTC has active PeerConnections", | 511 "WebRTC has active PeerConnections", |
| 512 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 512 BrowserThread::GetTaskRunnerForThread(BrowserThread::UI), |
| 513 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE))); | 513 BrowserThread::GetTaskRunnerForThread(BrowserThread::FILE))); |
| 514 } | 514 } |
| 515 } | 515 } |
| 516 | 516 |
| 517 void WebRTCInternals::ProcessPendingUpdates() { | 517 void WebRTCInternals::ProcessPendingUpdates() { |
| 518 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 518 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 519 while (!pending_updates_.empty()) { | 519 while (!pending_updates_.empty()) { |
| 520 const auto& update = pending_updates_.front(); | 520 const auto& update = pending_updates_.front(); |
| 521 FOR_EACH_OBSERVER(WebRTCInternalsUIObserver, | 521 FOR_EACH_OBSERVER(WebRTCInternalsUIObserver, |
| 522 observers_, | 522 observers_, |
| 523 OnUpdate(update.command(), update.value())); | 523 OnUpdate(update.command(), update.value())); |
| 524 pending_updates_.pop(); | 524 pending_updates_.pop(); |
| 525 } | 525 } |
| 526 } | 526 } |
| 527 | 527 |
| 528 } // namespace content | 528 } // namespace content |
| OLD | NEW |