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

Side by Side Diff: webrtc/api/statscollector.cc

Issue 1713043002: Late initialize MediaController, for less resource i.e. ProcessThread, usage by PeerConnection. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Comment Created 4 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 /* 1 /*
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
455 double time_now = GetTimeNow(); 455 double time_now = GetTimeNow();
456 // Calls to UpdateStats() that occur less than kMinGatherStatsPeriod number of 456 // Calls to UpdateStats() that occur less than kMinGatherStatsPeriod number of
457 // ms apart will be ignored. 457 // ms apart will be ignored.
458 const double kMinGatherStatsPeriod = 50; 458 const double kMinGatherStatsPeriod = 50;
459 if (stats_gathering_started_ != 0 && 459 if (stats_gathering_started_ != 0 &&
460 stats_gathering_started_ + kMinGatherStatsPeriod > time_now) { 460 stats_gathering_started_ + kMinGatherStatsPeriod > time_now) {
461 return; 461 return;
462 } 462 }
463 stats_gathering_started_ = time_now; 463 stats_gathering_started_ = time_now;
464 464
465 // TODO(pthatcher): Merge PeerConnection and WebRtcSession so there is no
466 // pc_->session().
465 if (pc_->session()) { 467 if (pc_->session()) {
466 // TODO(tommi): All of these hop over to the worker thread to fetch 468 // TODO(tommi): All of these hop over to the worker thread to fetch
467 // information. We could use an AsyncInvoker to run all of these and post 469 // information. We could use an AsyncInvoker to run all of these and post
468 // the information back to the signaling thread where we can create and 470 // the information back to the signaling thread where we can create and
469 // update stats reports. That would also clean up the threading story a bit 471 // update stats reports. That would also clean up the threading story a bit
470 // since we'd be creating/updating the stats report objects consistently on 472 // since we'd be creating/updating the stats report objects consistently on
471 // the same thread (this class has no locks right now). 473 // the same thread (this class has no locks right now).
472 ExtractSessionInfo(); 474 ExtractSessionInfo();
473 ExtractVoiceInfo(); 475 ExtractVoiceInfo();
474 ExtractVideoInfo(level); 476 ExtractVideoInfo(level);
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
936 StatsReport* report = entry.second; 938 StatsReport* report = entry.second;
937 report->set_timestamp(stats_gathering_started_); 939 report->set_timestamp(stats_gathering_started_);
938 } 940 }
939 } 941 }
940 942
941 void StatsCollector::ClearUpdateStatsCacheForTest() { 943 void StatsCollector::ClearUpdateStatsCacheForTest() {
942 stats_gathering_started_ = 0; 944 stats_gathering_started_ = 0;
943 } 945 }
944 946
945 } // namespace webrtc 947 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698