| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "remoting/host/cast_extension_session.h" | 5 #include "remoting/host/cast_extension_session.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 return new rtc::RefCountedObject<CastStatsObserver>(); | 134 return new rtc::RefCountedObject<CastStatsObserver>(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void OnComplete(const webrtc::StatsReports& reports) override { | 137 void OnComplete(const webrtc::StatsReports& reports) override { |
| 138 VLOG(1) << "Received " << reports.size() << " new StatsReports."; | 138 VLOG(1) << "Received " << reports.size() << " new StatsReports."; |
| 139 | 139 |
| 140 int index = 0; | 140 int index = 0; |
| 141 for (const auto* report : reports) { | 141 for (const auto* report : reports) { |
| 142 VLOG(1) << "Report " << index++ << ":"; | 142 VLOG(1) << "Report " << index++ << ":"; |
| 143 for (const auto& v : report->values()) { | 143 for (const auto& v : report->values()) { |
| 144 VLOG(1) << "Stat: " << v->display_name() << "=" << v->value << "."; | 144 VLOG(1) << "Stat: " << v.second->display_name() << "=" |
| 145 << v.second->value << "."; |
| 145 } | 146 } |
| 146 } | 147 } |
| 147 } | 148 } |
| 148 | 149 |
| 149 protected: | 150 protected: |
| 150 CastStatsObserver() {} | 151 CastStatsObserver() {} |
| 151 ~CastStatsObserver() override {} | 152 ~CastStatsObserver() override {} |
| 152 | 153 |
| 153 DISALLOW_COPY_AND_ASSIGN(CastStatsObserver); | 154 DISALLOW_COPY_AND_ASSIGN(CastStatsObserver); |
| 154 }; | 155 }; |
| (...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 json->SetString(kWebRtcCandidate, candidate_str); | 653 json->SetString(kWebRtcCandidate, candidate_str); |
| 653 std::string json_str; | 654 std::string json_str; |
| 654 if (!base::JSONWriter::Write(json.get(), &json_str)) { | 655 if (!base::JSONWriter::Write(json.get(), &json_str)) { |
| 655 LOG(ERROR) << "Failed to serialize candidate message."; | 656 LOG(ERROR) << "Failed to serialize candidate message."; |
| 656 return; | 657 return; |
| 657 } | 658 } |
| 658 SendMessageToClient(kSubjectNewCandidate, json_str); | 659 SendMessageToClient(kSubjectNewCandidate, json_str); |
| 659 } | 660 } |
| 660 | 661 |
| 661 } // namespace remoting | 662 } // namespace remoting |
| OLD | NEW |