summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-08-01 16:19:34 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2016-09-14 08:15:39 +0000
commitf1e2b2d80366b43ba638290bca55272b000b3ce1 (patch)
tree9b3d4708f0cd80a1c73aeacdbf3b5640c7fa80ab /src
parentbaaab31631dcff6075418c95f0220e8fb207dd50 (diff)
Adaptations to Chromium 53
Change-Id: I15053486edfd42ee607250b4f14fb6eaa325c959 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src')
m---------src/3rdparty0
-rw-r--r--src/core/browser_context_qt.h2
-rw-r--r--src/core/content_browser_client_qt.cpp70
-rw-r--r--src/core/content_browser_client_qt.h7
-rw-r--r--src/core/content_client_qt.cpp2
-rw-r--r--src/core/delegated_frame_node.cpp28
-rw-r--r--src/core/delegated_frame_node.h2
-rw-r--r--src/core/file_picker_controller.cpp2
-rw-r--r--src/core/gl_context_qt.cpp20
-rw-r--r--src/core/gl_context_qt.h6
-rw-r--r--src/core/gl_surface_qt.cpp72
-rw-r--r--src/core/gl_surface_qt.h2
-rw-r--r--src/core/network_delegate_qt.cpp8
-rw-r--r--src/core/network_delegate_qt.h7
-rw-r--r--src/core/print_view_manager_base_qt.cpp2
-rw-r--r--src/core/print_view_manager_qt.cpp5
-rw-r--r--src/core/qtwebengine_extras.gypi17
-rw-r--r--src/core/render_widget_host_view_qt.cpp21
-rw-r--r--src/core/render_widget_host_view_qt.h5
-rw-r--r--src/core/renderer/content_renderer_client_qt.cpp5
-rw-r--r--src/core/renderer/render_frame_observer_qt.h1
-rw-r--r--src/core/renderer/render_view_observer_qt.cpp4
-rw-r--r--src/core/renderer/render_view_observer_qt.h1
-rw-r--r--src/core/renderer/web_channel_ipc_transport.h1
-rw-r--r--src/core/resource_dispatcher_host_delegate_qt.cpp3
-rw-r--r--src/core/resource_dispatcher_host_delegate_qt.h8
-rw-r--r--src/core/surface_factory_qt.cpp8
-rw-r--r--src/core/url_request_context_getter_qt.cpp2
-rw-r--r--src/core/web_contents_adapter.cpp6
-rw-r--r--src/core/web_contents_delegate_qt.cpp4
-rw-r--r--src/core/web_contents_delegate_qt.h2
-rw-r--r--src/core/web_engine_context.cpp12
32 files changed, 192 insertions, 143 deletions
diff --git a/src/3rdparty b/src/3rdparty
-Subproject 55be8abc690b546fb97f97623387e0999b7cbce
+Subproject 92025b92af8286393decb89b314cd7146d1ce15
diff --git a/src/core/browser_context_qt.h b/src/core/browser_context_qt.h
index dcd2da748..57ee138b1 100644
--- a/src/core/browser_context_qt.h
+++ b/src/core/browser_context_qt.h
@@ -71,7 +71,7 @@ public:
base::FilePath GetCachePath() const;
virtual bool IsOffTheRecord() const Q_DECL_OVERRIDE;
- net::URLRequestContextGetter *GetRequestContext() Q_DECL_DEPRECATED;
+ net::URLRequestContextGetter *GetRequestContext();
virtual net::URLRequestContextGetter *CreateMediaRequestContext() Q_DECL_OVERRIDE;
virtual net::URLRequestContextGetter *CreateMediaRequestContextForStoragePartition(const base::FilePath& partition_path, bool in_memory) Q_DECL_OVERRIDE;
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 627544794..5131d8229 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -48,6 +48,7 @@
#include "content/browser/renderer_host/render_view_host_delegate.h"
#include "content/public/browser/browser_main_parts.h"
#include "content/public/browser/child_process_security_policy.h"
+#include "content/public/browser/geolocation_delegate.h"
#include "content/public/browser/media_observer.h"
#include "content/public/browser/quota_permission_context.h"
#include "content/public/browser/render_frame_host.h"
@@ -260,16 +261,16 @@ private:
DISALLOW_COPY_AND_ASSIGN(BrowserMainPartsQt);
};
-class QtShareGLContext : public gfx::GLContext {
+class QtShareGLContext : public gl::GLContext {
public:
QtShareGLContext(QOpenGLContext *qtContext)
- : gfx::GLContext(0)
+ : gl::GLContext(0)
, m_handle(0)
{
QString platform = qApp->platformName().toLower();
QPlatformNativeInterface *pni = QGuiApplication::platformNativeInterface();
if (platform == QLatin1String("xcb")) {
- if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2)
+ if (gl::GetGLImplementation() == gl::kGLImplementationEGLGLES2)
m_handle = pni->nativeResourceForContext(QByteArrayLiteral("eglcontext"), qtContext);
else
m_handle = pni->nativeResourceForContext(QByteArrayLiteral("glxcontext"), qtContext);
@@ -280,7 +281,7 @@ public:
else if (platform == QLatin1String("eglfs") || platform == QLatin1String("wayland"))
m_handle = pni->nativeResourceForContext(QByteArrayLiteral("eglcontext"), qtContext);
else if (platform == QLatin1String("windows")) {
- if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2)
+ if (gl::GetGLImplementation() == gl::kGLImplementationEGLGLES2)
m_handle = pni->nativeResourceForContext(QByteArrayLiteral("eglContext"), qtContext);
else
m_handle = pni->nativeResourceForContext(QByteArrayLiteral("renderingcontext"), qtContext);
@@ -296,12 +297,12 @@ public:
virtual bool WasAllocatedUsingRobustnessExtension() { return false; }
// We don't care about the rest, this context shouldn't be used except for its handle.
- virtual bool Initialize(gfx::GLSurface *, gfx::GpuPreference) Q_DECL_OVERRIDE { Q_UNREACHABLE(); return false; }
- virtual bool MakeCurrent(gfx::GLSurface *) Q_DECL_OVERRIDE { Q_UNREACHABLE(); return false; }
- virtual void ReleaseCurrent(gfx::GLSurface *) Q_DECL_OVERRIDE { Q_UNREACHABLE(); }
- virtual bool IsCurrent(gfx::GLSurface *) Q_DECL_OVERRIDE { Q_UNREACHABLE(); return false; }
+ virtual bool Initialize(gl::GLSurface *, gl::GpuPreference) Q_DECL_OVERRIDE { Q_UNREACHABLE(); return false; }
+ virtual bool MakeCurrent(gl::GLSurface *) Q_DECL_OVERRIDE { Q_UNREACHABLE(); return false; }
+ virtual void ReleaseCurrent(gl::GLSurface *) Q_DECL_OVERRIDE { Q_UNREACHABLE(); }
+ virtual bool IsCurrent(gl::GLSurface *) Q_DECL_OVERRIDE { Q_UNREACHABLE(); return false; }
virtual void OnSetSwapInterval(int) Q_DECL_OVERRIDE { Q_UNREACHABLE(); }
- virtual scoped_refptr<gfx::GPUTimingClient> CreateGPUTimingClient() Q_DECL_OVERRIDE
+ virtual scoped_refptr<gl::GPUTimingClient> CreateGPUTimingClient() Q_DECL_OVERRIDE
{
return nullptr;
}
@@ -310,9 +311,9 @@ private:
void *m_handle;
};
-class ShareGroupQtQuick : public gfx::GLShareGroup {
+class ShareGroupQtQuick : public gl::GLShareGroup {
public:
- virtual gfx::GLContext* GetContext() Q_DECL_OVERRIDE { return m_shareContextQtQuick.get(); }
+ virtual gl::GLContext* GetContext() Q_DECL_OVERRIDE { return m_shareContextQtQuick.get(); }
virtual void AboutToAddFirstContext() Q_DECL_OVERRIDE;
private:
@@ -385,7 +386,7 @@ void ContentBrowserClientQt::ResourceDispatcherHostCreated()
content::ResourceDispatcherHost::Get()->SetDelegate(m_resourceDispatcherHostDelegate.get());
}
-gfx::GLShareGroup *ContentBrowserClientQt::GetInProcessGpuShareGroup()
+gl::GLShareGroup *ContentBrowserClientQt::GetInProcessGpuShareGroup()
{
if (!m_shareGroupQtQuick.get())
m_shareGroupQtQuick = new ShareGroupQtQuick;
@@ -403,9 +404,41 @@ void ContentBrowserClientQt::OverrideWebkitPrefs(content::RenderViewHost *rvh, c
static_cast<WebContentsDelegateQt*>(webContents->GetDelegate())->overrideWebPreferences(webContents, web_prefs);
}
-content::AccessTokenStore *ContentBrowserClientQt::CreateAccessTokenStore()
+namespace {
+
+// A provider of services needed by Geolocation.
+class GeolocationDelegateQt : public content::GeolocationDelegate {
+public:
+ GeolocationDelegateQt() {}
+ content::AccessTokenStore* CreateAccessTokenStore() final
+ {
+ return new AccessTokenStoreQt;
+ }
+
+ content::LocationProvider* OverrideSystemLocationProvider() final
+ {
+#ifdef QT_USE_POSITIONING
+ if (!m_location_provider)
+ m_location_provider = base::WrapUnique(new LocationProviderQt);
+ return m_location_provider.get();
+#else
+ return nullptr;
+#endif
+ }
+
+private:
+#ifdef QT_USE_POSITIONING
+ std::unique_ptr<LocationProviderQt> m_location_provider;
+#endif
+
+ DISALLOW_COPY_AND_ASSIGN(GeolocationDelegateQt);
+};
+
+} // anonymous namespace
+
+content::GeolocationDelegate *ContentBrowserClientQt::CreateGeolocationDelegate()
{
- return new AccessTokenStoreQt;
+ return new GeolocationDelegateQt;
}
content::QuotaPermissionContext *ContentBrowserClientQt::CreateQuotaPermissionContext()
@@ -435,15 +468,6 @@ void ContentBrowserClientQt::AllowCertificateError(content::WebContents *webCont
*result = content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY;
}
-content::LocationProvider *ContentBrowserClientQt::OverrideSystemLocationProvider()
-{
-#ifdef QT_USE_POSITIONING
- return new LocationProviderQt;
-#else
- return 0; // Leave it up to Chromium to figure something out.
-#endif
-}
-
std::string ContentBrowserClientQt::GetApplicationLocale()
{
return WebEngineLibraryInfo::getApplicationLocale();
diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
index d7b962b6a..acbf1a059 100644
--- a/src/core/content_browser_client_qt.h
+++ b/src/core/content_browser_client_qt.h
@@ -66,7 +66,7 @@ class WebContents;
struct MainFunctionParams;
}
-namespace gfx {
+namespace gl {
class GLShareGroup;
}
@@ -85,9 +85,9 @@ public:
virtual content::BrowserMainParts* CreateBrowserMainParts(const content::MainFunctionParams&) Q_DECL_OVERRIDE;
virtual void RenderProcessWillLaunch(content::RenderProcessHost* host) Q_DECL_OVERRIDE;
virtual void ResourceDispatcherHostCreated() Q_DECL_OVERRIDE;
- virtual gfx::GLShareGroup* GetInProcessGpuShareGroup() Q_DECL_OVERRIDE;
+ virtual gl::GLShareGroup* GetInProcessGpuShareGroup() Q_DECL_OVERRIDE;
virtual content::MediaObserver* GetMediaObserver() Q_DECL_OVERRIDE;
- virtual content::AccessTokenStore* CreateAccessTokenStore() Q_DECL_OVERRIDE;
+ virtual content::GeolocationDelegate* CreateGeolocationDelegate() Q_DECL_OVERRIDE;
virtual content::QuotaPermissionContext *CreateQuotaPermissionContext() Q_DECL_OVERRIDE;
virtual void OverrideWebkitPrefs(content::RenderViewHost *, content::WebPreferences *) Q_DECL_OVERRIDE;
virtual void AllowCertificateError(content::WebContents* web_contents,
@@ -100,7 +100,6 @@ public:
bool expired_previous_decision,
const base::Callback<void(bool)>& callback,
content::CertificateRequestResultType* result) Q_DECL_OVERRIDE;
- content::LocationProvider* OverrideSystemLocationProvider() Q_DECL_OVERRIDE;
content::DevToolsManagerDelegate *GetDevToolsManagerDelegate() Q_DECL_OVERRIDE;
virtual std::string GetApplicationLocale() Q_DECL_OVERRIDE;
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index 49c018b23..2725ab9e4 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -92,8 +92,6 @@ const char kPpapiFlashVersion[] = "ppapi-flash-version";
const char kPpapiWidevinePath[] = "ppapi-widevine-path";
}
-static const base::FilePath::CharType kWidevineCdmBaseDirectory[] = FILE_PATH_LITERAL("WidevineCDM");
-
static const char kWidevineCdmPluginExtension[] = "";
static const int32_t kWidevineCdmPluginPermissions = ppapi::PERMISSION_DEV
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp
index 11d56c333..d42ad4e7c 100644
--- a/src/core/delegated_frame_node.cpp
+++ b/src/core/delegated_frame_node.cpp
@@ -199,22 +199,22 @@ static QSGNode *buildLayerChain(QSGNode *chainParent, const cc::SharedQuadState
return layerChain;
}
-static void waitChromiumSync(gfx::TransferableFence *sync)
+static void waitChromiumSync(gl::TransferableFence *sync)
{
// Chromium uses its own GL bindings and stores in in thread local storage.
// For that reason, let chromium_gpu_helper.cpp contain the producing code that will run in the Chromium
// GPU thread, and put the sync consuming code here that will run in the QtQuick SG or GUI thread.
switch (sync->type) {
- case gfx::TransferableFence::NoSync:
+ case gl::TransferableFence::NoSync:
break;
- case gfx::TransferableFence::EglSync:
+ case gl::TransferableFence::EglSync:
#ifdef EGL_KHR_reusable_sync
{
static bool resolved = false;
static PFNEGLCLIENTWAITSYNCKHRPROC eglClientWaitSyncKHR = 0;
if (!resolved) {
- if (gfx::GLSurfaceQt::HasEGLExtension("EGL_KHR_fence_sync")) {
+ if (gl::GLSurfaceQt::HasEGLExtension("EGL_KHR_fence_sync")) {
QOpenGLContext *context = QOpenGLContext::currentContext();
eglClientWaitSyncKHR = (PFNEGLCLIENTWAITSYNCKHRPROC)context->getProcAddress("eglClientWaitSyncKHR");
}
@@ -227,7 +227,7 @@ static void waitChromiumSync(gfx::TransferableFence *sync)
}
#endif
break;
- case gfx::TransferableFence::ArbSync:
+ case gl::TransferableFence::ArbSync:
typedef void (QOPENGLF_APIENTRYP WaitSyncPtr)(GLsync sync, GLbitfield flags, GLuint64 timeout);
static WaitSyncPtr glWaitSync_ = 0;
if (!glWaitSync_) {
@@ -240,22 +240,22 @@ static void waitChromiumSync(gfx::TransferableFence *sync)
}
}
-static void deleteChromiumSync(gfx::TransferableFence *sync)
+static void deleteChromiumSync(gl::TransferableFence *sync)
{
// Chromium uses its own GL bindings and stores in in thread local storage.
// For that reason, let chromium_gpu_helper.cpp contain the producing code that will run in the Chromium
// GPU thread, and put the sync consuming code here that will run in the QtQuick SG or GUI thread.
switch (sync->type) {
- case gfx::TransferableFence::NoSync:
+ case gl::TransferableFence::NoSync:
break;
- case gfx::TransferableFence::EglSync:
+ case gl::TransferableFence::EglSync:
#ifdef EGL_KHR_reusable_sync
{
static bool resolved = false;
static PFNEGLDESTROYSYNCKHRPROC eglDestroySyncKHR = 0;
if (!resolved) {
- if (gfx::GLSurfaceQt::HasEGLExtension("EGL_KHR_fence_sync")) {
+ if (gl::GLSurfaceQt::HasEGLExtension("EGL_KHR_fence_sync")) {
QOpenGLContext *context = QOpenGLContext::currentContext();
eglDestroySyncKHR = (PFNEGLDESTROYSYNCKHRPROC)context->getProcAddress("eglDestroySyncKHR");
}
@@ -270,7 +270,7 @@ static void deleteChromiumSync(gfx::TransferableFence *sync)
}
#endif
break;
- case gfx::TransferableFence::ArbSync:
+ case gl::TransferableFence::ArbSync:
typedef void (QOPENGLF_APIENTRYP DeleteSyncPtr)(GLsync sync);
static DeleteSyncPtr glDeleteSync_ = 0;
if (!glDeleteSync_) {
@@ -685,7 +685,7 @@ QSGTexture *DelegatedFrameNode::initAndHoldTexture(ResourceHolder *resource, boo
void DelegatedFrameNode::fetchAndSyncMailboxes(QList<MailboxTexture *> &mailboxesToFetch)
{
- QList<gfx::TransferableFence> transferredFences;
+ QList<gl::TransferableFence> transferredFences;
{
QMutexLocker lock(&m_mutex);
@@ -717,7 +717,7 @@ void DelegatedFrameNode::fetchAndSyncMailboxes(QList<MailboxTexture *> &mailboxe
m_textureFences.swap(transferredFences);
}
- Q_FOREACH (gfx::TransferableFence sync, transferredFences) {
+ Q_FOREACH (gl::TransferableFence sync, transferredFences) {
// We need to wait on the fences on the Qt current context, and
// can therefore not use GLFence routines that uses a different
// concept of current context.
@@ -785,9 +785,9 @@ void DelegatedFrameNode::pullTexture(DelegatedFrameNode *frameNode, MailboxTextu
if (syncToken.HasData())
mailboxManager->PullTextureUpdates(syncToken);
texture->fetchTexture(mailboxManager);
- if (!!gfx::GLContext::GetCurrent() && gfx::GLFence::IsSupported()) {
+ if (!!gl::GLContext::GetCurrent() && gl::GLFence::IsSupported()) {
// Create a fence on the Chromium GPU-thread and context
- gfx::GLFence *fence = gfx::GLFence::Create();
+ gl::GLFence *fence = gl::GLFence::Create();
// But transfer it to something generic since we need to read it using Qt's OpenGL.
frameNode->m_textureFences.append(fence->Transfer());
delete fence;
diff --git a/src/core/delegated_frame_node.h b/src/core/delegated_frame_node.h
index d27138013..e2a3804e3 100644
--- a/src/core/delegated_frame_node.h
+++ b/src/core/delegated_frame_node.h
@@ -102,7 +102,7 @@ private:
int m_numPendingSyncPoints;
QWaitCondition m_mailboxesFetchedWaitCond;
QMutex m_mutex;
- QList<gfx::TransferableFence> m_textureFences;
+ QList<gl::TransferableFence> m_textureFences;
std::unique_ptr<gpu::SyncPointClient> m_syncPointClient;
};
diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp
index 7eb812347..74b097ef6 100644
--- a/src/core/file_picker_controller.cpp
+++ b/src/core/file_picker_controller.cpp
@@ -111,7 +111,7 @@ void FilePickerController::filesSelectedInChooser(const QStringList &filesList,
if (this->m_mode == UploadFolder && !filesList.isEmpty()
&& QFileInfo(filesList.first()).isDir()) // Enumerate the directory
files = listRecursively(QDir(filesList.first()));
- rvh->FilesSelectedInChooser(toVector<content::FileChooserFileInfo>(files), static_cast<content::FileChooserParams::Mode>(this->m_mode));
+ rvh->GetMainFrame()->FilesSelectedInChooser(toVector<content::FileChooserFileInfo>(files), static_cast<content::FileChooserParams::Mode>(this->m_mode));
}
QStringList FilePickerController::acceptedMimeTypes() const
diff --git a/src/core/gl_context_qt.cpp b/src/core/gl_context_qt.cpp
index 0cf873631..bbcd3554d 100644
--- a/src/core/gl_context_qt.cpp
+++ b/src/core/gl_context_qt.cpp
@@ -89,19 +89,19 @@ void GLContextHelper::destroy()
contextHelper = 0;
}
-bool GLContextHelper::initializeContextOnBrowserThread(gfx::GLContext* context, gfx::GLSurface* surface)
+bool GLContextHelper::initializeContextOnBrowserThread(gl::GLContext* context, gl::GLSurface* surface)
{
- return context->Initialize(surface, gfx::PreferDiscreteGpu);
+ return context->Initialize(surface, gl::PreferDiscreteGpu);
}
-bool GLContextHelper::initializeContext(gfx::GLContext* context, gfx::GLSurface* surface)
+bool GLContextHelper::initializeContext(gl::GLContext* context, gl::GLSurface* surface)
{
bool ret = false;
Qt::ConnectionType connType = (QThread::currentThread() == qApp->thread()) ? Qt::DirectConnection : Qt::BlockingQueuedConnection;
QMetaObject::invokeMethod(contextHelper, "initializeContextOnBrowserThread", connType,
Q_RETURN_ARG(bool, ret),
- Q_ARG(gfx::GLContext*, context),
- Q_ARG(gfx::GLSurface*, surface));
+ Q_ARG(gl::GLContext*, context),
+ Q_ARG(gl::GLSurface*, surface));
return ret;
}
@@ -143,9 +143,11 @@ QT_END_NAMESPACE
#if defined(USE_OZONE) || defined(OS_WIN)
-namespace gfx {
+namespace gl {
-scoped_refptr<GLContext> GLContext::CreateGLContext(GLShareGroup* share_group, GLSurface* compatible_surface, GpuPreference gpu_preference)
+namespace init {
+
+scoped_refptr<GLContext> CreateGLContext(GLShareGroup* share_group, GLSurface* compatible_surface, GpuPreference gpu_preference)
{
#if defined(OS_WIN)
scoped_refptr<GLContext> context;
@@ -167,6 +169,8 @@ scoped_refptr<GLContext> GLContext::CreateGLContext(GLShareGroup* share_group, G
return context;
}
-} // namespace gfx
+} // namespace init
+
+} // namespace gl
#endif // defined(USE_OZONE) || defined(OS_WIN)
diff --git a/src/core/gl_context_qt.h b/src/core/gl_context_qt.h
index 2c04641d4..47cd7dc7f 100644
--- a/src/core/gl_context_qt.h
+++ b/src/core/gl_context_qt.h
@@ -42,7 +42,7 @@
#include <QObject>
-namespace gfx {
+namespace gl {
class GLContext;
class GLSurface;
}
@@ -54,7 +54,7 @@ class GLContextHelper : public QObject {
public:
static void initialize();
static void destroy();
- static bool initializeContext(gfx::GLContext* context, gfx::GLSurface* surface);
+ static bool initializeContext(gl::GLContext* context, gl::GLSurface* surface);
static void* getEGLConfig();
static void* getXConfig();
@@ -63,7 +63,7 @@ public:
static void* getNativeDisplay();
private:
- Q_INVOKABLE bool initializeContextOnBrowserThread(gfx::GLContext* context, gfx::GLSurface* surface);
+ Q_INVOKABLE bool initializeContextOnBrowserThread(gl::GLContext* context, gl::GLSurface* surface);
static GLContextHelper* contextHelper;
};
diff --git a/src/core/gl_surface_qt.cpp b/src/core/gl_surface_qt.cpp
index 027d3dd45..e88a26715 100644
--- a/src/core/gl_surface_qt.cpp
+++ b/src/core/gl_surface_qt.cpp
@@ -55,6 +55,8 @@
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_surface_egl.h"
+#include "ui/gl/init/gl_initializer.h"
+#include "ui/gl/init/gl_factory.h"
#if defined(USE_X11)
#include "ui/gl/gl_surface_glx.h"
@@ -67,6 +69,7 @@ extern "C" {
#if defined(OS_WIN)
#include "ui/gl/gl_surface_wgl.h"
#include "ui/gl/gl_context_wgl.h"
+#include "ui/gl/vsync_provider_win.h"
#endif
// From ANGLE's egl/eglext.h.
@@ -77,7 +80,7 @@ extern "C" {
using ui::GetLastEGLErrorString;
-namespace gfx {
+namespace gl {
namespace {
@@ -309,7 +312,7 @@ bool GLSurfaceQtWGL::Initialize()
{
m_surfaceBuffer = new PbufferGLSurfaceWGL(m_size);
- return m_surfaceBuffer->Initialize(gfx::GLSurface::SURFACE_DEFAULT);
+ return m_surfaceBuffer->Initialize(gl::GLSurface::SURFACE_DEFAULT);
}
void GLSurfaceQtWGL::Destroy()
@@ -364,8 +367,8 @@ bool GLSurfaceQtEGL::InitializeOneOff()
g_egl_surfaceless_context_supported = ExtensionsContain(g_extensions, "EGL_KHR_surfaceless_context");
if (g_egl_surfaceless_context_supported) {
- scoped_refptr<GLSurface> surface = new GLSurfacelessQtEGL(Size(1, 1));
- scoped_refptr<GLContext> context = GLContext::CreateGLContext(
+ scoped_refptr<GLSurface> surface = new GLSurfacelessQtEGL(gfx::Size(1, 1));
+ scoped_refptr<GLContext> context = init::CreateGLContext(
NULL, surface.get(), PreferIntegratedGpu);
if (!context->MakeCurrent(surface.get()))
@@ -383,25 +386,6 @@ bool GLSurfaceQtEGL::InitializeOneOff()
return true;
}
-bool GLSurface::InitializeOneOffInternal()
-{
- if (GetGLImplementation() == kGLImplementationOSMesaGL)
- return false;
-
- if (GetGLImplementation() == kGLImplementationEGLGLES2)
- return GLSurfaceQtEGL::InitializeOneOff();
-
- if (GetGLImplementation() == kGLImplementationDesktopGL) {
-#if defined(USE_X11)
- return GLSurfaceQtGLX::InitializeOneOff();
-#elif defined(OS_WIN)
- return GLSurfaceQtWGL::InitializeOneOff();
-#endif
- }
-
- return false;
-}
-
EGLDisplay GLSurfaceEGL::GetHardwareDisplay()
{
return static_cast<EGLDisplay>(g_display);
@@ -574,11 +558,36 @@ void* GLSurfacelessQtEGL::GetShareHandle()
return NULL;
}
-// static
+namespace init {
+
+bool InitializeGLOneOffPlatform()
+{
+#if defined(OS_WIN)
+ VSyncProviderWin::InitializeOneOff();
+#endif
+
+ if (GetGLImplementation() == kGLImplementationOSMesaGL)
+ return false;
+
+ if (GetGLImplementation() == kGLImplementationEGLGLES2)
+ return GLSurfaceQtEGL::InitializeOneOff();
+
+ if (GetGLImplementation() == kGLImplementationDesktopGL) {
+#if defined(USE_X11)
+ return GLSurfaceQtGLX::InitializeOneOff();
+#elif defined(OS_WIN)
+ return GLSurfaceQtWGL::InitializeOneOff();
+#endif
+ }
+
+ return false;
+}
+
scoped_refptr<GLSurface>
-GLSurface::CreateOffscreenGLSurface(const gfx::Size& size)
+CreateOffscreenGLSurface(const gfx::Size& size)
{
switch (GetGLImplementation()) {
+ case kGLImplementationDesktopGLCoreProfile:
case kGLImplementationDesktopGL: {
#if defined(USE_X11)
scoped_refptr<GLSurface> surface = new GLSurfaceQtGLX(size);
@@ -613,14 +622,15 @@ GLSurface::CreateOffscreenGLSurface(const gfx::Size& size)
}
}
-// static
scoped_refptr<GLSurface>
-GLSurface::CreateViewGLSurface(gfx::AcceleratedWidget window)
+CreateViewGLSurface(gfx::AcceleratedWidget window)
{
QT_NOT_USED
return NULL;
}
+} // namespace init
+
std::string DriverEGL::GetPlatformExtensions()
{
EGLDisplay display = GLContextHelper::getEGLDisplay();
@@ -632,16 +642,16 @@ std::string DriverEGL::GetPlatformExtensions()
return str ? std::string(str) : "";
}
-} // namespace gfx
+} // namespace gl
namespace gpu {
class GpuCommandBufferStub;
class GpuChannelManager;
-scoped_refptr<gfx::GLSurface> ImageTransportSurface::CreateNativeSurface(GpuChannelManager*, GpuCommandBufferStub*,
- SurfaceHandle, gfx::GLSurface::Format)
+scoped_refptr<gl::GLSurface> ImageTransportSurface::CreateNativeSurface(GpuChannelManager*, GpuCommandBufferStub*,
+ SurfaceHandle, gl::GLSurface::Format)
{
QT_NOT_USED
- return scoped_refptr<gfx::GLSurface>();
+ return scoped_refptr<gl::GLSurface>();
}
}
diff --git a/src/core/gl_surface_qt.h b/src/core/gl_surface_qt.h
index 33ea2a1da..9e0692c60 100644
--- a/src/core/gl_surface_qt.h
+++ b/src/core/gl_surface_qt.h
@@ -47,7 +47,7 @@
#include <QtCore/qcompilerdetection.h> // Needed for Q_DECL_OVERRIDE
-namespace gfx {
+namespace gl {
class GLSurfaceQt: public GLSurface {
public:
diff --git a/src/core/network_delegate_qt.cpp b/src/core/network_delegate_qt.cpp
index c779a4abe..ed54f2ec8 100644
--- a/src/core/network_delegate_qt.cpp
+++ b/src/core/network_delegate_qt.cpp
@@ -230,16 +230,18 @@ bool NetworkDelegateQt::OnCanSetCookie(const net::URLRequest& request,
return m_requestContextGetter->m_cookieDelegate->canSetCookie(toQt(request.first_party_for_cookies()), QByteArray::fromStdString(cookie_line), toQt(request.url()));
}
-int NetworkDelegateQt::OnBeforeSendHeaders(net::URLRequest*, const net::CompletionCallback&, net::HttpRequestHeaders*)
+
+int NetworkDelegateQt::OnBeforeStartTransaction(net::URLRequest *request, const net::CompletionCallback &callback, net::HttpRequestHeaders *headers)
{
return net::OK;
}
-void NetworkDelegateQt::OnBeforeSendProxyHeaders(net::URLRequest*, const net::ProxyInfo&, net::HttpRequestHeaders*)
+void NetworkDelegateQt::OnBeforeSendHeaders(net::URLRequest* request, const net::ProxyInfo& proxy_info,
+ const net::ProxyRetryInfoMap& proxy_retry_info, net::HttpRequestHeaders* headers)
{
}
-void NetworkDelegateQt::OnSendHeaders(net::URLRequest*, const net::HttpRequestHeaders&)
+void NetworkDelegateQt::OnStartTransaction(net::URLRequest *request, const net::HttpRequestHeaders &headers)
{
}
diff --git a/src/core/network_delegate_qt.h b/src/core/network_delegate_qt.h
index 9c2351960..4ded56a9d 100644
--- a/src/core/network_delegate_qt.h
+++ b/src/core/network_delegate_qt.h
@@ -76,9 +76,10 @@ public:
virtual int OnBeforeURLRequest(net::URLRequest* request, const net::CompletionCallback& callback, GURL* newUrl) override;
virtual void OnURLRequestDestroyed(net::URLRequest* request) override;
virtual bool OnCanSetCookie(const net::URLRequest&, const std::string&, net::CookieOptions*) override;
- virtual int OnBeforeSendHeaders(net::URLRequest*, const net::CompletionCallback&, net::HttpRequestHeaders*) override;
- virtual void OnBeforeSendProxyHeaders(net::URLRequest*, const net::ProxyInfo&, net::HttpRequestHeaders*) override;
- virtual void OnSendHeaders(net::URLRequest*, const net::HttpRequestHeaders&) override;
+ virtual int OnBeforeStartTransaction(net::URLRequest *request, const net::CompletionCallback &callback, net::HttpRequestHeaders *headers) override;
+ virtual void OnBeforeSendHeaders(net::URLRequest* request, const net::ProxyInfo& proxy_info,
+ const net::ProxyRetryInfoMap& proxy_retry_info, net::HttpRequestHeaders* headers) override;
+ virtual void OnStartTransaction(net::URLRequest *request, const net::HttpRequestHeaders &headers) override;
virtual int OnHeadersReceived(net::URLRequest*, const net::CompletionCallback&, const net::HttpResponseHeaders*, scoped_refptr<net::HttpResponseHeaders>*, GURL*) override;
virtual void OnBeforeRedirect(net::URLRequest*, const GURL&) override;
virtual void OnResponseStarted(net::URLRequest*) override;
diff --git a/src/core/print_view_manager_base_qt.cpp b/src/core/print_view_manager_base_qt.cpp
index 15150ddd1..8c52e1b18 100644
--- a/src/core/print_view_manager_base_qt.cpp
+++ b/src/core/print_view_manager_base_qt.cpp
@@ -267,7 +267,7 @@ void PrintViewManagerBaseQt::OnDidPrintPage(
}
}
- std::unique_ptr<printing::PdfMetafileSkia> metafile(new printing::PdfMetafileSkia);
+ std::unique_ptr<printing::PdfMetafileSkia> metafile(new printing::PdfMetafileSkia(printing::PDF_SKIA_DOCUMENT_TYPE));
if (metafile_must_be_valid) {
if (!metafile->InitFromData(shared_buf->memory(), params.data_size)) {
NOTREACHED() << "Invalid metafile header";
diff --git a/src/core/print_view_manager_qt.cpp b/src/core/print_view_manager_qt.cpp
index 117c2e40f..8f52cc24a 100644
--- a/src/core/print_view_manager_qt.cpp
+++ b/src/core/print_view_manager_qt.cpp
@@ -47,6 +47,7 @@
#include <QtGui/qpagesize.h>
#include "base/values.h"
+#include "base/memory/ref_counted_memory.h"
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/printing/printer_query.h"
#include "components/printing/common/print_messages.h"
@@ -94,7 +95,7 @@ static void SavePdfFile(scoped_refptr<base::RefCountedBytes> data,
DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
DCHECK_GT(data->size(), 0U);
- printing::PdfMetafileSkia metafile;
+ printing::PdfMetafileSkia metafile(printing::PDF_SKIA_DOCUMENT_TYPE);
metafile.InitFromData(static_cast<const void*>(data->front()), data->size());
base::File file(path,
@@ -146,7 +147,7 @@ static void applyQPageLayoutSettingsToDictionary(const QPageLayout &pageLayout,
// Apply page margins
QMargins pageMarginsInPoints = pageLayout.marginsPoints();
- scoped_ptr<base::DictionaryValue> marginsDict(new base::DictionaryValue);
+ std::unique_ptr<base::DictionaryValue> marginsDict(new base::DictionaryValue);
marginsDict->SetInteger(printing::kSettingMarginTop, pageMarginsInPoints.top());
marginsDict->SetInteger(printing::kSettingMarginBottom, pageMarginsInPoints.bottom());
marginsDict->SetInteger(printing::kSettingMarginLeft, pageMarginsInPoints.left());
diff --git a/src/core/qtwebengine_extras.gypi b/src/core/qtwebengine_extras.gypi
index 229421efa..8e4c655a9 100644
--- a/src/core/qtwebengine_extras.gypi
+++ b/src/core/qtwebengine_extras.gypi
@@ -32,21 +32,28 @@
['exclude', 'browser/renderer_host/render_widget_host_view_mac\\.(mm|h)$'],
['exclude', 'browser/renderer_host/render_widget_host_view_win\\.(cc|h)$'],
['exclude', 'common/font_list_pango\\.cc$'],
- ['exclude', 'browser/accessibility/browser_accessibility_cocoa\\.(cc|h)$'],
+ ['exclude', 'browser/accessibility/browser_accessibility_cocoa\\.(mm|h)$'],
['exclude', 'browser/accessibility/browser_accessibility_gtk\\.(cc|h)$'],
- ['exclude', 'browser/accessibility/browser_accessibility_mac\\.(cc|h)$'],
+ ['exclude', 'browser/accessibility/browser_accessibility_mac\\.(mm|h)$'],
['exclude', 'browser/accessibility/browser_accessibility_win\\.(cc|h)$'],
+ ['exclude', 'browser/accessibility/browser_accessibility_event_win\\.(cc|h)$'],
['exclude', 'browser/accessibility/browser_accessibility_manager_gtk\\.(cc|h)$'],
- ['exclude', 'browser/accessibility/browser_accessibility_manager_mac\\.(cc|h)$'],
+ ['exclude', 'browser/accessibility/browser_accessibility_manager_mac\\.(mm|h)$'],
['exclude', 'browser/accessibility/browser_accessibility_manager_win\\.(cc|h)$'],
['exclude', 'command_buffer/service/async_pixel_transfer_manager_egl\\.(cc|h)$'],
['exclude', 'common/gpu/image_transport_surface_linux\\.cc$'],
['exclude', 'common/gpu/image_transport_surface_win\\.cc$'],
['exclude', 'gl_surface_egl\\.cc$'],
+ ['exclude', 'gl_surface_egl_ozone\\.cc$'],
+ ['exclude', 'gl_surface_egl_win\\.cc$'],
+ ['exclude', 'gl_surface_egl_x11\\.cc$'],
['exclude', 'gl_surface_glx\\.cc$'],
- ['exclude', 'gl_surface_x11\\.cc$'],
- ['exclude', 'gl_surface_win\\.cc$'],
['exclude', 'gl_surface_ozone\\.cc$'],
+ ['exclude', 'gl_factory_ozone\\.cc$'],
+ ['exclude', 'gl_factory_win\\.cc$'],
+ ['exclude', 'gl_initializer_ozone\\.cc$'],
+ ['exclude', 'gl_initializer_win\\.cc$'],
+ ['exclude', 'gl_initializer_x11\\.cc$'],
# Avoid the ATL dependency to allow building with VS Express
['exclude', 'browser/accessibility/accessibility_tree_formatter\\.(cc|h)$',],
['exclude', 'browser/accessibility/accessibility_tree_formatter_mac\\.(mm|h)$',],
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index a018788c1..77fd55aab 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -655,19 +655,19 @@ void RenderWidgetHostViewQt::UnlockCompositingSurface()
{
}
-void RenderWidgetHostViewQt::OnSwapCompositorFrame(uint32_t output_surface_id, std::unique_ptr<cc::CompositorFrame> frame)
+void RenderWidgetHostViewQt::OnSwapCompositorFrame(uint32_t output_surface_id, cc::CompositorFrame frame)
{
- bool scrollOffsetChanged = (m_lastScrollOffset != frame->metadata.root_scroll_offset);
- bool contentsSizeChanged = (m_lastContentsSize != frame->metadata.root_layer_size);
- m_lastScrollOffset = frame->metadata.root_scroll_offset;
- m_lastContentsSize = frame->metadata.root_layer_size;
+ bool scrollOffsetChanged = (m_lastScrollOffset != frame.metadata.root_scroll_offset);
+ bool contentsSizeChanged = (m_lastContentsSize != frame.metadata.root_layer_size);
+ m_lastScrollOffset = frame.metadata.root_scroll_offset;
+ m_lastContentsSize = frame.metadata.root_layer_size;
Q_ASSERT(!m_needsDelegatedFrameAck);
m_needsDelegatedFrameAck = true;
m_pendingOutputSurfaceId = output_surface_id;
- Q_ASSERT(frame->delegated_frame_data);
+ Q_ASSERT(frame.delegated_frame_data);
Q_ASSERT(!m_chromiumCompositorData->frameData || m_chromiumCompositorData->frameData->resource_list.empty());
- m_chromiumCompositorData->frameData = std::move(frame->delegated_frame_data);
- m_chromiumCompositorData->frameDevicePixelRatio = frame->metadata.device_scale_factor;
+ m_chromiumCompositorData->frameData = std::move(frame.delegated_frame_data);
+ m_chromiumCompositorData->frameDevicePixelRatio = frame.metadata.device_scale_factor;
// Support experimental.viewport.devicePixelRatio, see GetScreenInfo implementation below.
float dpiScale = this->dpiScale();
@@ -711,11 +711,6 @@ void RenderWidgetHostViewQt::ClearCompositorFrame()
{
}
-bool RenderWidgetHostViewQt::GetScreenColorProfile(std::vector<char>*)
-{
- return false;
-}
-
void RenderWidgetHostViewQt::SelectionChanged(const base::string16 &text, size_t offset, const gfx::Range &range)
{
content::RenderWidgetHostViewBase::SelectionChanged(text, offset, range);
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index f834534d2..d6c77fada 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -144,12 +144,12 @@ public:
virtual bool CanCopyToVideoFrame() const Q_DECL_OVERRIDE;
virtual bool HasAcceleratedSurface(const gfx::Size&) Q_DECL_OVERRIDE;
- virtual void OnSwapCompositorFrame(uint32_t output_surface_id, std::unique_ptr<cc::CompositorFrame> frame) Q_DECL_OVERRIDE;
+ virtual void OnSwapCompositorFrame(uint32_t output_surface_id, cc::CompositorFrame frame) Q_DECL_OVERRIDE;
+
virtual void GetScreenInfo(blink::WebScreenInfo* results) Q_DECL_OVERRIDE;
virtual gfx::Rect GetBoundsInRootWindow() Q_DECL_OVERRIDE;
virtual void ProcessAckedTouchEvent(const content::TouchEventWithLatencyInfo &touch, content::InputEventAckState ack_result) Q_DECL_OVERRIDE;
virtual void ClearCompositorFrame() Q_DECL_OVERRIDE;
- virtual bool GetScreenColorProfile(std::vector<char>*) Q_DECL_OVERRIDE;
virtual void LockCompositingSurface() Q_DECL_OVERRIDE;
virtual void UnlockCompositingSurface() Q_DECL_OVERRIDE;
@@ -184,6 +184,7 @@ public:
virtual void StopSpeaking() Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED }
virtual bool SupportsSpeech() const Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED; return false; }
virtual void ShowDefinitionForSelection() Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED }
+ virtual ui::AcceleratedWidgetMac *GetAcceleratedWidgetMac() const Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED; return nullptr; }
#endif // defined(OS_MACOSX)
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index 2b9970cc3..a6e35f4be 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -374,10 +374,11 @@ static void AddPepperBasedWidevine(std::vector<std::unique_ptr<media::KeySystemP
supported_codecs |= media::EME_CODEC_MP4_AAC;
#endif // defined(USE_PROPRIETARY_CODECS)
+ using Robustness = cdm::WidevineKeySystemProperties::Robustness;
concrete_key_systems->emplace_back(new cdm::WidevineKeySystemProperties(
supported_codecs,
- media::EmeRobustness::SW_SECURE_CRYPTO, // Maximum audio robustness.
- media::EmeRobustness::SW_SECURE_DECODE, // Maximum video robustness.
+ Robustness::SW_SECURE_CRYPTO, // Maximum audio robustness.
+ Robustness::SW_SECURE_DECODE, // Maximum video robustness.
media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-license.
media::EmeSessionTypeSupport::NOT_SUPPORTED, // persistent-release-message.
media::EmeFeatureSupport::REQUESTABLE, // Persistent state.
diff --git a/src/core/renderer/render_frame_observer_qt.h b/src/core/renderer/render_frame_observer_qt.h
index b1d59d8c5..c59b7babc 100644
--- a/src/core/renderer/render_frame_observer_qt.h
+++ b/src/core/renderer/render_frame_observer_qt.h
@@ -58,6 +58,7 @@ public:
#if defined(ENABLE_PLUGINS)
void DidCreatePepperPlugin(content::RendererPpapiHost* host) override;
#endif
+ void OnDestruct() override { }
private:
DISALLOW_COPY_AND_ASSIGN(RenderFrameObserverQt);
diff --git a/src/core/renderer/render_view_observer_qt.cpp b/src/core/renderer/render_view_observer_qt.cpp
index 523d97052..393b4752c 100644
--- a/src/core/renderer/render_view_observer_qt.cpp
+++ b/src/core/renderer/render_view_observer_qt.cpp
@@ -72,8 +72,8 @@ void RenderViewObserverQt::onFetchDocumentInnerText(quint64 requestId)
{
blink::WebString text;
if (render_view()->GetWebView()->mainFrame()->isWebLocalFrame())
- text = blink::WebFrameContentDumper::deprecatedDumpFrameTreeAsText(
- static_cast<blink::WebLocalFrame*>(render_view()->GetWebView()->mainFrame()),
+ text = blink::WebFrameContentDumper::dumpWebViewAsText(
+ render_view()->GetWebView(),
std::numeric_limits<std::size_t>::max());
Send(new RenderViewObserverHostQt_DidFetchDocumentInnerText(routing_id(), requestId, text));
}
diff --git a/src/core/renderer/render_view_observer_qt.h b/src/core/renderer/render_view_observer_qt.h
index 06d97ee85..b62c815af 100644
--- a/src/core/renderer/render_view_observer_qt.h
+++ b/src/core/renderer/render_view_observer_qt.h
@@ -58,6 +58,7 @@ private:
void onSetBackgroundColor(quint32 color);
void OnFirstVisuallyNonEmptyLayout() Q_DECL_OVERRIDE;
+ void OnDestruct() Q_DECL_OVERRIDE { }
virtual bool OnMessageReceived(const IPC::Message& message) Q_DECL_OVERRIDE;
virtual void Navigate(const GURL& url) Q_DECL_OVERRIDE;
diff --git a/src/core/renderer/web_channel_ipc_transport.h b/src/core/renderer/web_channel_ipc_transport.h
index ae3f16cac..e949d1c99 100644
--- a/src/core/renderer/web_channel_ipc_transport.h
+++ b/src/core/renderer/web_channel_ipc_transport.h
@@ -68,6 +68,7 @@ private:
void installWebChannel(uint worldId);
void uninstallWebChannel(uint worldId);
virtual bool OnMessageReceived(const IPC::Message &message) Q_DECL_OVERRIDE;
+ virtual void OnDestruct() Q_DECL_OVERRIDE { }
bool m_installed;
uint m_installedWorldId;
diff --git a/src/core/resource_dispatcher_host_delegate_qt.cpp b/src/core/resource_dispatcher_host_delegate_qt.cpp
index af8b02e1b..16a4e7265 100644
--- a/src/core/resource_dispatcher_host_delegate_qt.cpp
+++ b/src/core/resource_dispatcher_host_delegate_qt.cpp
@@ -151,7 +151,8 @@ static void LaunchURL(const GURL& url, int render_process_id,
bool ResourceDispatcherHostDelegateQt::HandleExternalProtocol(const GURL& url, int child_id,
const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter,
- bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture)
+ bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture,
+ content::ResourceContext* /*resource_context*/)
{
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
// We don't want to launch external applications unless it is based on a user action
diff --git a/src/core/resource_dispatcher_host_delegate_qt.h b/src/core/resource_dispatcher_host_delegate_qt.h
index 6481c6438..a8a65cfb7 100644
--- a/src/core/resource_dispatcher_host_delegate_qt.h
+++ b/src/core/resource_dispatcher_host_delegate_qt.h
@@ -89,10 +89,10 @@ private:
class ResourceDispatcherHostDelegateQt : public content::ResourceDispatcherHostDelegate {
public:
- virtual bool HandleExternalProtocol(const GURL& url,int child_id,
- const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter,
- bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture)
- Q_DECL_OVERRIDE;
+ bool HandleExternalProtocol(const GURL& url, int child_id,
+ const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter,
+ bool is_main_frame, ui::PageTransition page_transition, bool has_user_gesture,
+ content::ResourceContext* resource_context) override;
virtual content::ResourceDispatcherHostLoginDelegate* CreateLoginDelegate(net::AuthChallengeInfo *authInfo, net::URLRequest *request) Q_DECL_OVERRIDE;
};
diff --git a/src/core/surface_factory_qt.cpp b/src/core/surface_factory_qt.cpp
index 48c91bfcf..97a304730 100644
--- a/src/core/surface_factory_qt.cpp
+++ b/src/core/surface_factory_qt.cpp
@@ -85,7 +85,7 @@ bool SurfaceFactoryQt::LoadEGLGLES2Bindings(AddGLLibraryCallback add_gl_library,
if (!gles2Library)
return false;
- gfx::GLGetProcAddressProc get_proc_address = reinterpret_cast<gfx::GLGetProcAddressProc>(base::GetFunctionPointerFromNativeLibrary(eglLibrary, "eglGetProcAddress"));
+ gl::GLGetProcAddressProc get_proc_address = reinterpret_cast<gl::GLGetProcAddressProc>(base::GetFunctionPointerFromNativeLibrary(eglLibrary, "eglGetProcAddress"));
if (!get_proc_address) {
LOG(ERROR) << "eglGetProcAddress not found.";
base::UnloadNativeLibrary(eglLibrary);
@@ -93,9 +93,9 @@ bool SurfaceFactoryQt::LoadEGLGLES2Bindings(AddGLLibraryCallback add_gl_library,
return false;
}
- gfx::SetGLGetProcAddressProc(get_proc_address);
- gfx::AddGLNativeLibrary(eglLibrary);
- gfx::AddGLNativeLibrary(gles2Library);
+ gl::SetGLGetProcAddressProc(get_proc_address);
+ gl::AddGLNativeLibrary(eglLibrary);
+ gl::AddGLNativeLibrary(gles2Library);
return true;
}
diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp
index 4ca2c4b60..591fed9b5 100644
--- a/src/core/url_request_context_getter_qt.cpp
+++ b/src/core/url_request_context_getter_qt.cpp
@@ -410,7 +410,7 @@ static bool doNetworkSessionParamsMatch(const net::HttpNetworkSession::Params &f
return false;
if (first.http_auth_handler_factory != second.http_auth_handler_factory)
return false;
- if (first.http_server_properties.get() != second.http_server_properties.get())
+ if (first.http_server_properties != second.http_server_properties)
return false;
if (first.ignore_certificate_errors != second.ignore_certificate_errors)
return false;
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index ec6dc90cd..6cbfe2867 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -890,7 +890,7 @@ void WebContentsAdapter::download(const QUrl &url, const QString &suggestedFileN
dlm->SetDelegate(dlmd);
std::unique_ptr<content::DownloadUrlParameters> params(
- content::DownloadUrlParameters::FromWebContents(webContents(), toGurl(url)));
+ content::DownloadUrlParameters::CreateForWebContentsMainFrame(webContents(), toGurl(url)));
params->set_suggested_name(toString16(suggestedFileName));
dlm->DownloadUrl(std::move(params));
}
@@ -916,7 +916,7 @@ bool WebContentsAdapter::recentlyAudible()
void WebContentsAdapter::copyImageAt(const QPoint &location)
{
Q_D(WebContentsAdapter);
- d->webContents->GetRenderViewHost()->CopyImageAt(location.x(), location.y());
+ d->webContents->GetRenderViewHost()->GetMainFrame()->CopyImageAt(location.x(), location.y());
}
ASSERT_ENUMS_MATCH(WebContentsAdapter::MediaPlayerNoAction, blink::WebMediaPlayerAction::Unknown)
@@ -1254,7 +1254,7 @@ void WebContentsAdapter::endDragging(const QPoint &clientPos, const QPoint &scre
Q_D(WebContentsAdapter);
finishDragUpdate();
content::RenderViewHost *rvh = d->webContents->GetRenderViewHost();
- rvh->DragTargetDrop(toGfx(clientPos), toGfx(screenPos), 0);
+ rvh->DragTargetDrop(*d->currentDropData, toGfx(clientPos), toGfx(screenPos), 0);
}
void WebContentsAdapter::leaveDrag()
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 6e7d1cddc..144cb0f19 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -310,7 +310,7 @@ ASSERT_ENUMS_MATCH(FilePickerController::OpenMultiple, content::FileChooserParam
ASSERT_ENUMS_MATCH(FilePickerController::UploadFolder, content::FileChooserParams::UploadFolder)
ASSERT_ENUMS_MATCH(FilePickerController::Save, content::FileChooserParams::Save)
-void WebContentsDelegateQt::RunFileChooser(content::WebContents *web_contents, const content::FileChooserParams &params)
+void WebContentsDelegateQt::RunFileChooser(content::RenderFrameHost *frameHost, const content::FileChooserParams &params)
{
QStringList acceptedMimeTypes;
acceptedMimeTypes.reserve(params.accept_types.size());
@@ -318,7 +318,7 @@ void WebContentsDelegateQt::RunFileChooser(content::WebContents *web_contents, c
acceptedMimeTypes.append(toQt(*it));
m_filePickerController.reset(new FilePickerController(static_cast<FilePickerController::FileChooserMode>(params.mode),
- web_contents, toQt(params.default_file_name.value()), acceptedMimeTypes));
+ web_contents(), toQt(params.default_file_name.value()), acceptedMimeTypes));
m_viewClient->runFileChooser(m_filePickerController);
}
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index d2459e79b..dad1e50f1 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -108,7 +108,7 @@ public:
virtual void EnterFullscreenModeForTab(content::WebContents* web_contents, const GURL& origin) Q_DECL_OVERRIDE;
virtual void ExitFullscreenModeForTab(content::WebContents*) Q_DECL_OVERRIDE;
virtual bool IsFullscreenForTabOrPending(const content::WebContents* web_contents) const Q_DECL_OVERRIDE;
- virtual void RunFileChooser(content::WebContents *, const content::FileChooserParams &params) Q_DECL_OVERRIDE;
+ virtual void RunFileChooser(content::RenderFrameHost* render_frame_host, const content::FileChooserParams& params) Q_DECL_OVERRIDE;
virtual bool AddMessageToConsole(content::WebContents* source, int32_t level, const base::string16& message, int32_t line_no, const base::string16& source_id) Q_DECL_OVERRIDE;
virtual void FindReply(content::WebContents *source, int request_id, int number_of_matches, const gfx::Rect& selection_rect, int active_match_ordinal, bool final_update) Q_DECL_OVERRIDE;
virtual void RequestMediaAccessPermission(content::WebContents* web_contents, const content::MediaStreamRequest& request, const content::MediaResponseCallback& callback) Q_DECL_OVERRIDE;
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 0687b23c5..368ad48e2 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -322,7 +322,7 @@ WebEngineContext::WebEngineContext()
if (qt_gl_global_share_context()) {
if (!strcmp(qt_gl_global_share_context()->nativeHandle().typeName(), "QEGLNativeContext")) {
if (qt_gl_global_share_context()->isOpenGLES()) {
- glType = gfx::kGLImplementationEGLName;
+ glType = gl::kGLImplementationEGLName;
} else {
QOpenGLContext context;
QSurfaceFormat format;
@@ -340,7 +340,7 @@ WebEngineContext::WebEngineContext()
if (context.makeCurrent(&surface)) {
if (context.hasExtension("GL_ARB_ES2_compatibility"))
- glType = gfx::kGLImplementationEGLName;
+ glType = gl::kGLImplementationEGLName;
context.doneCurrent();
}
@@ -350,17 +350,17 @@ WebEngineContext::WebEngineContext()
}
} else {
if (!qt_gl_global_share_context()->isOpenGLES())
- glType = gfx::kGLImplementationDesktopName;
+ glType = gl::kGLImplementationDesktopName;
}
} else {
qWarning("WebEngineContext used before QtWebEngine::initialize()");
// We have to assume the default OpenGL module type will be used.
switch (QOpenGLContext::openGLModuleType()) {
case QOpenGLContext::LibGL:
- glType = gfx::kGLImplementationDesktopName;
+ glType = gl::kGLImplementationDesktopName;
break;
case QOpenGLContext::LibGLES:
- glType = gfx::kGLImplementationEGLName;
+ glType = gl::kGLImplementationEGLName;
break;
}
}
@@ -395,6 +395,8 @@ WebEngineContext::WebEngineContext()
// first gets referenced on the IO thread.
MediaCaptureDevicesDispatcher::GetInstance();
+ base::ThreadRestrictions::SetIOAllowed(true);
+
#if defined(ENABLE_PLUGINS)
// Creating pepper plugins from the page (which calls PluginService::GetPluginInfoArray)
// might fail unless the page queried the list of available plugins at least once