Revert 6745 "Refactor StatsCollector and associated types."
Broke build on android. > Refactor StatsCollector and associated types. > * Due to the type changes, I'm going to update the OnCompleted event in two phases to sync with Chrome. This is the first phase. > * Reports are now managed in a set, not a map, since it's enough to store the id in one place. > * Report ids are now const. > * Copying of data has been greatly reduced. > * This change includes preparation work for making GetStats fully async. > > R=xians@webrtc.org > > Review URL: https://webrtc-codereview.appspot.com/18819004 TBR=tommi@webrtc.org Review URL: https://webrtc-codereview.appspot.com/16139004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6746 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@ -113,18 +113,7 @@ class StreamCollectionInterface : public talk_base::RefCountInterface {
|
||||
|
||||
class StatsObserver : public talk_base::RefCountInterface {
|
||||
public:
|
||||
// TODO(tommi): Remove.
|
||||
virtual void OnComplete(const std::vector<StatsReport>& reports) {}
|
||||
|
||||
// TODO(tommi): Make pure virtual and remove implementation.
|
||||
virtual void OnComplete(const StatsReports& reports) {
|
||||
std::vector<StatsReportCopyable> report_copies;
|
||||
for (size_t i = 0; i < reports.size(); ++i)
|
||||
report_copies.push_back(StatsReportCopyable(*reports[i]));
|
||||
std::vector<StatsReport>* r =
|
||||
reinterpret_cast<std::vector<StatsReport>*>(&report_copies);
|
||||
OnComplete(*r);
|
||||
}
|
||||
virtual void OnComplete(const std::vector<StatsReport>& reports) = 0;
|
||||
|
||||
protected:
|
||||
virtual ~StatsObserver() {}
|
||||
|
||||
Reference in New Issue
Block a user