diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-07-29 14:09:05 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-08-02 12:00:57 +0200 |
commit | 1a49f193afe1ba54339182a49d891917159f6719 (patch) | |
tree | 986cf277193c625c2f61015c7f29c6b403a5eb02 /src/core | |
parent | 47d6b5ce11d1014548ba69df5d7b698381a8343e (diff) | |
parent | fa138d4a76e9e820f01a75771c30dbced8c4e6f3 (diff) |
Merge remote-tracking branch 'origin/5.6' into 5.7
Conflicts:
src/3rdparty
src/core/resources/resources.gyp
src/webengine/doc/src/qtwebengine-overview.qdoc
src/webenginewidgets/api/qwebenginepage.cpp
src/webenginewidgets/api/qwebenginescriptcollection.cpp
src/webenginewidgets/api/qwebenginescriptcollection_p.h
tests/auto/widgets/qwebenginepage/BLACKLIST
And readded newly in 5.6 enabled tests to the BLACKLIST.
Change-Id: I4ab1fc54ebfaaf940df81b0d8d6bdd15cae8b7c4
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/browser_context_adapter.cpp | 10 | ||||
-rw-r--r-- | src/core/browser_context_adapter.h | 1 | ||||
-rw-r--r-- | src/core/content_main_delegate_qt.cpp | 1 | ||||
-rw-r--r-- | src/core/core.gyp | 12 | ||||
-rw-r--r-- | src/core/core_gyp_generator.pro | 6 | ||||
-rw-r--r-- | src/core/core_module.pro | 7 | ||||
-rw-r--r-- | src/core/gyp_run.pro | 2 | ||||
-rw-r--r-- | src/core/proxy_config_service_qt.cpp | 1 | ||||
-rw-r--r-- | src/core/qtwebengine.gypi | 2 | ||||
-rw-r--r-- | src/core/resources/resources.gyp | 14 | ||||
-rw-r--r-- | src/core/url_request_context_getter_qt.cpp | 25 | ||||
-rw-r--r-- | src/core/url_request_context_getter_qt.h | 1 | ||||
-rw-r--r-- | src/core/web_contents_adapter.cpp | 9 | ||||
-rw-r--r-- | src/core/web_contents_adapter.h | 6 | ||||
-rw-r--r-- | src/core/web_contents_adapter_client.h | 2 | ||||
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 17 | ||||
-rw-r--r-- | src/core/web_contents_delegate_qt.h | 2 | ||||
-rw-r--r-- | src/core/web_engine_context.cpp | 46 | ||||
-rw-r--r-- | src/core/web_engine_library_info.cpp | 29 | ||||
-rw-r--r-- | src/core/web_engine_settings.h | 1 | ||||
-rw-r--r-- | src/core/web_event_factory.cpp | 17 |
21 files changed, 120 insertions, 91 deletions
diff --git a/src/core/browser_context_adapter.cpp b/src/core/browser_context_adapter.cpp index e3b757587..24e2dc2c2 100644 --- a/src/core/browser_context_adapter.cpp +++ b/src/core/browser_context_adapter.cpp @@ -239,6 +239,16 @@ QString BrowserContextAdapter::cookiesPath() const return QString(); } +QString BrowserContextAdapter::channelIdPath() const +{ + if (m_offTheRecord) + return QString(); + QString basePath = dataPath(); + if (!basePath.isEmpty()) + return basePath % QLatin1String("/Origin Bound Certs"); + return QString(); +} + QString BrowserContextAdapter::httpCachePath() const { if (m_offTheRecord) diff --git a/src/core/browser_context_adapter.h b/src/core/browser_context_adapter.h index 94bc5fcde..a6e5a2a3e 100644 --- a/src/core/browser_context_adapter.h +++ b/src/core/browser_context_adapter.h @@ -103,6 +103,7 @@ public: QString httpCachePath() const; QString cookiesPath() const; + QString channelIdPath() const; QString httpUserAgent() const; void setHttpUserAgent(const QString &userAgent); diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp index 5933f873b..8bd07ef75 100644 --- a/src/core/content_main_delegate_qt.cpp +++ b/src/core/content_main_delegate_qt.cpp @@ -143,7 +143,6 @@ bool ContentMainDelegateQt::BasicStartupComplete(int *exit_code) #if ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE PathService::Override(base::DIR_QT_LIBRARY_DATA, WebEngineLibraryInfo::getPath(base::DIR_QT_LIBRARY_DATA)); #endif - PathService::Override(content::DIR_MEDIA_LIBS, WebEngineLibraryInfo::getPath(content::DIR_MEDIA_LIBS)); PathService::Override(ui::DIR_LOCALES, WebEngineLibraryInfo::getPath(ui::DIR_LOCALES)); #if defined(ENABLE_SPELLCHECK) PathService::Override(base::DIR_APP_DICTIONARIES, WebEngineLibraryInfo::getPath(base::DIR_APP_DICTIONARIES)); diff --git a/src/core/core.gyp b/src/core/core.gyp deleted file mode 100644 index ea5478cf1..000000000 --- a/src/core/core.gyp +++ /dev/null @@ -1,12 +0,0 @@ -{ - 'targets': [ - { - 'target_name': 'qtwebengine', - 'type': 'none', - 'dependencies': [ - 'core_generated.gyp:*', - 'resources/resources.gyp:*', - ], - }, - ] -} diff --git a/src/core/core_gyp_generator.pro b/src/core/core_gyp_generator.pro index cdff4ed64..7351b108c 100644 --- a/src/core/core_gyp_generator.pro +++ b/src/core/core_gyp_generator.pro @@ -2,8 +2,9 @@ # We want the gyp generation step to happen after all the other config steps. For that we need to prepend # our gyp_generator.prf feature to the CONFIG variable since it is processed backwards CONFIG = gyp_generator $$CONFIG -GYPFILE = $$PWD/core_generated.gyp -GYPINCLUDES += qtwebengine.gypi +GYPFILE = $$OUT_PWD/core_generated.gyp +GYPINCLUDES += $$PWD/qtwebengine.gypi +GYPSRCDIR = $$PWD TEMPLATE = lib @@ -18,6 +19,7 @@ DEFINES += QT_NO_KEYWORDS \ # Ensure that response files, generated by qtbase/mkspecs/features/moc.prf, are found by moc. MOC_DIR = $$OUT_PWD/$$getConfigDir()/.moc +RCC_DIR = $$OUT_PWD/$$getConfigDir()/.rcc # Assume that we want mobile touch and low-end hardware behaviors # whenever we are cross compiling. diff --git a/src/core/core_module.pro b/src/core/core_module.pro index 20b719547..3b9dab457 100644 --- a/src/core/core_module.pro +++ b/src/core/core_module.pro @@ -96,6 +96,13 @@ icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat } } +!win32:!build_pass:debug_and_release { + # Special GNU make target that ensures linking isn't done for both debug and release builds + # at the same time. + notParallel.target = .NOTPARALLEL + QMAKE_EXTRA_TARGETS += notParallel +} + OTHER_FILES = \ $$files(../3rdparty/chromium/*.h, true) \ $$files(../3rdparty/chromium/*.cc, true) \ diff --git a/src/core/gyp_run.pro b/src/core/gyp_run.pro index 8c4aeb163..2264d9b70 100644 --- a/src/core/gyp_run.pro +++ b/src/core/gyp_run.pro @@ -133,7 +133,7 @@ contains(WEBENGINE_CONFIG, no_spellcheck): { for (config, GYP_CONFIG): GYP_ARGS += "-D $$config" !build_pass { - message("Running gyp_qtwebengine \"$$OUT_PWD\" $${GYP_ARGS}...") + message("Running gyp_qtwebengine \"$$OUT_PWD\" $${GYP_ARGS}.") !system("python $$QTWEBENGINE_ROOT/tools/buildscripts/gyp_qtwebengine \"$$OUT_PWD\" $${GYP_ARGS}"): error("-- running gyp_qtwebengine failed --") } diff --git a/src/core/proxy_config_service_qt.cpp b/src/core/proxy_config_service_qt.cpp index 7affd9045..bd5d0375d 100644 --- a/src/core/proxy_config_service_qt.cpp +++ b/src/core/proxy_config_service_qt.cpp @@ -134,6 +134,7 @@ net::ProxyConfigService::ConfigAvailability ProxyConfigServiceQt::GetLatestProxy qtRules.type = net::ProxyConfig::ProxyRules::TYPE_NO_RULES; } + qtRules.bypass_rules.AddRuleToBypassLocal(); // don't use proxy for connections to localhost m_qtProxyConfig.proxy_rules() = qtRules; *config = m_qtProxyConfig; return CONFIG_VALID; diff --git a/src/core/qtwebengine.gypi b/src/core/qtwebengine.gypi index 4077431b1..816962d3d 100644 --- a/src/core/qtwebengine.gypi +++ b/src/core/qtwebengine.gypi @@ -38,7 +38,7 @@ '<(chromium_src_dir)/url/url.gyp:url_lib', '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8', - 'chrome_qt.gyp:chrome_qt', + '<(qtwebengine_root)/src/core/chrome_qt.gyp:chrome_qt', ], 'include_dirs': [ '<(chromium_src_dir)', diff --git a/src/core/resources/resources.gyp b/src/core/resources/resources.gyp index 88c5bb4be..618b4d355 100644 --- a/src/core/resources/resources.gyp +++ b/src/core/resources/resources.gyp @@ -13,17 +13,17 @@ 'qt_install_data%': '', 'qt_install_translations%': '', }, - 'dependencies': [ - '<(chromium_src_dir)/content/app/strings/content_strings.gyp:content_strings', - '<(chromium_src_dir)/blink/public/blink_resources.gyp:blink_resources', - '<(chromium_src_dir)/content/browser/devtools/devtools_resources.gyp:devtools_resources', - '<(chromium_src_dir)/components/components_strings.gyp:components_strings', - '../chrome_qt.gyp:chrome_resources', - ], 'targets': [ { 'target_name': 'qtwebengine_resources', 'type': 'none', + 'dependencies': [ + '<(chromium_src_dir)/content/app/strings/content_strings.gyp:content_strings', + '<(chromium_src_dir)/content/browser/devtools/devtools_resources.gyp:devtools_resources', + '<(chromium_src_dir)/components/components_strings.gyp:components_strings', + '<(chromium_src_dir)/third_party/WebKit/public/blink_resources.gyp:blink_resources', + '<(qtwebengine_root)/src/core/chrome_qt.gyp:chrome_resources', + ], 'actions' : [ { 'action_name': 'repack_resources', diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp index 579e33b66..bf32c75a4 100644 --- a/src/core/url_request_context_getter_qt.cpp +++ b/src/core/url_request_context_getter_qt.cpp @@ -51,6 +51,7 @@ #include "net/disk_cache/disk_cache.h" #include "net/dns/host_resolver.h" #include "net/dns/mapped_host_resolver.h" +#include "net/extras/sqlite/sqlite_channel_id_store.h" #include "net/http/http_auth_handler_factory.h" #include "net/http/http_cache.h" #include "net/http/http_network_session.h" @@ -126,6 +127,7 @@ void URLRequestContextGetterQt::setFullConfiguration(QSharedPointer<BrowserConte m_requestInterceptor = browserContext->requestInterceptor(); m_persistentCookiesPolicy = browserContext->persistentCookiesPolicy(); m_cookiesPath = browserContext->cookiesPath(); + m_channelIdPath = browserContext->channelIdPath(); m_httpAcceptLanguage = browserContext->httpAcceptLanguage(); m_httpUserAgent = browserContext->httpUserAgent(); m_httpCacheType = browserContext->httpCacheType(); @@ -221,11 +223,6 @@ void URLRequestContextGetterQt::generateStorage() net::ProxyConfigService *proxyConfigService = m_proxyConfigService.fetchAndStoreAcquire(0); Q_ASSERT(proxyConfigService); - - m_storage->set_channel_id_service(scoped_ptr<net::ChannelIDService>(new net::ChannelIDService( - new net::DefaultChannelIDStore(NULL), - base::WorkerPool::GetTaskRunner(true)))); - m_storage->set_cert_verifier(net::CertVerifier::CreateDefault()); scoped_ptr<net::HostResolver> host_resolver(net::HostResolver::CreateDefaultResolver(NULL)); @@ -257,8 +254,9 @@ void URLRequestContextGetterQt::updateCookieStore() { Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); QMutexLocker lock(&m_mutex); - m_httpAcceptLanguage = m_browserContext.data()->httpAcceptLanguage(); - m_httpUserAgent = m_browserContext.data()->httpUserAgent(); + m_persistentCookiesPolicy = m_browserContext.data()->persistentCookiesPolicy(); + m_cookiesPath = m_browserContext.data()->cookiesPath(); + m_channelIdPath = m_browserContext.data()->channelIdPath(); if (m_contextInitialized && !m_updateAllStorage && !m_updateCookieStore) { m_updateCookieStore = true; @@ -276,6 +274,19 @@ void URLRequestContextGetterQt::generateCookieStore() QMutexLocker lock(&m_mutex); m_updateCookieStore = false; + scoped_refptr<net::SQLiteChannelIDStore> channel_id_db; + if (!m_channelIdPath.isEmpty() && m_persistentCookiesPolicy != BrowserContextAdapter::NoPersistentCookies) { + channel_id_db = new net::SQLiteChannelIDStore( + toFilePath(m_channelIdPath), + BrowserThread::GetBlockingPool()->GetSequencedTaskRunner( + BrowserThread::GetBlockingPool()->GetSequenceToken())); + } + + m_storage->set_channel_id_service( + scoped_ptr<net::ChannelIDService>(new net::ChannelIDService( + new net::DefaultChannelIDStore(channel_id_db.get()), + base::WorkerPool::GetTaskRunner(true)))); + // Unset it first to get a chance to destroy and flush the old cookie store before opening a new on possibly the same file. m_storage->set_cookie_store(0); m_cookieDelegate->setCookieMonster(0); diff --git a/src/core/url_request_context_getter_qt.h b/src/core/url_request_context_getter_qt.h index eca956ea6..dd51fd72c 100644 --- a/src/core/url_request_context_getter_qt.h +++ b/src/core/url_request_context_getter_qt.h @@ -133,6 +133,7 @@ private: // FIXME: Should later be moved to a separate ProfileIOData class. BrowserContextAdapter::PersistentCookiesPolicy m_persistentCookiesPolicy; QString m_cookiesPath; + QString m_channelIdPath; QString m_httpAcceptLanguage; QString m_httpUserAgent; BrowserContextAdapter::HttpCacheType m_httpCacheType; diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 260efc081..bfac6a5b2 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -348,14 +348,14 @@ WebContentsAdapterPrivate::~WebContentsAdapterPrivate() webContents.reset(); } -QExplicitlySharedDataPointer<WebContentsAdapter> WebContentsAdapter::createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient) +QSharedPointer<WebContentsAdapter> WebContentsAdapter::createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient) { int currentIndex; std::vector<scoped_ptr<content::NavigationEntry>> entries; deserializeNavigationHistory(input, ¤tIndex, &entries, adapterClient->browserContextAdapter()->browserContext()); if (currentIndex == -1) - return QExplicitlySharedDataPointer<WebContentsAdapter>(); + return QSharedPointer<WebContentsAdapter>(); // Unlike WebCore, Chromium only supports Restoring to a new WebContents instance. content::WebContents* newWebContents = createBlankWebContents(adapterClient, adapterClient->browserContextAdapter()->browserContext()); @@ -373,7 +373,7 @@ QExplicitlySharedDataPointer<WebContentsAdapter> WebContentsAdapter::createFromS content::ChildProcessSecurityPolicy::GetInstance()->GrantReadFile(id, *file); } - return QExplicitlySharedDataPointer<WebContentsAdapter>(new WebContentsAdapter(newWebContents)); + return QSharedPointer<WebContentsAdapter>::create(newWebContents); } WebContentsAdapter::WebContentsAdapter(content::WebContents *webContents) @@ -835,6 +835,9 @@ void WebContentsAdapter::stopFinding() { Q_D(WebContentsAdapter); d->webContentsDelegate->setLastSearchedString(QString()); + // Clear any previous selection, + // but keep the renderer blue rectangle selection just like Chromium does. + d->webContents->Unselect(); d->webContents->StopFinding(content::STOP_FIND_ACTION_KEEP_SELECTION); } diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h index 0de1fb1d5..ec8cd7914 100644 --- a/src/core/web_contents_adapter.h +++ b/src/core/web_contents_adapter.h @@ -44,7 +44,7 @@ #include "web_contents_adapter_client.h" #include <QScopedPointer> -#include <QSharedData> +#include <QSharedPointer> #include <QString> #include <QUrl> @@ -69,9 +69,9 @@ class MessagePassingInterface; class WebContentsAdapterPrivate; class FaviconManager; -class QWEBENGINE_EXPORT WebContentsAdapter : public QSharedData { +class QWEBENGINE_EXPORT WebContentsAdapter : public QEnableSharedFromThis<WebContentsAdapter> { public: - static QExplicitlySharedDataPointer<WebContentsAdapter> createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient); + static QSharedPointer<WebContentsAdapter> createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient); // Takes ownership of the WebContents. WebContentsAdapter(content::WebContents *webContents = 0); ~WebContentsAdapter(); diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h index 7be9ca7b9..3952067a7 100644 --- a/src/core/web_contents_adapter_client.h +++ b/src/core/web_contents_adapter_client.h @@ -218,7 +218,7 @@ public: virtual void loadFinished(bool success, const QUrl &url, bool isErrorPage = false, int errorCode = 0, const QString &errorDescription = QString()) = 0; virtual void focusContainer() = 0; virtual void unhandledKeyEvent(QKeyEvent *event) = 0; - virtual void adoptNewWindow(WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect & initialGeometry) = 0; + virtual void adoptNewWindow(QSharedPointer<WebContentsAdapter> newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect & initialGeometry) = 0; virtual bool isBeingAdopted() = 0; virtual void close() = 0; virtual void windowCloseRejected() = 0; diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 2dd75df83..b96452093 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -100,7 +100,7 @@ content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents { content::WebContents *target = source; if (params.disposition != CURRENT_TAB) { - WebContentsAdapter *targetAdapter = createWindow(0, params.disposition, gfx::Rect(), params.user_gesture); + QSharedPointer<WebContentsAdapter> targetAdapter = createWindow(0, params.disposition, gfx::Rect(), params.user_gesture); if (targetAdapter) target = targetAdapter->webContents(); } @@ -152,7 +152,7 @@ bool WebContentsDelegateQt::ShouldPreserveAbortedURLs(content::WebContents *sour void WebContentsDelegateQt::AddNewContents(content::WebContents* source, content::WebContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture, bool* was_blocked) { Q_UNUSED(source) - WebContentsAdapter *newAdapter = createWindow(new_contents, disposition, initial_pos, user_gesture); + QWeakPointer<WebContentsAdapter> newAdapter = createWindow(new_contents, disposition, initial_pos, user_gesture); if (was_blocked) *was_blocked = !newAdapter; } @@ -389,20 +389,13 @@ void WebContentsDelegateQt::overrideWebPreferences(content::WebContents *, conte m_viewClient->webEngineSettings()->overrideWebPreferences(webPreferences); } -WebContentsAdapter *WebContentsDelegateQt::createWindow(content::WebContents *new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture) +QWeakPointer<WebContentsAdapter> WebContentsDelegateQt::createWindow(content::WebContents *new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture) { - WebContentsAdapter *newAdapter = new WebContentsAdapter(new_contents); - // Do the first ref-count manually to be able to know if the application is handling adoptNewWindow through the public API. - newAdapter->ref.ref(); + QSharedPointer<WebContentsAdapter> newAdapter = QSharedPointer<WebContentsAdapter>::create(new_contents); m_viewClient->adoptNewWindow(newAdapter, static_cast<WebContentsAdapterClient::WindowOpenDisposition>(disposition), user_gesture, toQt(initial_pos)); - if (!newAdapter->ref.deref()) { - // adoptNewWindow didn't increase the ref-count, newAdapter and its new_contents (if non-null) need to be discarded. - delete newAdapter; - newAdapter = 0; - } - + // If the client didn't reference the adapter, it will be deleted now, and the weak pointer zeroed. return newAdapter; } diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h index e6deaa409..d523aa16b 100644 --- a/src/core/web_contents_delegate_qt.h +++ b/src/core/web_contents_delegate_qt.h @@ -127,7 +127,7 @@ public: FaviconManager *faviconManager(); private: - WebContentsAdapter *createWindow(content::WebContents *new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture); + QWeakPointer<WebContentsAdapter> createWindow(content::WebContents *new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture); WebContentsAdapterClient *m_viewClient; QString m_lastSearchedString; diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 6da80e94d..98fba0897 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -86,8 +86,10 @@ #include "web_engine_library_info.h" #include <QFileInfo> #include <QGuiApplication> +#include <QOffscreenSurface> #include <QOpenGLContext> #include <QStringList> +#include <QSurfaceFormat> #include <QVector> #include <qpa/qplatformnativeinterface.h> @@ -294,15 +296,40 @@ WebEngineContext::WebEngineContext() GLContextHelper::initialize(); - if (usingANGLE() || usingSoftwareDynamicGL() || usingQtQuick2DRenderer()) { - parsedCommandLine->AppendSwitch(switches::kDisableGpu); - } else { - const char *glType = 0; + const char *glType = 0; + if (!usingANGLE() && !usingSoftwareDynamicGL() && !usingQtQuick2DRenderer()) { if (qt_gl_global_share_context()) { - if (qt_gl_global_share_context()->isOpenGLES()) { - glType = gfx::kGLImplementationEGLName; + if (!strcmp(qt_gl_global_share_context()->nativeHandle().typeName(), "QEGLNativeContext")) { + if (qt_gl_global_share_context()->isOpenGLES()) { + glType = gfx::kGLImplementationEGLName; + } else { + QOpenGLContext context; + QSurfaceFormat format; + + format.setRenderableType(QSurfaceFormat::OpenGLES); + format.setVersion(2, 0); + + context.setFormat(format); + context.setShareContext(qt_gl_global_share_context()); + if (context.create()) { + QOffscreenSurface surface; + + surface.setFormat(format); + surface.create(); + + if (context.makeCurrent(&surface)) { + if (context.hasExtension("GL_ARB_ES2_compatibility")) + glType = gfx::kGLImplementationEGLName; + + context.doneCurrent(); + } + + surface.destroy(); + } + } } else { - glType = gfx::kGLImplementationDesktopName; + if (!qt_gl_global_share_context()->isOpenGLES()) + glType = gfx::kGLImplementationDesktopName; } } else { qWarning("WebEngineContext used before QtWebEngine::initialize()"); @@ -316,9 +343,12 @@ WebEngineContext::WebEngineContext() break; } } + } + if (glType) parsedCommandLine->AppendSwitchASCII(switches::kUseGL, glType); - } + else + parsedCommandLine->AppendSwitch(switches::kDisableGpu); content::UtilityProcessHostImpl::RegisterUtilityMainThreadFactory(content::CreateInProcessUtilityThread); content::RenderProcessHostImpl::RegisterRendererMainThreadFactory(content::CreateInProcessRendererThread); diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp index 2de3d39ff..399e36765 100644 --- a/src/core/web_engine_library_info.cpp +++ b/src/core/web_engine_library_info.cpp @@ -154,33 +154,6 @@ QString subProcessPath() return processPath; } -QString pluginsPath() -{ -#if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) - static QString pluginsPath = getPath(frameworkBundle()) % QLatin1String("/Libraries"); -#else - static bool initialized = false; - static QString pluginsPath; - - if (!initialized) { - initialized = true; - const QStringList directories = QCoreApplication::libraryPaths(); - Q_FOREACH (const QString &dir, directories) { - const QString candidate = dir % "/" % QLatin1String("qtwebengine"); - if (QFileInfo::exists(candidate)) { - pluginsPath = candidate; - break; - } - } - - if (pluginsPath.isEmpty()) { - pluginsPath = fallbackDir(); - } - } -#endif - return pluginsPath; -} - QString localesPath() { #if defined(OS_MACOSX) && defined(QT_MAC_FRAMEWORK_BUILD) @@ -306,8 +279,6 @@ base::FilePath WebEngineLibraryInfo::getPath(int key) break; case base::DIR_QT_LIBRARY_DATA: return toFilePath(icuDataPath()); - case content::DIR_MEDIA_LIBS: - return toFilePath(pluginsPath()); case ui::DIR_LOCALES: return toFilePath(localesPath()); #if defined(ENABLE_SPELLCHECK) diff --git a/src/core/web_engine_settings.h b/src/core/web_engine_settings.h index b623f1ec2..e21eee8a9 100644 --- a/src/core/web_engine_settings.h +++ b/src/core/web_engine_settings.h @@ -42,7 +42,6 @@ #include "qtwebenginecoreglobal.h" -#include <QExplicitlySharedDataPointer> #include <QScopedPointer> #include <QHash> #include <QUrl> diff --git a/src/core/web_event_factory.cpp b/src/core/web_event_factory.cpp index 10809a764..80850af70 100644 --- a/src/core/web_event_factory.cpp +++ b/src/core/web_event_factory.cpp @@ -492,6 +492,19 @@ static WebMouseEvent::Button mouseButtonForEvent(QMouseEvent *event) return WebMouseEvent::ButtonRight; else if (event->button() == Qt::MidButton) return WebMouseEvent::ButtonMiddle; + + if (event->type() != QEvent::MouseMove) + return WebMouseEvent::ButtonNone; + + // This is technically wrong, mouse move should always have ButtonNone, + // but it is consistent with aura and selection code depends on it: + if (event->buttons() & Qt::LeftButton) + return WebMouseEvent::ButtonLeft; + else if (event->buttons() & Qt::RightButton) + return WebMouseEvent::ButtonRight; + else if (event->buttons() & Qt::MidButton) + return WebMouseEvent::ButtonMiddle; + return WebMouseEvent::ButtonNone; } @@ -659,8 +672,8 @@ blink::WebMouseWheelEvent WebEventFactory::toWebWheelEvent(QWheelEvent *ev, doub webEvent.modifiers = modifiersForEvent(ev); webEvent.timeStampSeconds = currentTimeForEvent(ev); - webEvent.wheelTicksX = ev->angleDelta().x() / QWheelEvent::DefaultDeltasPerStep; - webEvent.wheelTicksY = ev->angleDelta().y() / QWheelEvent::DefaultDeltasPerStep; + webEvent.wheelTicksX = static_cast<float>(ev->angleDelta().x()) / QWheelEvent::DefaultDeltasPerStep; + webEvent.wheelTicksY = static_cast<float>(ev->angleDelta().y()) / QWheelEvent::DefaultDeltasPerStep; // We can't use the device specific QWheelEvent::pixelDelta(), so we calculate // a pixel delta based on ticks and scroll per line. |