OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/renderer/media/rtc_peer_connection_handler.h" | 5 #include "content/renderer/media/rtc_peer_connection_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 request_->requestSucceeded(response); | 401 request_->requestSucceeded(response); |
402 request_ = nullptr; // must be freed on the main thread. | 402 request_ = nullptr; // must be freed on the main thread. |
403 } | 403 } |
404 | 404 |
405 void AddReport(LocalRTCStatsResponse* response, const Report& report) { | 405 void AddReport(LocalRTCStatsResponse* response, const Report& report) { |
406 int idx = response->addReport(blink::WebString::fromUTF8(report.id), | 406 int idx = response->addReport(blink::WebString::fromUTF8(report.id), |
407 blink::WebString::fromUTF8(report.type), | 407 blink::WebString::fromUTF8(report.type), |
408 report.timestamp); | 408 report.timestamp); |
409 for (const auto& value : report.values) { | 409 for (const auto& value : report.values) { |
410 response->addStatistic(idx, | 410 response->addStatistic(idx, |
411 blink::WebString::fromUTF8(value->display_name()), | 411 blink::WebString::fromUTF8(value.second->display_name()), |
412 blink::WebString::fromUTF8(value->ToString())); | 412 blink::WebString::fromUTF8(value.second->ToString())); |
413 } | 413 } |
414 } | 414 } |
415 | 415 |
416 rtc::scoped_refptr<LocalRTCStatsRequest> request_; | 416 rtc::scoped_refptr<LocalRTCStatsRequest> request_; |
417 const scoped_refptr<base::SingleThreadTaskRunner> main_thread_; | 417 const scoped_refptr<base::SingleThreadTaskRunner> main_thread_; |
418 base::ThreadChecker signaling_thread_checker_; | 418 base::ThreadChecker signaling_thread_checker_; |
419 }; | 419 }; |
420 | 420 |
421 void GetStatsOnSignalingThread( | 421 void GetStatsOnSignalingThread( |
422 const scoped_refptr<webrtc::PeerConnectionInterface>& pc, | 422 const scoped_refptr<webrtc::PeerConnectionInterface>& pc, |
(...skipping 1036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 base::WaitableEvent event(false, false); | 1459 base::WaitableEvent event(false, false); |
1460 thread->PostTask(FROM_HERE, | 1460 thread->PostTask(FROM_HERE, |
1461 base::Bind(&RunSynchronousClosure, closure, | 1461 base::Bind(&RunSynchronousClosure, closure, |
1462 base::Unretained(trace_event_name), | 1462 base::Unretained(trace_event_name), |
1463 base::Unretained(&event))); | 1463 base::Unretained(&event))); |
1464 event.Wait(); | 1464 event.Wait(); |
1465 } | 1465 } |
1466 } | 1466 } |
1467 | 1467 |
1468 } // namespace content | 1468 } // namespace content |
OLD | NEW |