summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-08-30 12:46:45 +0200
committerAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-08-30 12:47:20 +0200
commitda6f33c8929bf122e7cdec5617d89c59d03e3632 (patch)
tree9d90d90a3e7cdd6fbca8d40b54a45e90877677e4 /src/core
parent9cda8d4384825bd93b949f31953548beda165ef8 (diff)
parent327c9b9e0c68550e474d9ffdc21ece6324b5e7a1 (diff)
Merge remote-tracking branch 'origin/5.7' into 5.8
Diffstat (limited to 'src/core')
-rw-r--r--src/core/config/linux.pri11
-rw-r--r--src/core/gyp_run.pro2
-rw-r--r--src/core/web_engine_context.cpp13
-rw-r--r--src/core/web_engine_settings.cpp4
-rw-r--r--src/core/web_engine_settings.h3
5 files changed, 31 insertions, 2 deletions
diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri
index 5e04701a0..a51a703bb 100644
--- a/src/core/config/linux.pri
+++ b/src/core/config/linux.pri
@@ -39,8 +39,17 @@ qtConfig(system-zlib): use?(system_minizip): GYP_CONFIG += use_system_zlib=1
qtConfig(system-png): GYP_CONFIG += use_system_libpng=1
qtConfig(system-jpeg): GYP_CONFIG += use_system_libjpeg=1
qtConfig(system-harfbuzz): GYP_CONFIG += use_system_harfbuzz=1
-!contains(QT_CONFIG, pulseaudio): GYP_CONFIG += use_pulseaudio=0
!qtConfig(glib): GYP_CONFIG += use_glib=0
+contains(QT_CONFIG, pulseaudio) {
+ GYP_CONFIG += use_pulseaudio=1
+} else {
+ GYP_CONFIG += use_pulseaudio=0
+}
+contains(QT_CONFIG, alsa) {
+ GYP_CONFIG += use_alsa=1
+} else {
+ GYP_CONFIG += use_alsa=0
+}
use?(system_libevent): GYP_CONFIG += use_system_libevent=1
use?(system_libwebp): GYP_CONFIG += use_system_libwebp=1
use?(system_libsrtp): GYP_CONFIG += use_system_libsrtp=1
diff --git a/src/core/gyp_run.pro b/src/core/gyp_run.pro
index ea911afda..7014adbf7 100644
--- a/src/core/gyp_run.pro
+++ b/src/core/gyp_run.pro
@@ -19,6 +19,8 @@ cross_compile {
GYP_CONFIG += qtwe_process_name_debug=$$QTWEBENGINEPROCESS_NAME_DEBUG
GYP_CONFIG += qtwe_process_name_release=$$QTWEBENGINEPROCESS_NAME_RELEASE
GYP_CONFIG += disable_glibcxx_debug=1
+!contains(QT_CONFIG, no-pkg-config): GYP_CONFIG += pkg-config=$$pkgConfigExecutable()
+
!webcore_debug: GYP_CONFIG += remove_webcore_debug_symbols=1
!v8base_debug: GYP_CONFIG += remove_v8base_debug_symbols=1
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 426782f4e..0687b23c5 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -103,6 +103,7 @@ QT_END_NAMESPACE
namespace {
scoped_refptr<QtWebEngineCore::WebEngineContext> sContext;
+static bool s_destroyed = false;
void destroyContext()
{
@@ -111,6 +112,7 @@ void destroyContext()
// WebEngineContext's pointer is used.
sContext->destroy();
sContext = 0;
+ s_destroyed = true;
}
bool usingANGLE()
@@ -189,18 +191,29 @@ void WebEngineContext::destroy()
// RenderProcessHostImpl should be destroyed before WebEngineContext since
// default BrowserContext might be used by the RenderprocessHostImpl's destructor.
m_browserRunner.reset(0);
+
+ // Drop the false reference.
+ sContext->Release();
}
WebEngineContext::~WebEngineContext()
{
+ // WebEngineContext::destroy() must be called before we are deleted
+ Q_ASSERT(!m_globalQObject);
+ Q_ASSERT(!m_devtools);
+ Q_ASSERT(!m_browserRunner);
}
scoped_refptr<WebEngineContext> WebEngineContext::current()
{
+ if (s_destroyed)
+ return nullptr;
if (!sContext.get()) {
sContext = new WebEngineContext();
// Make sure that we ramp down Chromium before QApplication destroys its X connection, etc.
qAddPostRoutine(destroyContext);
+ // Add a false reference so there is no race between unreferencing sContext and a global QApplication.
+ sContext->AddRef();
}
return sContext;
}
diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp
index 754fa2f51..8e284c9d6 100644
--- a/src/core/web_engine_settings.cpp
+++ b/src/core/web_engine_settings.cpp
@@ -44,6 +44,7 @@
#include "type_conversion.h"
#include "base/command_line.h"
+#include "chrome/common/chrome_switches.h"
#include "content/browser/gpu/gpu_process_host.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/web_preferences.h"
@@ -232,6 +233,7 @@ void WebEngineSettings::initDefaults(bool offTheRecord)
!commandLine->HasSwitch(switches::kDisableExperimentalWebGL);
bool accelerated2dCanvas = content::GpuProcessHost::gpu_enabled() &&
!commandLine->HasSwitch(switches::kDisableAccelerated2dCanvas);
+ bool allowRunningInsecureContent = commandLine->HasSwitch(switches::kAllowRunningInsecureContent);
s_defaultAttributes.insert(ScrollAnimatorEnabled, smoothScrolling);
s_defaultAttributes.insert(WebGLEnabled, webGL);
s_defaultAttributes.insert(Accelerated2dCanvasEnabled, accelerated2dCanvas);
@@ -239,6 +241,7 @@ void WebEngineSettings::initDefaults(bool offTheRecord)
s_defaultAttributes.insert(TouchIconsEnabled, false);
s_defaultAttributes.insert(FocusOnNavigationEnabled, true);
s_defaultAttributes.insert(PrintElementBackgrounds, true);
+ s_defaultAttributes.insert(AllowRunningInsecureContent, allowRunningInsecureContent);
}
if (offTheRecord)
m_attributes.insert(LocalStorageEnabled, false);
@@ -315,6 +318,7 @@ void WebEngineSettings::applySettingsToWebPreferences(content::WebPreferences *p
prefs->accelerated_2d_canvas_enabled = testAttribute(Accelerated2dCanvasEnabled);
prefs->experimental_webgl_enabled = testAttribute(WebGLEnabled);
prefs->should_print_backgrounds = testAttribute(PrintElementBackgrounds);
+ prefs->allow_running_insecure_content = testAttribute(AllowRunningInsecureContent);
// Fonts settings.
prefs->standard_font_family_map[content::kCommonScript] = toString16(fontFamily(StandardFont));
diff --git a/src/core/web_engine_settings.h b/src/core/web_engine_settings.h
index 31f2198b8..8459ba75b 100644
--- a/src/core/web_engine_settings.h
+++ b/src/core/web_engine_settings.h
@@ -81,7 +81,8 @@ public:
AutoLoadIconsForPage,
TouchIconsEnabled,
FocusOnNavigationEnabled,
- PrintElementBackgrounds
+ PrintElementBackgrounds,
+ AllowRunningInsecureContent
};
// Must match the values from the public API in qwebenginesettings.h.