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

Unified Diff: content/renderer/media/rtc_peer_connection_handler.cc

Issue 916873004: Add a Preference to allow WebRTC only bind to "any address" (all 0s) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/rtc_peer_connection_handler.cc
diff --git a/content/renderer/media/rtc_peer_connection_handler.cc b/content/renderer/media/rtc_peer_connection_handler.cc
index da93384f6a889aea18abf7a71153f7c2f97882ab..922a06438d6c996ff68643f62334978fc305ab41 100644
--- a/content/renderer/media/rtc_peer_connection_handler.cc
+++ b/content/renderer/media/rtc_peer_connection_handler.cc
@@ -30,6 +30,7 @@
#include "content/renderer/media/webrtc_audio_device_impl.h"
#include "content/renderer/media/webrtc_uma_histograms.h"
#include "content/renderer/render_thread_impl.h"
+#include "content/renderer/render_view_impl.h"
#include "third_party/WebKit/public/platform/WebMediaConstraints.h"
#include "third_party/WebKit/public/platform/WebRTCConfiguration.h"
#include "third_party/WebKit/public/platform/WebRTCDataChannelInit.h"
@@ -39,6 +40,7 @@
#include "third_party/WebKit/public/platform/WebRTCSessionDescriptionRequest.h"
#include "third_party/WebKit/public/platform/WebRTCVoidRequest.h"
#include "third_party/WebKit/public/platform/WebURL.h"
+#include "third_party/WebKit/public/web/WebFrame.h"
using webrtc::DataChannelInterface;
using webrtc::IceCandidateInterface;
@@ -736,6 +738,15 @@ void RTCPeerConnectionHandler::associateWithFrame(blink::WebFrame* frame) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK(frame);
frame_ = frame;
+
+ // Copy the flag from Preference associated with this WebFrame.
+ RenderViewImpl* renderer_view_impl =
+ RenderViewImpl::FromWebView(frame_->view());
+ if (renderer_view_impl && dependency_factory_) {
+ dependency_factory_->set_disable_multiple_routes(
+ renderer_view_impl->renderer_preferences()
+ .disable_webrtc_multiple_routes);
+ }
}
bool RTCPeerConnectionHandler::initialize(

Powered by Google App Engine
This is Rietveld 408576698