summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-17 17:32:37 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-18 08:10:17 +0000
commit57f1127b8e4663e420a34e5ab5d90ca4d3665925 (patch)
treef632ce2a1ed5304a39f6b12fa0b43f44ea259d36 /src/core
parentc218716497093e5961c24b7c7fb9ed2c4160c204 (diff)
Support command-line argument --force-webrtc-ip-handling-policy
This command-line argument makes it possibly to block exposure of internal IP addresses when WebRTC access hasn't been granted, using --force-webrtc-ip-handling-policy=default_public_interface_only Task-number: QTBUG-57505 Change-Id: I0cddd1b20e0814811894204cb31e0c463a75f7be Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Diffstat (limited to 'src/core')
-rw-r--r--src/core/web_contents_adapter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 93e8674bd..a788b9679 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -73,6 +73,7 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/favicon_status.h"
#include "content/public/common/content_constants.h"
+#include "content/public/common/content_switches.h"
#include <content/public/common/drop_data.h>
#include "content/public/common/page_state.h"
#include "content/public/common/page_zoom.h"
@@ -419,6 +420,11 @@ void WebContentsAdapter::initialize(WebContentsAdapterClient *adapterClient)
rendererPrefs->caret_blink_interval = 0.5 * static_cast<double>(qtCursorFlashTime) / 1000;
rendererPrefs->user_agent_override = d->browserContextAdapter->httpUserAgent().toStdString();
rendererPrefs->accept_languages = d->browserContextAdapter->httpAcceptLanguageWithoutQualities().toStdString();
+#if defined(ENABLE_WEBRTC)
+ base::CommandLine* commandLine = base::CommandLine::ForCurrentProcess();
+ if (commandLine->HasSwitch(switches::kForceWebRtcIPHandlingPolicy))
+ rendererPrefs->webrtc_ip_handling_policy = commandLine->GetSwitchValueASCII(switches::kForceWebRtcIPHandlingPolicy);
+#endif
d->webContents->GetRenderViewHost()->SyncRendererPrefs();
// Create and attach observers to the WebContents.