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

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

Issue 1311853005: RTCCertificate and RTCPeerConnection.generateCertificate added to JavaScript (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Chromium implementation of Blink interfaces. Addressed comments. Created 5 years, 2 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 // 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
11 #include "base/command_line.h" 11 #include "base/command_line.h"
12 #include "base/lazy_instance.h" 12 #include "base/lazy_instance.h"
13 #include "base/location.h" 13 #include "base/location.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/memory/scoped_ptr.h"
16 #include "base/metrics/histogram.h" 15 #include "base/metrics/histogram.h"
17 #include "base/stl_util.h" 16 #include "base/stl_util.h"
18 #include "base/strings/utf_string_conversions.h" 17 #include "base/strings/utf_string_conversions.h"
19 #include "base/thread_task_runner_handle.h" 18 #include "base/thread_task_runner_handle.h"
20 #include "base/trace_event/trace_event.h" 19 #include "base/trace_event/trace_event.h"
21 #include "content/public/common/content_switches.h" 20 #include "content/public/common/content_switches.h"
22 #include "content/renderer/media/media_stream_track.h" 21 #include "content/renderer/media/media_stream_track.h"
23 #include "content/renderer/media/peer_connection_tracker.h" 22 #include "content/renderer/media/peer_connection_tracker.h"
24 #include "content/renderer/media/remote_media_stream_impl.h" 23 #include "content/renderer/media/remote_media_stream_impl.h"
24 #include "content/renderer/media/rtc_certificate.h"
25 #include "content/renderer/media/rtc_data_channel_handler.h" 25 #include "content/renderer/media/rtc_data_channel_handler.h"
26 #include "content/renderer/media/rtc_dtmf_sender_handler.h" 26 #include "content/renderer/media/rtc_dtmf_sender_handler.h"
27 #include "content/renderer/media/rtc_media_constraints.h" 27 #include "content/renderer/media/rtc_media_constraints.h"
28 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" 28 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
29 #include "content/renderer/media/webrtc/webrtc_media_stream_adapter.h" 29 #include "content/renderer/media/webrtc/webrtc_media_stream_adapter.h"
30 #include "content/renderer/media/webrtc_audio_capturer.h" 30 #include "content/renderer/media/webrtc_audio_capturer.h"
31 #include "content/renderer/media/webrtc_audio_device_impl.h" 31 #include "content/renderer/media/webrtc_audio_device_impl.h"
32 #include "content/renderer/media/webrtc_uma_histograms.h" 32 #include "content/renderer/media/webrtc_uma_histograms.h"
33 #include "content/renderer/render_thread_impl.h" 33 #include "content/renderer/render_thread_impl.h"
34 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" 34 #include "third_party/WebKit/public/platform/WebMediaConstraints.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 webrtc_config->rtcp_mux_policy = 248 webrtc_config->rtcp_mux_policy =
249 webrtc::PeerConnectionInterface::kRtcpMuxPolicyNegotiate; 249 webrtc::PeerConnectionInterface::kRtcpMuxPolicyNegotiate;
250 break; 250 break;
251 case blink::WebRTCRtcpMuxPolicyRequire: 251 case blink::WebRTCRtcpMuxPolicyRequire:
252 webrtc_config->rtcp_mux_policy = 252 webrtc_config->rtcp_mux_policy =
253 webrtc::PeerConnectionInterface::kRtcpMuxPolicyRequire; 253 webrtc::PeerConnectionInterface::kRtcpMuxPolicyRequire;
254 break; 254 break;
255 default: 255 default:
256 NOTREACHED(); 256 NOTREACHED();
257 } 257 }
258
259 for (size_t i = 0; i < blink_config.numberOfCertificates(); ++i) {
260 webrtc_config->certificates.push_back(
261 *blink_config.certificate(i)->rtcCertificate());
262 }
258 } 263 }
259 264
260 class SessionDescriptionRequestTracker { 265 class SessionDescriptionRequestTracker {
261 public: 266 public:
262 SessionDescriptionRequestTracker( 267 SessionDescriptionRequestTracker(
263 const base::WeakPtr<RTCPeerConnectionHandler>& handler, 268 const base::WeakPtr<RTCPeerConnectionHandler>& handler,
264 const base::WeakPtr<PeerConnectionTracker>& tracker, 269 const base::WeakPtr<PeerConnectionTracker>& tracker,
265 PeerConnectionTracker::Action action) 270 PeerConnectionTracker::Action action)
266 : handler_(handler), tracker_(tracker), action_(action) {} 271 : handler_(handler), tracker_(tracker), action_(action) {}
267 272
(...skipping 1359 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 } 1632 }
1628 1633
1629 void RTCPeerConnectionHandler::ResetUMAStats() { 1634 void RTCPeerConnectionHandler::ResetUMAStats() {
1630 DCHECK(thread_checker_.CalledOnValidThread()); 1635 DCHECK(thread_checker_.CalledOnValidThread());
1631 num_local_candidates_ipv6_ = 0; 1636 num_local_candidates_ipv6_ = 0;
1632 num_local_candidates_ipv4_ = 0; 1637 num_local_candidates_ipv4_ = 0;
1633 ice_connection_checking_start_ = base::TimeTicks(); 1638 ice_connection_checking_start_ = base::TimeTicks();
1634 memset(ice_state_seen_, 0, sizeof(ice_state_seen_)); 1639 memset(ice_state_seen_, 0, sizeof(ice_state_seen_));
1635 } 1640 }
1636 } // namespace content 1641 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/rtc_certificate_generator.cc ('k') | content/renderer/renderer_blink_platform_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698