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

Side by Side Diff: content/renderer/media/peer_connection_tracker.cc

Issue 2263373003: Android: move peerconnection out of power observer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 3 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
« no previous file with comments | « no previous file | content/renderer/media/peer_connection_tracker_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "content/renderer/media/peer_connection_tracker.h" 4 #include "content/renderer/media/peer_connection_tracker.h"
5 5
6 #include <stddef.h> 6 #include <stddef.h>
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 369
370 RenderThread* PeerConnectionTracker::SendTarget() { 370 RenderThread* PeerConnectionTracker::SendTarget() {
371 if (send_target_for_test_) { 371 if (send_target_for_test_) {
372 return send_target_for_test_; 372 return send_target_for_test_;
373 } 373 }
374 return RenderThreadImpl::current(); 374 return RenderThreadImpl::current();
375 } 375 }
376 376
377 void PeerConnectionTracker::OnSuspend() { 377 void PeerConnectionTracker::OnSuspend() {
378 DCHECK(main_thread_.CalledOnValidThread()); 378 DCHECK(main_thread_.CalledOnValidThread());
379 // On Android 'Suspend' means more of the activity state. So it's better to
380 // keep the webrtc call session when user is doing something else or screen
381 // is off.
382 #if !defined(OS_ANDROID)
379 for (PeerConnectionIdMap::iterator it = peer_connection_id_map_.begin(); 383 for (PeerConnectionIdMap::iterator it = peer_connection_id_map_.begin();
380 it != peer_connection_id_map_.end(); ++it) { 384 it != peer_connection_id_map_.end(); ++it) {
381 it->first->CloseClientPeerConnection(); 385 it->first->CloseClientPeerConnection();
382 } 386 }
387 #endif
383 } 388 }
384 389
385 void PeerConnectionTracker::OnStartEventLog(int peer_connection_id, 390 void PeerConnectionTracker::OnStartEventLog(int peer_connection_id,
386 IPC::PlatformFileForTransit file) { 391 IPC::PlatformFileForTransit file) {
387 DCHECK(main_thread_.CalledOnValidThread()); 392 DCHECK(main_thread_.CalledOnValidThread());
388 for (auto& it : peer_connection_id_map_) { 393 for (auto& it : peer_connection_id_map_) {
389 if (it.second == peer_connection_id) { 394 if (it.second == peer_connection_id) {
390 #if defined(OS_ANDROID) 395 #if defined(OS_ANDROID)
391 // A lower maximum filesize is used on Android because storage space is 396 // A lower maximum filesize is used on Android because storage space is
392 // more scarce on mobile. This upper limit applies to each peerconnection 397 // more scarce on mobile. This upper limit applies to each peerconnection
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 DCHECK(main_thread_.CalledOnValidThread()); 743 DCHECK(main_thread_.CalledOnValidThread());
739 SendTarget()->Send(new PeerConnectionTrackerHost_UpdatePeerConnection( 744 SendTarget()->Send(new PeerConnectionTrackerHost_UpdatePeerConnection(
740 local_id, std::string(callback_type), value)); 745 local_id, std::string(callback_type), value));
741 } 746 }
742 747
743 void PeerConnectionTracker::OverrideSendTargetForTesting(RenderThread* target) { 748 void PeerConnectionTracker::OverrideSendTargetForTesting(RenderThread* target) {
744 send_target_for_test_ = target; 749 send_target_for_test_ = target;
745 } 750 }
746 751
747 } // namespace content 752 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/renderer/media/peer_connection_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698