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

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

Issue 2075153002: Reland of 'Move content/browser/power_save_blocker to //device/power_save_blocker' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missing libs for component mac Created 4 years, 6 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/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"
11 #include "content/browser/media/webrtc/webrtc_internals_ui_observer.h" 11 #include "content/browser/media/webrtc/webrtc_internals_ui_observer.h"
12 #include "content/browser/power_save_blocker_factory.h"
12 #include "content/browser/web_contents/web_contents_view.h" 13 #include "content/browser/web_contents/web_contents_view.h"
13 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
14 #include "content/public/browser/content_browser_client.h" 15 #include "content/public/browser/content_browser_client.h"
15 #include "content/public/browser/power_save_blocker_factory.h"
16 #include "content/public/browser/render_process_host.h" 16 #include "content/public/browser/render_process_host.h"
17 #include "content/public/browser/web_contents.h" 17 #include "content/public/browser/web_contents.h"
18 18
19 using base::ProcessId; 19 using base::ProcessId;
20 using std::string; 20 using std::string;
21 21
22 namespace content { 22 namespace content {
23 23
24 namespace { 24 namespace {
25 25
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 DCHECK_CURRENTLY_ON(BrowserThread::UI); 494 DCHECK_CURRENTLY_ON(BrowserThread::UI);
495 495
496 if (peer_connection_data_.empty() && power_save_blocker_) { 496 if (peer_connection_data_.empty() && power_save_blocker_) {
497 DVLOG(1) << ("Releasing the block on application suspension since no " 497 DVLOG(1) << ("Releasing the block on application suspension since no "
498 "PeerConnections are active anymore."); 498 "PeerConnections are active anymore.");
499 power_save_blocker_.reset(); 499 power_save_blocker_.reset();
500 } else if (!peer_connection_data_.empty() && !power_save_blocker_) { 500 } else if (!peer_connection_data_.empty() && !power_save_blocker_) {
501 DVLOG(1) << ("Preventing the application from being suspended while one or " 501 DVLOG(1) << ("Preventing the application from being suspended while one or "
502 "more PeerConnections are active."); 502 "more PeerConnections are active.");
503 power_save_blocker_ = content::CreatePowerSaveBlocker( 503 power_save_blocker_ = content::CreatePowerSaveBlocker(
504 PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, 504 device::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension,
505 PowerSaveBlocker::kReasonOther, "WebRTC has active PeerConnections"); 505 device::PowerSaveBlocker::kReasonOther,
506 "WebRTC has active PeerConnections");
506 } 507 }
507 } 508 }
508 509
509 void WebRTCInternals::ProcessPendingUpdates() { 510 void WebRTCInternals::ProcessPendingUpdates() {
510 DCHECK_CURRENTLY_ON(BrowserThread::UI); 511 DCHECK_CURRENTLY_ON(BrowserThread::UI);
511 while (!pending_updates_.empty()) { 512 while (!pending_updates_.empty()) {
512 const auto& update = pending_updates_.front(); 513 const auto& update = pending_updates_.front();
513 FOR_EACH_OBSERVER(WebRTCInternalsUIObserver, 514 FOR_EACH_OBSERVER(WebRTCInternalsUIObserver,
514 observers_, 515 observers_,
515 OnUpdate(update.command(), update.value())); 516 OnUpdate(update.command(), update.value()));
516 pending_updates_.pop(); 517 pending_updates_.pop();
517 } 518 }
518 } 519 }
519 520
520 } // namespace content 521 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/webrtc/webrtc_internals.h ('k') | content/browser/power_save_blocker_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698