| 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 12 matching lines...) Expand all  Loading... | 
| 23 #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_data_channel_handler.h" | 24 #include "content/renderer/media/rtc_data_channel_handler.h" | 
| 25 #include "content/renderer/media/rtc_dtmf_sender_handler.h" | 25 #include "content/renderer/media/rtc_dtmf_sender_handler.h" | 
| 26 #include "content/renderer/media/rtc_media_constraints.h" | 26 #include "content/renderer/media/rtc_media_constraints.h" | 
| 27 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" | 27 #include "content/renderer/media/webrtc/peer_connection_dependency_factory.h" | 
| 28 #include "content/renderer/media/webrtc/webrtc_media_stream_adapter.h" | 28 #include "content/renderer/media/webrtc/webrtc_media_stream_adapter.h" | 
| 29 #include "content/renderer/media/webrtc_audio_capturer.h" | 29 #include "content/renderer/media/webrtc_audio_capturer.h" | 
| 30 #include "content/renderer/media/webrtc_audio_device_impl.h" | 30 #include "content/renderer/media/webrtc_audio_device_impl.h" | 
| 31 #include "content/renderer/media/webrtc_uma_histograms.h" | 31 #include "content/renderer/media/webrtc_uma_histograms.h" | 
| 32 #include "content/renderer/render_thread_impl.h" | 32 #include "content/renderer/render_thread_impl.h" | 
|  | 33 #include "content/renderer/render_view_impl.h" | 
| 33 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" | 34 #include "third_party/WebKit/public/platform/WebMediaConstraints.h" | 
| 34 #include "third_party/WebKit/public/platform/WebRTCConfiguration.h" | 35 #include "third_party/WebKit/public/platform/WebRTCConfiguration.h" | 
| 35 #include "third_party/WebKit/public/platform/WebRTCDataChannelInit.h" | 36 #include "third_party/WebKit/public/platform/WebRTCDataChannelInit.h" | 
| 36 #include "third_party/WebKit/public/platform/WebRTCICECandidate.h" | 37 #include "third_party/WebKit/public/platform/WebRTCICECandidate.h" | 
| 37 #include "third_party/WebKit/public/platform/WebRTCOfferOptions.h" | 38 #include "third_party/WebKit/public/platform/WebRTCOfferOptions.h" | 
| 38 #include "third_party/WebKit/public/platform/WebRTCSessionDescription.h" | 39 #include "third_party/WebKit/public/platform/WebRTCSessionDescription.h" | 
| 39 #include "third_party/WebKit/public/platform/WebRTCSessionDescriptionRequest.h" | 40 #include "third_party/WebKit/public/platform/WebRTCSessionDescriptionRequest.h" | 
| 40 #include "third_party/WebKit/public/platform/WebRTCVoidRequest.h" | 41 #include "third_party/WebKit/public/platform/WebRTCVoidRequest.h" | 
| 41 #include "third_party/WebKit/public/platform/WebURL.h" | 42 #include "third_party/WebKit/public/platform/WebURL.h" | 
|  | 43 #include "third_party/WebKit/public/web/WebFrame.h" | 
| 42 | 44 | 
| 43 using webrtc::DataChannelInterface; | 45 using webrtc::DataChannelInterface; | 
| 44 using webrtc::IceCandidateInterface; | 46 using webrtc::IceCandidateInterface; | 
| 45 using webrtc::MediaStreamInterface; | 47 using webrtc::MediaStreamInterface; | 
| 46 using webrtc::PeerConnectionInterface; | 48 using webrtc::PeerConnectionInterface; | 
| 47 using webrtc::PeerConnectionObserver; | 49 using webrtc::PeerConnectionObserver; | 
| 48 using webrtc::StatsReport; | 50 using webrtc::StatsReport; | 
| 49 using webrtc::StatsReports; | 51 using webrtc::StatsReports; | 
| 50 | 52 | 
| 51 namespace content { | 53 namespace content { | 
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 729   if (options.iceRestart()) { | 731   if (options.iceRestart()) { | 
| 730     output->AddMandatory( | 732     output->AddMandatory( | 
| 731         webrtc::MediaConstraintsInterface::kIceRestart, "true", true); | 733         webrtc::MediaConstraintsInterface::kIceRestart, "true", true); | 
| 732   } | 734   } | 
| 733 } | 735 } | 
| 734 | 736 | 
| 735 void RTCPeerConnectionHandler::associateWithFrame(blink::WebFrame* frame) { | 737 void RTCPeerConnectionHandler::associateWithFrame(blink::WebFrame* frame) { | 
| 736   DCHECK(thread_checker_.CalledOnValidThread()); | 738   DCHECK(thread_checker_.CalledOnValidThread()); | 
| 737   DCHECK(frame); | 739   DCHECK(frame); | 
| 738   frame_ = frame; | 740   frame_ = frame; | 
|  | 741 | 
|  | 742   // Copy the flag from Preference associated with this WebFrame. | 
|  | 743   RenderViewImpl* renderer_view_impl = | 
|  | 744       RenderViewImpl::FromWebView(frame_->view()); | 
|  | 745   if (renderer_view_impl && dependency_factory_) { | 
|  | 746     dependency_factory_->set_disable_multiple_routes( | 
|  | 747         renderer_view_impl->renderer_preferences() | 
|  | 748             .disable_webrtc_multiple_routes); | 
|  | 749   } | 
| 739 } | 750 } | 
| 740 | 751 | 
| 741 bool RTCPeerConnectionHandler::initialize( | 752 bool RTCPeerConnectionHandler::initialize( | 
| 742     const blink::WebRTCConfiguration& server_configuration, | 753     const blink::WebRTCConfiguration& server_configuration, | 
| 743     const blink::WebMediaConstraints& options) { | 754     const blink::WebMediaConstraints& options) { | 
| 744   DCHECK(thread_checker_.CalledOnValidThread()); | 755   DCHECK(thread_checker_.CalledOnValidThread()); | 
| 745   DCHECK(frame_); | 756   DCHECK(frame_); | 
| 746 | 757 | 
| 747   peer_connection_tracker_ = | 758   peer_connection_tracker_ = | 
| 748       RenderThreadImpl::current()->peer_connection_tracker()->AsWeakPtr(); | 759       RenderThreadImpl::current()->peer_connection_tracker()->AsWeakPtr(); | 
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1459     base::WaitableEvent event(false, false); | 1470     base::WaitableEvent event(false, false); | 
| 1460     thread->PostTask(FROM_HERE, | 1471     thread->PostTask(FROM_HERE, | 
| 1461         base::Bind(&RunSynchronousClosure, closure, | 1472         base::Bind(&RunSynchronousClosure, closure, | 
| 1462                    base::Unretained(trace_event_name), | 1473                    base::Unretained(trace_event_name), | 
| 1463                    base::Unretained(&event))); | 1474                    base::Unretained(&event))); | 
| 1464     event.Wait(); | 1475     event.Wait(); | 
| 1465   } | 1476   } | 
| 1466 } | 1477 } | 
| 1467 | 1478 | 
| 1468 }  // namespace content | 1479 }  // namespace content | 
| OLD | NEW | 
|---|