summaryrefslogtreecommitdiffstats
path: root/src
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
parent9cda8d4384825bd93b949f31953548beda165ef8 (diff)
parent327c9b9e0c68550e474d9ffdc21ece6324b5e7a1 (diff)
Merge remote-tracking branch 'origin/5.7' into 5.8
Diffstat (limited to 'src')
-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
-rw-r--r--src/process/main.cpp64
6 files changed, 32 insertions, 65 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.
diff --git a/src/process/main.cpp b/src/process/main.cpp
index 38bb5409e..d2f9d2337 100644
--- a/src/process/main.cpp
+++ b/src/process/main.cpp
@@ -42,10 +42,7 @@
#include <QCoreApplication>
#include <stdio.h>
-#if defined(OS_LINUX)
-#if defined(__GLIBC__) && !defined(__UCLIBC__) && !defined(OS_ANDROID) && !defined(HAVE_XSTAT)
-#define HAVE_XSTAT 1
-#endif
+#if defined(Q_OS_LINUX)
struct tm;
struct stat;
@@ -59,19 +56,6 @@ struct tm* localtime_r_override(const time_t* timep, struct tm* result);
struct tm* localtime64_r_override(const time_t* timep, struct tm* result);
}
-// exported in libc_urandom_proxy.cc
-namespace sandbox {
-FILE* fopen_override(const char* path, const char* mode);
-FILE* fopen64_override(const char* path, const char* mode);
-#if HAVE_XSTAT
-int xstat_override(int version, const char *path, struct stat *buf);
-int xstat64_override(int version, const char *path, struct stat64 *buf);
-#else
-int stat_override(const char *path, struct stat *buf);
-int stat64_override(const char *path, struct stat64 *buf);
-#endif
-}
-
// from zygote_main_linux.cc
__attribute__ ((__visibility__("default")))
struct tm* localtime_proxy(const time_t* timep) __asm__ ("localtime");
@@ -101,52 +85,6 @@ struct tm* localtime64_r_proxy(const time_t* timep, struct tm* result)
return content::localtime64_r_override(timep, result);
}
-// from libc_urandom_proxy.cc
-__attribute__ ((__visibility__("default")))
-FILE* fopen_proxy(const char* path, const char* mode) __asm__ ("fopen");
-FILE* fopen_proxy(const char* path, const char* mode)
-{
- return sandbox::fopen_override(path, mode);
-}
-
-__attribute__ ((__visibility__("default")))
-FILE* fopen64_proxy(const char* path, const char* mode) __asm__ ("fopen64");
-FILE* fopen64_proxy(const char* path, const char* mode)
-{
- return sandbox::fopen64_override(path, mode);
-}
-
-#if HAVE_XSTAT
-__attribute__ ((__visibility__("default")))
-int xstat_proxy(int version, const char *path, struct stat *buf) __asm__ ("__xstat");
-int xstat_proxy(int version, const char *path, struct stat *buf)
-{
- return sandbox::xstat_override(version, path, buf);
-}
-
-__attribute__ ((__visibility__("default")))
-int xstat64_proxy(int version, const char *path, struct stat64 *buf) __asm__ ("__xstat64");
-int xstat64_proxy(int version, const char *path, struct stat64 *buf)
-{
- return sandbox::xstat64_override(version, path, buf);
-}
-
-#else
-__attribute__ ((__visibility__("default")))
-int stat_proxy(const char *path, struct stat *buf) __asm__ ("stat");
-int stat_proxy(const char *path, struct stat *buf)
-{
- return sandbox::stat_override(path, buf);
-}
-
-__attribute__ ((__visibility__("default")))
-int stat64_proxy(const char *path, struct stat64 *buf) __asm__ ("stat64");
-int stat64_proxy(const char *path, struct stat64 *buf)
-{
- return sandbox::stat64_override(path, buf);
-}
-
-#endif
#endif // defined(OS_LINUX)
#ifdef Q_OS_WIN