From b1d423a3fc2cb3eeacc2a3e91ac9bdd2211c2613 Mon Sep 17 00:00:00 2001
From: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Date: Mon, 28 Jul 2014 17:29:14 +0200
Subject: [PATCH] Update the QtWebEngineCore library to run on top of Chromium
 37

Most of the patch is about upstream classes/methods that changed.

Other important details:
- icu data files are now used by default
- cygwin is no longer required to build on Windows
- RenderFrameHost has been replacing RenderViewHost in a few places,
  following the separate process iframes support in Chromium
- The user agent is accessed through ContentClient::GetUserAgent
  instead of from the command line switches

Change-Id: I86cc93aff7ce31176a80b0b4a5d54025674a451c
Reviewed-by: Andras Becsi <andras.becsi@digia.com>
---
 src/3rdparty                                  |  2 +-
 src/core/browser_accessibility_manager_qt.cpp | 10 +-
 src/core/browser_accessibility_manager_qt.h   |  5 +-
 src/core/browser_accessibility_qt.cpp         | 45 ++++-----
 src/core/browser_context_qt.cpp               | 18 ++--
 src/core/browser_context_qt.h                 |  5 +-
 src/core/chromium_gpu_helper.cpp              |  4 +-
 src/core/chromium_gpu_helper.h                |  4 +-
 src/core/chromium_overrides.cpp               | 37 +++-----
 src/core/clipboard_qt.cpp                     |  4 +-
 src/core/content_browser_client_qt.cpp        | 24 ++---
 src/core/content_browser_client_qt.h          |  7 +-
 src/core/content_client_qt.cpp                |  7 ++
 src/core/content_client_qt.h                  |  3 +
 src/core/content_main_delegate_qt.cpp         |  9 +-
 src/core/core.pro                             | 11 +--
 src/core/delegated_frame_node.cpp             |  6 +-
 .../dev_tools_http_handler_delegate_qt.cpp    |  2 +-
 src/core/gl_surface_qt.cpp                    | 10 +-
 src/core/javascript_dialog_manager_qt.cpp     |  4 +-
 src/core/media_capture_devices_dispatcher.cpp | 87 ++++-------------
 src/core/media_capture_devices_dispatcher.h   | 30 ++----
 src/core/network_delegate_qt.cpp              | 14 +--
 src/core/network_delegate_qt.h                | 27 +-----
 src/core/ozone_platform_eglfs.h               |  3 +-
 src/core/process_main.cpp                     | 11 ++-
 src/core/qtwebengine.gypi                     |  8 +-
 src/core/qtwebengine_extras.gypi              | 28 +++---
 src/core/render_widget_host_view_qt.cpp       | 95 ++++---------------
 src/core/render_widget_host_view_qt.h         | 34 ++++---
 .../renderer/content_renderer_client_qt.cpp   |  8 +-
 .../renderer/content_renderer_client_qt.h     |  6 +-
 .../resource_dispatcher_host_delegate_qt.cpp  | 11 +--
 .../resource_dispatcher_host_delegate_qt.h    |  3 +-
 src/core/surface_factory_qt.cpp               |  1 -
 src/core/url_request_context_getter_qt.cpp    | 15 +--
 src/core/web_contents_adapter.cpp             | 48 +++++-----
 src/core/web_contents_delegate_qt.cpp         |  3 +-
 src/core/web_contents_delegate_qt.h           |  2 +-
 src/core/web_contents_view_qt.cpp             |  6 +-
 src/core/web_contents_view_qt.h               | 14 ++-
 src/core/web_engine_context.cpp               | 26 +++--
 src/core/web_engine_library_info.cpp          |  2 +
 src/core/web_engine_settings.cpp              |  1 -
 src/core/yuv_video_node.cpp                   | 26 ++---
 src/core/yuv_video_node.h                     |  8 +-
 tools/buildscripts/gyp_qtwebengine            | 16 +---
 tools/scripts/version_resolver.py             |  4 +-
 48 files changed, 286 insertions(+), 468 deletions(-)

diff --git a/src/3rdparty b/src/3rdparty
index b45f07bfb..452edf71b 160000
--- a/src/3rdparty
+++ b/src/3rdparty
@@ -1 +1 @@
-Subproject commit b45f07bfbe74c333f1017810c2409e1aa6077a1b
+Subproject commit 452edf71b336ba273538920cdcede3bc505f6526
diff --git a/src/core/browser_accessibility_manager_qt.cpp b/src/core/browser_accessibility_manager_qt.cpp
index 7d1050774..e24873cfe 100644
--- a/src/core/browser_accessibility_manager_qt.cpp
+++ b/src/core/browser_accessibility_manager_qt.cpp
@@ -55,12 +55,12 @@ BrowserAccessibility *BrowserAccessibilityFactoryQt::Create()
 
 BrowserAccessibilityManagerQt::BrowserAccessibilityManagerQt(
     QObject* parentObject,
-    const AccessibilityNodeData& src,
+    const ui::AXTreeUpdate& initialTree,
     BrowserAccessibilityDelegate* delegate,
     BrowserAccessibilityFactory* factory)
     : BrowserAccessibilityManager(delegate, factory)
     , m_parentObject(parentObject) {
-    Initialize(src);
+    Initialize(initialTree);
 }
 
 QAccessibleInterface *BrowserAccessibilityManagerQt::rootParentAccessible()
@@ -68,11 +68,7 @@ QAccessibleInterface *BrowserAccessibilityManagerQt::rootParentAccessible()
     return QAccessible::queryAccessibleInterface(m_parentObject);
 }
 
-void BrowserAccessibilityManagerQt::NotifyRootChanged()
-{
-}
-
-void BrowserAccessibilityManagerQt::NotifyAccessibilityEvent(blink::WebAXEvent event_type,
+void BrowserAccessibilityManagerQt::NotifyAccessibilityEvent(ui::AXEvent event_type,
     BrowserAccessibility* node)
 {
     BrowserAccessibilityQt *iface = static_cast<BrowserAccessibilityQt*>(node);
diff --git a/src/core/browser_accessibility_manager_qt.h b/src/core/browser_accessibility_manager_qt.h
index e3cca81ce..0621c4eac 100644
--- a/src/core/browser_accessibility_manager_qt.h
+++ b/src/core/browser_accessibility_manager_qt.h
@@ -62,13 +62,12 @@ class BrowserAccessibilityManagerQt : public BrowserAccessibilityManager
 public:
     BrowserAccessibilityManagerQt(
         QObject* parentObject,
-        const AccessibilityNodeData& src,
+        const ui::AXTreeUpdate& initialTree,
         BrowserAccessibilityDelegate* delegate,
         BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactoryQt());
 
-    void NotifyRootChanged() Q_DECL_OVERRIDE;
     void NotifyAccessibilityEvent(
-        blink::WebAXEvent event_type,
+        ui::AXEvent event_type,
         BrowserAccessibility* node) Q_DECL_OVERRIDE;
 
     QAccessibleInterface *rootParentAccessible();
diff --git a/src/core/browser_accessibility_qt.cpp b/src/core/browser_accessibility_qt.cpp
index 2c1ac5cab..a57f11322 100644
--- a/src/core/browser_accessibility_qt.cpp
+++ b/src/core/browser_accessibility_qt.cpp
@@ -41,11 +41,12 @@
 
 #include "browser_accessibility_qt.h"
 
-#include "qtwebenginecoreglobal.h"
-#include "content/common/accessibility_node_data.h"
 #include "third_party/WebKit/public/web/WebAXEnums.h"
-#include "type_conversion.h"
+#include "ui/accessibility/ax_node_data.h"
+
 #include "browser_accessibility_manager_qt.h"
+#include "qtwebenginecoreglobal.h"
+#include "type_conversion.h"
 
 using namespace blink;
 
@@ -105,7 +106,7 @@ void *BrowserAccessibilityQt::interface_cast(QAccessible::InterfaceType type)
 
 QAccessibleInterface *BrowserAccessibilityQt::parent() const
 {
-    BrowserAccessibility *p = BrowserAccessibility::parent();
+    BrowserAccessibility *p = GetParent();
     if (p)
         return static_cast<BrowserAccessibilityQt*>(p);
     return static_cast<BrowserAccessibilityManagerQt*>(manager())->rootParentAccessible();
@@ -118,29 +119,29 @@ QAccessibleInterface *BrowserAccessibilityQt::child(int index) const
 
 int BrowserAccessibilityQt::childCount() const
 {
-    return child_count();
+    return PlatformChildCount();
 }
 
 int BrowserAccessibilityQt::indexOfChild(const QAccessibleInterface *iface) const
 {
 
     const BrowserAccessibilityQt *child = static_cast<const BrowserAccessibilityQt*>(iface);
-    return child->index_in_parent();
+    return child->GetIndexInParent();
 }
 
 QString BrowserAccessibilityQt::text(QAccessible::Text t) const
 {
     switch (t) {
     case QAccessible::Name:
-        return toQt(GetStringAttribute(AccessibilityNodeData::ATTR_NAME));
+        return toQt(GetStringAttribute(ui::AX_ATTR_NAME));
     case QAccessible::Description:
-        return toQt(GetStringAttribute(AccessibilityNodeData::ATTR_DESCRIPTION));
+        return toQt(GetStringAttribute(ui::AX_ATTR_DESCRIPTION));
     case QAccessible::Help:
-        return toQt(GetStringAttribute(AccessibilityNodeData::ATTR_HELP));
+        return toQt(GetStringAttribute(ui::AX_ATTR_HELP));
     case QAccessible::Value:
-        return toQt(GetStringAttribute(AccessibilityNodeData::ATTR_VALUE));
+        return toQt(GetStringAttribute(ui::AX_ATTR_VALUE));
     case QAccessible::Accelerator:
-        return toQt(GetStringAttribute(AccessibilityNodeData::ATTR_SHORTCUT));
+        return toQt(GetStringAttribute(ui::AX_ATTR_SHORTCUT));
     default:
         break;
     }
@@ -161,7 +162,7 @@ QRect BrowserAccessibilityQt::rect() const
 
 QAccessible::Role BrowserAccessibilityQt::role() const
 {
-    switch (BrowserAccessibility::role()) {
+    switch (GetRole()) {
     case WebAXRoleUnknown:
         return QAccessible::NoRole;
 
@@ -376,7 +377,7 @@ QAccessible::Role BrowserAccessibilityQt::role() const
 QAccessible::State BrowserAccessibilityQt::state() const
 {
     QAccessible::State state = QAccessible::State();
-    int32 s = BrowserAccessibility::state();
+    int32 s = GetState();
     if (s & (1 << WebAXStateBusy))
         state.busy = true;
     if (s & (1 << WebAXStateChecked))
@@ -445,7 +446,7 @@ void BrowserAccessibilityQt::NativeReleaseReference()
 QStringList BrowserAccessibilityQt::actionNames() const
 {
     QStringList actions;
-    if (HasState(blink::WebAXStateFocusable))
+    if (HasState(ui::AX_STATE_FOCUSABLE))
         actions << QAccessibleActionInterface::setFocusAction();
     return actions;
 }
@@ -477,7 +478,7 @@ QString BrowserAccessibilityQt::attributes(int offset, int *startOffset, int *en
 int BrowserAccessibilityQt::cursorPosition() const
 {
     int pos = 0;
-    GetIntAttribute(AccessibilityNodeData::ATTR_TEXT_SEL_START, &pos);
+    GetIntAttribute(ui::AX_ATTR_TEXT_SEL_START, &pos);
     return pos;
 }
 
@@ -491,8 +492,8 @@ int BrowserAccessibilityQt::selectionCount() const
 {
     int start = 0;
     int end = 0;
-    GetIntAttribute(AccessibilityNodeData::ATTR_TEXT_SEL_START, &start);
-    GetIntAttribute(AccessibilityNodeData::ATTR_TEXT_SEL_END, &end);
+    GetIntAttribute(ui::AX_ATTR_TEXT_SEL_START, &start);
+    GetIntAttribute(ui::AX_ATTR_TEXT_SEL_END, &end);
     if (start != end)
         return 1;
     return 0;
@@ -511,8 +512,8 @@ void BrowserAccessibilityQt::selection(int selectionIndex, int *startOffset, int
     *endOffset = 0;
     if (selectionIndex != 0)
         return;
-    GetIntAttribute(AccessibilityNodeData::ATTR_TEXT_SEL_START, startOffset);
-    GetIntAttribute(AccessibilityNodeData::ATTR_TEXT_SEL_END, endOffset);
+    GetIntAttribute(ui::AX_ATTR_TEXT_SEL_START, startOffset);
+    GetIntAttribute(ui::AX_ATTR_TEXT_SEL_END, endOffset);
 }
 
 QString BrowserAccessibilityQt::text(int startOffset, int endOffset) const
@@ -553,7 +554,7 @@ QVariant BrowserAccessibilityQt::currentValue() const
 {
     QVariant result;
     float value;
-    if (GetFloatAttribute(AccessibilityNodeData::ATTR_VALUE_FOR_RANGE, &value)) {
+    if (GetFloatAttribute(ui::AX_ATTR_VALUE_FOR_RANGE, &value)) {
         result = (double) value;
     }
     return result;
@@ -569,7 +570,7 @@ QVariant BrowserAccessibilityQt::maximumValue() const
 {
     QVariant result;
     float value;
-    if (GetFloatAttribute(AccessibilityNodeData::ATTR_MAX_VALUE_FOR_RANGE, &value)) {
+    if (GetFloatAttribute(ui::AX_ATTR_MAX_VALUE_FOR_RANGE, &value)) {
         result = (double) value;
     }
     return result;
@@ -579,7 +580,7 @@ QVariant BrowserAccessibilityQt::minimumValue() const
 {
     QVariant result;
     float value;
-    if (GetFloatAttribute(AccessibilityNodeData::ATTR_MIN_VALUE_FOR_RANGE, &value)) {
+    if (GetFloatAttribute(ui::AX_ATTR_MIN_VALUE_FOR_RANGE, &value)) {
         result = (double) value;
     }
     return result;
diff --git a/src/core/browser_context_qt.cpp b/src/core/browser_context_qt.cpp
index f0b43a334..55fb27e3c 100644
--- a/src/core/browser_context_qt.cpp
+++ b/src/core/browser_context_qt.cpp
@@ -111,16 +111,6 @@ net::URLRequestContextGetter *BrowserContextQt::GetMediaRequestContextForStorage
     return GetRequestContext();
 }
 
-void BrowserContextQt::RequestMIDISysExPermission(int, int, int, const GURL &, const MIDISysExPermissionCallback &callback)
-{
-    callback.Run(false);
-}
-
-void BrowserContextQt::CancelMIDISysExPermissionRequest(int, int, int, const GURL &)
-{
-
-}
-
 content::ResourceContext *BrowserContextQt::GetResourceContext()
 {
     return resourceContext.get();
@@ -131,9 +121,8 @@ content::DownloadManagerDelegate *BrowserContextQt::GetDownloadManagerDelegate()
     return downloadManagerDelegate.get();
 }
 
-content::GeolocationPermissionContext *BrowserContextQt::GetGeolocationPermissionContext()
+content::BrowserPluginGuestManager *BrowserContextQt::GetGuestManager()
 {
-    QT_NOT_YET_IMPLEMENTED
     return 0;
 }
 
@@ -143,6 +132,11 @@ quota::SpecialStoragePolicy *BrowserContextQt::GetSpecialStoragePolicy()
     return 0;
 }
 
+content::PushMessagingService *BrowserContextQt::GetPushMessagingService()
+{
+    return 0;
+}
+
 net::URLRequestContextGetter *BrowserContextQt::CreateRequestContext(content::ProtocolHandlerMap *protocol_handlers)
 {
     url_request_getter_ = new URLRequestContextGetterQt(GetPath(), protocol_handlers);
diff --git a/src/core/browser_context_qt.h b/src/core/browser_context_qt.h
index 933440f4a..3f480a33e 100644
--- a/src/core/browser_context_qt.h
+++ b/src/core/browser_context_qt.h
@@ -63,12 +63,11 @@ public:
     virtual net::URLRequestContextGetter *GetMediaRequestContext() Q_DECL_OVERRIDE;
     virtual net::URLRequestContextGetter *GetMediaRequestContextForRenderProcess(int) Q_DECL_OVERRIDE;
     virtual net::URLRequestContextGetter *GetMediaRequestContextForStoragePartition(const base::FilePath&, bool) Q_DECL_OVERRIDE;
-    virtual void RequestMIDISysExPermission(int render_process_id, int render_view_id, int bridge_id, const GURL &requesting_frame, const MIDISysExPermissionCallback&) Q_DECL_OVERRIDE;
-    virtual void CancelMIDISysExPermissionRequest(int render_process_id, int render_view_id, int bridge_id, const GURL &requesting_frame) Q_DECL_OVERRIDE;
     virtual content::ResourceContext *GetResourceContext() Q_DECL_OVERRIDE;
     virtual content::DownloadManagerDelegate *GetDownloadManagerDelegate() Q_DECL_OVERRIDE;
-    virtual content::GeolocationPermissionContext *GetGeolocationPermissionContext() Q_DECL_OVERRIDE;
+    virtual content::BrowserPluginGuestManager* GetGuestManager() Q_DECL_OVERRIDE;
     virtual quota::SpecialStoragePolicy *GetSpecialStoragePolicy() Q_DECL_OVERRIDE;
+    virtual content::PushMessagingService* GetPushMessagingService() Q_DECL_OVERRIDE;
     net::URLRequestContextGetter *CreateRequestContext(content::ProtocolHandlerMap *protocol_handlers);
 
 private:
diff --git a/src/core/chromium_gpu_helper.cpp b/src/core/chromium_gpu_helper.cpp
index 663b1ec17..9a6bb0033 100644
--- a/src/core/chromium_gpu_helper.cpp
+++ b/src/core/chromium_gpu_helper.cpp
@@ -109,9 +109,9 @@ gpu::gles2::MailboxManager *mailbox_manager()
     return gpuChannelManager->mailbox_manager();
 }
 
-gpu::gles2::Texture* ConsumeTexture(gpu::gles2::MailboxManager *mailboxManager, unsigned target, const gpu::gles2::MailboxName& name)
+gpu::gles2::Texture* ConsumeTexture(gpu::gles2::MailboxManager *mailboxManager, unsigned target, const gpu::Mailbox& mailbox)
 {
-    return mailboxManager->ConsumeTexture(target, name);
+    return mailboxManager->ConsumeTexture(target, mailbox);
 }
 
 unsigned int service_id(gpu::gles2::Texture *tex)
diff --git a/src/core/chromium_gpu_helper.h b/src/core/chromium_gpu_helper.h
index 00ed5f295..1e436e5b7 100644
--- a/src/core/chromium_gpu_helper.h
+++ b/src/core/chromium_gpu_helper.h
@@ -55,9 +55,9 @@ class SyncPointManager;
 }
 
 namespace gpu {
+struct Mailbox;
 namespace gles2 {
 class MailboxManager;
-struct MailboxName;
 class Texture;
 }
 }
@@ -99,7 +99,7 @@ content::SyncPointManager *sync_point_manager();
 gpu::gles2::MailboxManager *mailbox_manager();
 
 void AddSyncPointCallbackOnGpuThread(base::MessageLoop *gpuMessageLoop, content::SyncPointManager *syncPointManager, uint32 sync_point, const base::Closure& callback);
-gpu::gles2::Texture* ConsumeTexture(gpu::gles2::MailboxManager *mailboxManager, unsigned target, const gpu::gles2::MailboxName& name);
+gpu::gles2::Texture* ConsumeTexture(gpu::gles2::MailboxManager *mailboxManager, unsigned target, const gpu::Mailbox& mailbox);
 unsigned int service_id(gpu::gles2::Texture *tex);
 
 #ifdef Q_OS_QNX
diff --git a/src/core/chromium_overrides.cpp b/src/core/chromium_overrides.cpp
index a1758768d..dafd50f7c 100644
--- a/src/core/chromium_overrides.cpp
+++ b/src/core/chromium_overrides.cpp
@@ -43,9 +43,10 @@
 
 #include "gl_context_qt.h"
 #include "qtwebenginecoreglobal.h"
+#include "web_contents_view_qt.h"
 #include "base/values.h"
-#include "content/browser/renderer_host/render_widget_host_view_base.h"
 #include "content/browser/renderer_host/pepper/pepper_truetype_font_list.h"
+#include "content/browser/renderer_host/render_widget_host_view_base.h"
 #include "content/common/font_list.h"
 
 #include <QGuiApplication>
@@ -58,7 +59,7 @@
 #endif
 
 #if defined(USE_X11)
-#include "base/message_loop/message_pump_x11.h"
+#include "ui/gfx/x/x11_types.h"
 #endif
 
 #if defined(USE_AURA) && !defined(USE_OZONE)
@@ -85,38 +86,30 @@ void GetScreenInfoFromNativeWindow(QWindow* window, blink::WebScreenInfo* result
     *results = r;
 }
 
-namespace base {
-
 #if defined(USE_X11)
-Display* MessagePumpForUI::GetDefaultXDisplay() {
-    static void *display = GLContextHelper::getXDisplay();
-    return static_cast<Display*>(display);
+XDisplay* GetQtXDisplay()
+{
+    return static_cast<XDisplay*>(GLContextHelper::getXDisplay());
 }
 #endif
 
-}
-
 namespace content {
 class WebContentsImpl;
-class WebContentsViewPort;
+class WebContentsView;
 class WebContentsViewDelegate;
 class RenderViewHostDelegateView;
 
-WebContentsViewPort* CreateWebContentsView(WebContentsImpl*,
-                                           WebContentsViewDelegate*,
-                                           RenderViewHostDelegateView**)
+WebContentsView* CreateWebContentsView(WebContentsImpl *web_contents,
+    WebContentsViewDelegate *,
+    RenderViewHostDelegateView **render_view_host_delegate_view)
 {
-    return 0;
-}
-
-RenderWidgetHostView* RenderWidgetHostView::CreateViewForWidget(RenderWidgetHost*) {
-    // WebContentsViewQt should take care of this directly.
-    Q_UNREACHABLE();
-    return NULL;
+    WebContentsViewQt* rv = new WebContentsViewQt(web_contents);
+    *render_view_host_delegate_view = rv;
+    return rv;
 }
 
 // static
-void RenderWidgetHostViewPort::GetDefaultScreenInfo(blink::WebScreenInfo* results) {
+void RenderWidgetHostViewBase::GetDefaultScreenInfo(blink::WebScreenInfo* results) {
     QWindow dummy;
     GetScreenInfoFromNativeWindow(&dummy, results);
 }
@@ -163,7 +156,7 @@ namespace gfx {
 // Stubs for these unused functions that are stripped in case
 // of a release aura build but a debug build needs the symbols.
 
-RenderText* RenderText::CreateInstance()
+RenderText* RenderText::CreateNativeInstance()
 {
     QT_NOT_USED;
     return 0;
diff --git a/src/core/clipboard_qt.cpp b/src/core/clipboard_qt.cpp
index 0430ff9b3..b8dac5128 100644
--- a/src/core/clipboard_qt.cpp
+++ b/src/core/clipboard_qt.cpp
@@ -261,12 +261,12 @@ SkBitmap Clipboard::ReadImage(ClipboardType type) const
 
     Q_ASSERT(image.format() == QImage::Format_ARGB32);
     SkBitmap bitmap;
-    bitmap.setConfig(SkBitmap::kARGB_8888_Config, image.width(), image.height());
+    bitmap.setInfo(SkImageInfo::MakeN32(image.width(), image.height(), kOpaque_SkAlphaType));
     bitmap.setPixels(const_cast<uchar*>(image.constBits()));
 
     // Return a deep copy of the pixel data.
     SkBitmap copy;
-    bitmap.copyTo(&copy, SkBitmap::kARGB_8888_Config);
+    bitmap.copyTo(&copy, kN32_SkColorType);
     return copy;
 }
 
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 47b51e706..1be226ab1 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -43,10 +43,14 @@
 
 #include "base/message_loop/message_loop.h"
 #include "base/threading/thread_restrictions.h"
+#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/media_observer.h"
+#include "content/public/browser/render_process_host.h"
+#include "content/public/browser/render_view_host.h"
 #include "content/public/browser/resource_dispatcher_host.h"
+#include "content/public/browser/web_contents.h"
 #include "content/public/common/main_function_params.h"
 #include "content/public/common/url_constants.h"
 #include "ui/gfx/screen.h"
@@ -59,7 +63,7 @@
 #include "dev_tools_http_handler_delegate_qt.h"
 #include "media_capture_devices_dispatcher.h"
 #include "resource_dispatcher_host_delegate_qt.h"
-#include "web_contents_view_qt.h"
+#include "web_contents_delegate_qt.h"
 
 #include <QGuiApplication>
 #include <QOpenGLContext>
@@ -159,9 +163,9 @@ private:
     Delegate *m_delegate;
 };
 
-base::MessagePump* messagePumpFactory()
+scoped_ptr<base::MessagePump> messagePumpFactory()
 {
-    return new MessagePumpForUIQt;
+    return scoped_ptr<base::MessagePump>(new MessagePumpForUIQt);
 }
 
 } // namespace
@@ -272,14 +276,6 @@ void ShareGroupQtQuick::AboutToAddFirstContext()
     m_shareContextQtQuick = make_scoped_refptr(new QtShareGLContext(shareContext));
 }
 
-content::WebContentsViewPort* ContentBrowserClientQt::OverrideCreateWebContentsView(content::WebContents* web_contents,
-                                                                                    content::RenderViewHostDelegateView** render_view_host_delegate_view)
-{
-    WebContentsViewQt* rv = new WebContentsViewQt(web_contents);
-    *render_view_host_delegate_view = rv;
-    return rv;
-}
-
 ContentBrowserClientQt::ContentBrowserClientQt()
     : m_browserMainParts(0)
 {
@@ -303,10 +299,10 @@ content::BrowserMainParts *ContentBrowserClientQt::CreateBrowserMainParts(const
     return m_browserMainParts;
 }
 
-void ContentBrowserClientQt::RenderProcessHostCreated(content::RenderProcessHost* host)
+void ContentBrowserClientQt::RenderProcessWillLaunch(content::RenderProcessHost* host)
 {
     // FIXME: Add a settings variable to enable/disable the file scheme.
-    content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(host->GetID(), chrome::kFileScheme);
+    content::ChildProcessSecurityPolicy::GetInstance()->GrantScheme(host->GetID(), url::kFileScheme);
 }
 
 void ContentBrowserClientQt::ResourceDispatcherHostCreated()
@@ -339,7 +335,7 @@ BrowserContextQt* ContentBrowserClientQt::browser_context() {
     return static_cast<BrowserMainPartsQt*>(m_browserMainParts)->browser_context();
 }
 
-net::URLRequestContextGetter* ContentBrowserClientQt::CreateRequestContext(content::BrowserContext* content_browser_context, content::ProtocolHandlerMap* protocol_handlers)
+net::URLRequestContextGetter* ContentBrowserClientQt::CreateRequestContext(content::BrowserContext* content_browser_context, content::ProtocolHandlerMap* protocol_handlers, content::URLRequestInterceptorScopedVector request_interceptors)
 {
     if (content_browser_context != browser_context())
         fprintf(stderr, "Warning: off the record browser context not implemented !\n");
diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
index f550dcdc8..0eeb7583e 100644
--- a/src/core/content_browser_client_qt.h
+++ b/src/core/content_browser_client_qt.h
@@ -78,17 +78,16 @@ public:
     ContentBrowserClientQt();
     ~ContentBrowserClientQt();
     static ContentBrowserClientQt* Get();
-    virtual content::WebContentsViewPort* OverrideCreateWebContentsView(content::WebContents* , content::RenderViewHostDelegateView**) Q_DECL_OVERRIDE;
     virtual content::BrowserMainParts* CreateBrowserMainParts(const content::MainFunctionParams&) Q_DECL_OVERRIDE;
-    virtual void RenderProcessHostCreated(content::RenderProcessHost* host) 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 content::MediaObserver* GetMediaObserver();
+    virtual content::MediaObserver* GetMediaObserver() Q_DECL_OVERRIDE;
     virtual void OverrideWebkitPrefs(content::RenderViewHost *, const GURL &, WebPreferences *) Q_DECL_OVERRIDE;
 
     BrowserContextQt* browser_context();
 
-    net::URLRequestContextGetter *CreateRequestContext(content::BrowserContext *content_browser_context, content::ProtocolHandlerMap *protocol_handlers);
+    virtual net::URLRequestContextGetter *CreateRequestContext(content::BrowserContext *content_browser_context, content::ProtocolHandlerMap *protocol_handlers, content::URLRequestInterceptorScopedVector request_interceptorss) Q_DECL_OVERRIDE;
 
     void enableInspector(bool);
 
diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp
index 972fd43f7..d2afb4488 100644
--- a/src/core/content_client_qt.cpp
+++ b/src/core/content_client_qt.cpp
@@ -42,10 +42,17 @@
 #include "content_client_qt.h"
 
 #include "base/strings/string_piece.h"
+#include "content/public/common/user_agent.h"
 #include "ui/base/layout.h"
 #include "ui/base/l10n/l10n_util.h"
 #include "ui/base/resource/resource_bundle.h"
 
+std::string ContentClientQt::getUserAgent()
+{
+    // Mention the Chromium version we're based on to get passed stupid UA-string-based feature detection (several WebRTC demos need this)
+    return content::BuildUserAgentFromProduct("QtWebEngine/" QTWEBENGINECORE_VERSION_STR " Chrome/" CHROMIUM_VERSION);
+}
+
 #include <QCoreApplication>
 #include <QStringBuilder>
 
diff --git a/src/core/content_client_qt.h b/src/core/content_client_qt.h
index ff4b543ec..0d95e78b8 100644
--- a/src/core/content_client_qt.h
+++ b/src/core/content_client_qt.h
@@ -49,7 +49,10 @@
 
 class ContentClientQt : public content::ContentClient {
 public:
+    static std::string getUserAgent();
+
     virtual base::StringPiece GetDataResource(int, ui::ScaleFactor) const Q_DECL_OVERRIDE;
+    virtual std::string GetUserAgent() const Q_DECL_OVERRIDE { return getUserAgent(); }
     virtual base::string16 GetLocalizedString(int message_id) const Q_DECL_OVERRIDE;
     virtual std::string GetProduct() const Q_DECL_OVERRIDE;
 };
diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp
index f75204ada..cfe37b92f 100644
--- a/src/core/content_main_delegate_qt.cpp
+++ b/src/core/content_main_delegate_qt.cpp
@@ -63,10 +63,6 @@ static base::StringPiece PlatformResourceProvider(int key) {
 
 void ContentMainDelegateQt::PreSandboxStartup()
 {
-    PathService::Override(base::FILE_EXE, WebEngineLibraryInfo::getPath(base::FILE_EXE));
-    PathService::Override(content::DIR_MEDIA_LIBS, WebEngineLibraryInfo::getPath(content::DIR_MEDIA_LIBS));
-    PathService::Override(ui::DIR_LOCALES, WebEngineLibraryInfo::getPath(ui::DIR_LOCALES));
-
     net::NetModule::SetResourceProvider(PlatformResourceProvider);
     ui::ResourceBundle::InitSharedInstanceWithLocale(l10n_util::GetApplicationLocale(std::string("en-US")), 0);
 }
@@ -84,6 +80,11 @@ content::ContentRendererClient *ContentMainDelegateQt::CreateContentRendererClie
 
 bool ContentMainDelegateQt::BasicStartupComplete(int *exit_code)
 {
+    PathService::Override(base::FILE_EXE, WebEngineLibraryInfo::getPath(base::FILE_EXE));
+    PathService::Override(base::DIR_QT_LIBRARY_DATA, WebEngineLibraryInfo::getPath(base::DIR_QT_LIBRARY_DATA));
+    PathService::Override(content::DIR_MEDIA_LIBS, WebEngineLibraryInfo::getPath(content::DIR_MEDIA_LIBS));
+    PathService::Override(ui::DIR_LOCALES, WebEngineLibraryInfo::getPath(ui::DIR_LOCALES));
+
     SetContentClient(new ContentClientQt);
     return false;
 }
diff --git a/src/core/core.pro b/src/core/core.pro
index 67e27f3ad..02a707f21 100644
--- a/src/core/core.pro
+++ b/src/core/core.pro
@@ -38,16 +38,15 @@ macx: PLUGIN_PREFIX =
 win32 {
     PLUGIN_EXTENSION = .dll
     PLUGIN_PREFIX =
-
-    icu.files = $$OUT_PWD/$$getConfigDir()/icudt46l.dat
-    icu.CONFIG += no_check_exist
-    icu.path = $$[QT_INSTALL_BINS]
-    INSTALLS += icu
 }
 
+icu.files = $$OUT_PWD/$$getConfigDir()/icudtl.dat
+icu.CONFIG += no_check_exist
+icu.path = $$[QT_INSTALL_DATA]
+
 plugins.files = $$OUT_PWD/$$getConfigDir()/$${PLUGIN_PREFIX}ffmpegsumo$${PLUGIN_EXTENSION}
 plugins.CONFIG += no_check_exist
 plugins.path = $$[QT_INSTALL_PLUGINS]/qtwebengine
 
-INSTALLS += locales resources plugins
+INSTALLS += icu locales resources plugins
 
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp
index 60be2e6cc..991f268a3 100644
--- a/src/core/delegated_frame_node.cpp
+++ b/src/core/delegated_frame_node.cpp
@@ -347,7 +347,7 @@ cc::ReturnedResource MailboxTexture::returnResource()
 
 void MailboxTexture::fetchTexture(gpu::gles2::MailboxManager *mailboxManager)
 {
-    gpu::gles2::Texture *tex = ConsumeTexture(mailboxManager, m_target, *reinterpret_cast<const gpu::gles2::MailboxName*>(m_resource.mailbox.name));
+    gpu::gles2::Texture *tex = ConsumeTexture(mailboxManager, m_target, m_resource.mailbox_holder.mailbox);
 
     // The texture might already have been deleted (e.g. when navigating away from a page).
     if (tex) {
@@ -396,7 +396,7 @@ void DelegatedFrameNode::preprocess()
 
         Q_FOREACH (MailboxTexture *mailboxTexture, mailboxesToFetch) {
             m_numPendingSyncPoints++;
-            AddSyncPointCallbackOnGpuThread(gpuMessageLoop, syncPointManager, mailboxTexture->resource().sync_point, base::Bind(&DelegatedFrameNode::syncPointRetired, this, &mailboxesToFetch));
+            AddSyncPointCallbackOnGpuThread(gpuMessageLoop, syncPointManager, mailboxTexture->resource().mailbox_holder.sync_point, base::Bind(&DelegatedFrameNode::syncPointRetired, this, &mailboxesToFetch));
         }
 
         m_mailboxesFetchedWaitCond.wait(&m_mutex);
@@ -573,7 +573,7 @@ void DelegatedFrameNode::commit(DelegatedFrameNodeData* data, cc::ReturnedResour
                 if (vquad->a_plane_resource_id)
                     aTexture = findMailboxTexture(vquad->a_plane_resource_id, m_data->mailboxTextures, mailboxTextureCandidates);
 
-                YUVVideoNode *videoNode = new YUVVideoNode(yTexture.data(), uTexture.data(), vTexture.data(), aTexture.data(), toQt(vquad->tex_scale));
+                YUVVideoNode *videoNode = new YUVVideoNode(yTexture.data(), uTexture.data(), vTexture.data(), aTexture.data(), toQt(vquad->tex_coord_rect));
                 videoNode->setRect(toQt(quad->rect));
                 currentLayerChain->appendChildNode(videoNode);
                 break;
diff --git a/src/core/dev_tools_http_handler_delegate_qt.cpp b/src/core/dev_tools_http_handler_delegate_qt.cpp
index 7fa525dc1..27bda9110 100644
--- a/src/core/dev_tools_http_handler_delegate_qt.cpp
+++ b/src/core/dev_tools_http_handler_delegate_qt.cpp
@@ -70,7 +70,7 @@ DevToolsHttpHandlerDelegateQt::DevToolsHttpHandlerDelegateQt(BrowserContext* bro
         if (base::StringToInt(portString, &portInt) && portInt > 0 && portInt < 65535)
             listeningPort = portInt;
     }
-    m_devtoolsHttpHandler = DevToolsHttpHandler::Start(new net::TCPListenSocketFactory("0.0.0.0", listeningPort), std::string(), this);
+    m_devtoolsHttpHandler = DevToolsHttpHandler::Start(new net::TCPListenSocketFactory("0.0.0.0", listeningPort), std::string(), this, base::FilePath());
 }
 
 DevToolsHttpHandlerDelegateQt::~DevToolsHttpHandlerDelegateQt()
diff --git a/src/core/gl_surface_qt.cpp b/src/core/gl_surface_qt.cpp
index a338fe5cd..20f235048 100644
--- a/src/core/gl_surface_qt.cpp
+++ b/src/core/gl_surface_qt.cpp
@@ -314,6 +314,10 @@ bool GLSurfaceEGL::IsCreateContextRobustnessSupported()
 GLSurfaceQt::GLSurfaceQt(const gfx::Size& size)
     : m_size(size)
 {
+    // Some implementations of Pbuffer do not support having a 0 size. For such
+    // cases use a (1, 1) surface.
+    if (m_size.GetArea() == 0)
+        m_size.SetSize(1, 1);
 }
 
 bool GLSurfaceQt::HasEGLExtension(const char* name)
@@ -337,12 +341,6 @@ bool GLSurfaceQtEGL::Initialize()
         return false;
     }
 
-    if (m_size.GetArea() == 0) {
-        LOG(ERROR) << "Error: surface has zero area"
-                   << m_size.width() << " x " << m_size.height();
-        return false;
-    }
-
     const EGLint pbuffer_attributes[] = {
         EGL_WIDTH, m_size.width(),
         EGL_HEIGHT, m_size.height(),
diff --git a/src/core/javascript_dialog_manager_qt.cpp b/src/core/javascript_dialog_manager_qt.cpp
index f886a20d9..0a127c21e 100644
--- a/src/core/javascript_dialog_manager_qt.cpp
+++ b/src/core/javascript_dialog_manager_qt.cpp
@@ -59,7 +59,7 @@ void JavaScriptDialogManagerQt::RunJavaScriptDialog(content::WebContents *webCon
 {
     Q_UNUSED(acceptLang);
 
-    WebContentsAdapterClient *client = WebContentsViewQt::from(webContents->GetView())->client();
+    WebContentsAdapterClient *client = WebContentsViewQt::from(static_cast<content::WebContentsImpl*>(webContents)->GetView())->client();
     if (!client) {
         if (didSuppressMessage)
             *didSuppressMessage = true;
@@ -84,7 +84,7 @@ void JavaScriptDialogManagerQt::runDialogForContents(content::WebContents *webCo
                                                      , const QString &messageText, const QString &defaultPrompt, const QUrl &origin
                                                      , const content::JavaScriptDialogManager::DialogClosedCallback &callback, const QString &title)
 {
-    WebContentsAdapterClient *client = WebContentsViewQt::from(webContents->GetView())->client();
+    WebContentsAdapterClient *client = WebContentsViewQt::from(static_cast<content::WebContentsImpl*>(webContents)->GetView())->client();
     if (!client)
         return;
 
diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp
index 2997576ff..d9c0db52a 100644
--- a/src/core/media_capture_devices_dispatcher.cpp
+++ b/src/core/media_capture_devices_dispatcher.cpp
@@ -53,7 +53,7 @@
 #include "chrome/browser/media/desktop_streams_registry.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/desktop_media_id.h"
-#include "content/public/browser/media_devices_monitor.h"
+#include "content/public/browser/media_capture_devices.h"
 #include "content/public/browser/notification_service.h"
 #include "content/public/browser/notification_source.h"
 #include "content/public/browser/notification_types.h"
@@ -80,7 +80,7 @@ const content::MediaStreamDevice *findDeviceWithId(const content::MediaStreamDev
 
 base::string16 getContentsUrl(content::WebContents *webContents)
 {
-  return UTF8ToUTF16(webContents->GetURL().GetOrigin().spec());
+  return base::UTF8ToUTF16(webContents->GetURL().GetOrigin().spec());
 }
 
 scoped_ptr<content::MediaStreamUI> getDevicesForDesktopCapture(content::MediaStreamDevices &devices, content::DesktopMediaID mediaId
@@ -183,7 +183,7 @@ void MediaCaptureDevicesDispatcher::handleMediaAccessPermissionResponse(content:
                     BrowserThread::UI, FROM_HERE, base::Bind(&MediaCaptureDevicesDispatcher::ProcessQueuedAccessRequest, base::Unretained(this), webContents));
     }
 
-    callback.Run(devices, scoped_ptr<content::MediaStreamUI>());
+    callback.Run(devices, devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE : content::MEDIA_DEVICE_OK, scoped_ptr<content::MediaStreamUI>());
 }
 
 
@@ -194,7 +194,6 @@ MediaCaptureDevicesDispatcher *MediaCaptureDevicesDispatcher::GetInstance()
 }
 
 MediaCaptureDevicesDispatcher::MediaCaptureDevicesDispatcher()
-    : m_devicesEnumerated(false)
 {
   // MediaCaptureDevicesDispatcher is a singleton. It should be created on
   // UI thread. Otherwise, it will not receive
@@ -209,26 +208,6 @@ MediaCaptureDevicesDispatcher::~MediaCaptureDevicesDispatcher()
 {
 }
 
-const MediaStreamDevices &MediaCaptureDevicesDispatcher::getAudioCaptureDevices()
-{
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  if (!m_devicesEnumerated) {
-    content::EnsureMonitorCaptureDevices();
-    m_devicesEnumerated = true;
-  }
-  return m_audioDevices;
-}
-
-const MediaStreamDevices &MediaCaptureDevicesDispatcher::getVideoCaptureDevices()
-{
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  if (!m_devicesEnumerated) {
-    content::EnsureMonitorCaptureDevices();
-    m_devicesEnumerated = true;
-  }
-  return m_videoDevices;
-}
-
 void MediaCaptureDevicesDispatcher::Observe(int type, const content::NotificationSource &source, const content::NotificationDetails &details)
 {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
@@ -267,7 +246,7 @@ void MediaCaptureDevicesDispatcher::processDesktopCaptureAccessRequest(content::
   scoped_ptr<content::MediaStreamUI> ui;
 
   if (request.video_type != content::MEDIA_DESKTOP_VIDEO_CAPTURE) {
-    callback.Run(devices, ui.Pass());
+    callback.Run(devices, content::MEDIA_DEVICE_INVALID_STATE, ui.Pass());
     return;
   }
 
@@ -279,15 +258,18 @@ void MediaCaptureDevicesDispatcher::processDesktopCaptureAccessRequest(content::
     return;
   }
 
+  // The extension name that the stream is registered with.
+  std::string originalExtensionName;
   // Resolve DesktopMediaID for the specified device id.
   content::DesktopMediaID mediaId =
       getDesktopStreamsRegistry()->RequestMediaForStreamId(
           request.requested_video_device_id, request.render_process_id,
-          request.render_view_id, request.security_origin);
+          request.render_view_id, request.security_origin,
+          &originalExtensionName);
 
   // Received invalid device id.
   if (mediaId.type == content::DesktopMediaID::TYPE_NONE) {
-    callback.Run(devices, ui.Pass());
+    callback.Run(devices, content::MEDIA_DEVICE_INVALID_STATE, ui.Pass());
     return;
   }
 
@@ -299,7 +281,7 @@ void MediaCaptureDevicesDispatcher::processDesktopCaptureAccessRequest(content::
       devices, mediaId, capture_audio, true,
       getContentsUrl(webContents));
 
-  callback.Run(devices, ui.Pass());
+  callback.Run(devices, devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE : content::MEDIA_DEVICE_OK, ui.Pass());
 }
 
 void MediaCaptureDevicesDispatcher::processScreenCaptureAccessRequest(content::WebContents *webContents, const content::MediaStreamRequest &request
@@ -324,7 +306,7 @@ void MediaCaptureDevicesDispatcher::processScreenCaptureAccessRequest(content::W
       JavaScriptDialogManagerQt::GetInstance()->runDialogForContents(webContents, WebContentsAdapterClient::InternalAuthorizationDialog, message
                                                                      , QString(), securityOrigin, dialogCallback, title);
   } else
-      callback.Run(content::MediaStreamDevices(), scoped_ptr<content::MediaStreamUI>());
+      callback.Run(content::MediaStreamDevices(), content::MEDIA_DEVICE_INVALID_STATE, scoped_ptr<content::MediaStreamUI>());
 }
 
 void MediaCaptureDevicesDispatcher::handleScreenCaptureAccessRequest(content::WebContents *webContents, bool userAccepted, const base::string16 &)
@@ -349,7 +331,7 @@ void MediaCaptureDevicesDispatcher::handleScreenCaptureAccessRequest(content::We
     content::MediaResponseCallback callback = queue.front().callback;
     queue.pop_front();
 
-    callback.Run(devices, ui.Pass());
+    callback.Run(devices, devices.empty() ? content::MEDIA_DEVICE_INVALID_STATE : content::MEDIA_DEVICE_OK, ui.Pass());
 }
 
 void MediaCaptureDevicesDispatcher::enqueueMediaAccessRequest(content::WebContents *webContents, const content::MediaStreamRequest &request
@@ -377,7 +359,7 @@ void MediaCaptureDevicesDispatcher::ProcessQueuedAccessRequest(content::WebConte
   content::MediaStreamRequest &request = queue.front().request;
 
   DCHECK(!it->second.empty());
-  WebContentsAdapterClient *adapterClient = WebContentsViewQt::from(webContents->GetView())->client();
+  WebContentsAdapterClient *adapterClient = WebContentsViewQt::from(static_cast<content::WebContentsImpl*>(webContents)->GetView())->client();
   adapterClient->runMediaAccessPermissionRequest(toQt(request.security_origin), mediaRequestFlagsForRequest(request));
 }
 
@@ -388,7 +370,7 @@ void MediaCaptureDevicesDispatcher::getDefaultDevices(const std::string &audioDe
   DCHECK(audio || video);
 
   if (audio) {
-    const content::MediaStreamDevices &audioDevices = getAudioCaptureDevices();
+    const content::MediaStreamDevices &audioDevices = content::MediaCaptureDevices::GetInstance()->GetAudioCaptureDevices();
     const content::MediaStreamDevice *device = findDeviceWithId(audioDevices, audioDeviceId);
     if (!device && !audioDevices.empty())
         device = &(*audioDevices.begin());
@@ -397,7 +379,7 @@ void MediaCaptureDevicesDispatcher::getDefaultDevices(const std::string &audioDe
   }
 
   if (video) {
-    const content::MediaStreamDevices &videoDevices = getVideoCaptureDevices();
+    const content::MediaStreamDevices &videoDevices = content::MediaCaptureDevices::GetInstance()->GetVideoCaptureDevices();
     const content::MediaStreamDevice *device = findDeviceWithId(videoDevices, videoDeviceId);
     if (!device && !videoDevices.empty())
       device = &(*videoDevices.begin());
@@ -413,25 +395,7 @@ DesktopStreamsRegistry *MediaCaptureDevicesDispatcher::getDesktopStreamsRegistry
   return m_desktopStreamsRegistry.get();
 }
 
-void MediaCaptureDevicesDispatcher::OnAudioCaptureDevicesChanged(const content::MediaStreamDevices &devices)
-{
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-  BrowserThread::PostTask(
-      BrowserThread::UI, FROM_HERE,
-      base::Bind(&MediaCaptureDevicesDispatcher::updateAudioDevicesOnUIThread,
-                 base::Unretained(this), devices));
-}
-
-void MediaCaptureDevicesDispatcher::OnVideoCaptureDevicesChanged(const content::MediaStreamDevices &devices)
-{
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-  BrowserThread::PostTask(
-      BrowserThread::UI, FROM_HERE,
-      base::Bind(&MediaCaptureDevicesDispatcher::updateVideoDevicesOnUIThread,
-                 base::Unretained(this), devices));
-}
-
-void MediaCaptureDevicesDispatcher::OnMediaRequestStateChanged(int renderProcessId, int renderViewId, int pageRequestId
+void MediaCaptureDevicesDispatcher::OnMediaRequestStateChanged(int renderProcessId, int renderViewId, int pageRequestId, const GURL& securityOrigin
                                                                , const content::MediaStreamDevice &device, content::MediaRequestState state)
 {
   DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
@@ -443,25 +407,6 @@ void MediaCaptureDevicesDispatcher::OnMediaRequestStateChanged(int renderProcess
           pageRequestId, device, state));
 }
 
-void MediaCaptureDevicesDispatcher::OnCreatingAudioStream(int /*renderProcessId*/, int /*renderViewId*/)
-{
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
-}
-
-void MediaCaptureDevicesDispatcher::updateAudioDevicesOnUIThread(const content::MediaStreamDevices &devices)
-{
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  m_devicesEnumerated = true;
-  m_audioDevices = devices;
-}
-
-void MediaCaptureDevicesDispatcher::updateVideoDevicesOnUIThread(const content::MediaStreamDevices &devices)
-{
-  DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-  m_devicesEnumerated = true;
-  m_videoDevices = devices;
-}
-
 void MediaCaptureDevicesDispatcher::updateMediaRequestStateOnUIThread(int renderProcessId, int renderViewId, int pageRequestId
                                                                       , const content::MediaStreamDevice &device, content::MediaRequestState state)
 {
diff --git a/src/core/media_capture_devices_dispatcher.h b/src/core/media_capture_devices_dispatcher.h
index 38d7b1c19..0e02f574a 100644
--- a/src/core/media_capture_devices_dispatcher.h
+++ b/src/core/media_capture_devices_dispatcher.h
@@ -60,9 +60,7 @@
 #include "content/public/browser/web_contents_delegate.h"
 #include "content/public/common/media_stream_request.h"
 
-class AudioStreamIndicator;
 class DesktopStreamsRegistry;
-class MediaStreamCaptureIndicator;
 
 // This singleton is used to receive updates about media events from the content
 // layer. Based on Chrome's implementation.
@@ -80,13 +78,14 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver,
   void getDefaultDevices(const std::string &audioDeviceId, const std::string &videoDeviceId, bool audio, bool video, content::MediaStreamDevices *);
 
   // Overridden from content::MediaObserver:
-  virtual void OnAudioCaptureDevicesChanged(const content::MediaStreamDevices &) Q_DECL_OVERRIDE;
-  virtual void OnVideoCaptureDevicesChanged(const content::MediaStreamDevices &) Q_DECL_OVERRIDE;
-  virtual void OnMediaRequestStateChanged(int renderProcessId, int renderViewId, int pageRequestId, const content::MediaStreamDevice &device
+  virtual void OnAudioCaptureDevicesChanged() Q_DECL_OVERRIDE { }
+  virtual void OnVideoCaptureDevicesChanged() Q_DECL_OVERRIDE { }
+  virtual void OnMediaRequestStateChanged(int renderProcessId, int renderViewId, int pageRequestId, const GURL &securityOrigin, const content::MediaStreamDevice &device
                                           , content::MediaRequestState state) Q_DECL_OVERRIDE;
-  virtual void OnAudioStreamPlayingChanged(int /*render_process_id*/, int /*render_view_id*/, int /*stream_id*/
-                                           , bool /*is_playing*/, float /*power_dBFS*/, bool /*clipped*/) Q_DECL_OVERRIDE {}
-  virtual void OnCreatingAudioStream(int renderProcessId, int renderViewId) Q_DECL_OVERRIDE;
+
+  virtual void OnCreatingAudioStream(int /*render_process_id*/, int /*render_frame_id*/) Q_DECL_OVERRIDE { }
+  virtual void OnAudioStreamPlaying(int /*render_process_id*/, int /*render_frame_id*/, int /*stream_id*/, const ReadPowerAndClipCallback& /*power_read_callback*/) Q_DECL_OVERRIDE { }
+  virtual void OnAudioStreamStopped(int /*render_process_id*/, int /*render_frame_id*/, int /*stream_id*/) Q_DECL_OVERRIDE { }
 
   DesktopStreamsRegistry *getDesktopStreamsRegistry();
 
@@ -107,9 +106,6 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver,
   MediaCaptureDevicesDispatcher();
   virtual ~MediaCaptureDevicesDispatcher();
 
-  const content::MediaStreamDevices &getAudioCaptureDevices();
-  const content::MediaStreamDevices &getVideoCaptureDevices();
-
   // content::NotificationObserver implementation.
   virtual void Observe(int type, const content::NotificationSource &source, const content::NotificationDetails &details) Q_DECL_OVERRIDE;
 
@@ -121,21 +117,9 @@ class MediaCaptureDevicesDispatcher : public content::MediaObserver,
   void ProcessQueuedAccessRequest(content::WebContents *);
 
   // Called by the MediaObserver() functions, executed on UI thread.
-  void updateAudioDevicesOnUIThread(const content::MediaStreamDevices &);
-  void updateVideoDevicesOnUIThread(const content::MediaStreamDevices &);
   void updateMediaRequestStateOnUIThread(int renderProcessId, int renderViewId, int pageRequestId, const content::MediaStreamDevice &
                                          , content::MediaRequestState);
 
-  // A list of cached audio capture devices.
-  content::MediaStreamDevices m_audioDevices;
-
-  // A list of cached video capture devices.
-  content::MediaStreamDevices m_videoDevices;
-
-  // Flag to indicate if device enumeration has been done/doing.
-  // Only accessed on UI thread.
-  bool m_devicesEnumerated;
-
   RequestsQueues m_pendingRequests;
 
   scoped_ptr<DesktopStreamsRegistry> m_desktopStreamsRegistry;
diff --git a/src/core/network_delegate_qt.cpp b/src/core/network_delegate_qt.cpp
index 424d0e631..56156a4fb 100644
--- a/src/core/network_delegate_qt.cpp
+++ b/src/core/network_delegate_qt.cpp
@@ -84,8 +84,8 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, const net::C
     Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
     const content::ResourceRequestInfo *info = content::ResourceRequestInfo::ForRequest(request);
     int renderProcessId;
-    int renderViewId;
-    if (!info || !info->GetRenderViewForRequest(request, &renderProcessId, &renderViewId))
+    int renderFrameId;
+    if (!info || !info->GetRenderFrameForRequest(request, &renderProcessId, &renderFrameId))
         // Abort the request if it has no associated render info / render view.
         return net::ERR_ABORTED;
 
@@ -105,7 +105,7 @@ int NetworkDelegateQt::OnBeforeURLRequest(net::URLRequest *request, const net::C
         resourceType == ResourceType::MAIN_FRAME,
         navigationType,
         renderProcessId,
-        renderViewId
+        renderFrameId
     };
 
     content::BrowserThread::PostTask(
@@ -159,11 +159,11 @@ void NetworkDelegateQt::NotifyNavigationRequestedOnUIThread(net::URLRequest *req
     Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
 
     int navigationRequestAction = WebContentsAdapterClient::AcceptRequest;
-    content::RenderViewHost *rvh = content::RenderViewHost::FromID(params.renderProcessId, params.renderViewId);
+    content::RenderFrameHost *rfh = content::RenderFrameHost::FromID(params.renderProcessId, params.renderFrameId);
 
-    if (rvh) {
-        content::WebContents *webContents = content::WebContents::FromRenderViewHost(rvh);
-        WebContentsAdapterClient *client = WebContentsViewQt::from(webContents->GetView())->client();
+    if (rfh) {
+        content::WebContents *webContents = content::WebContents::FromRenderViewHost(rfh->GetRenderViewHost());
+        WebContentsAdapterClient *client = WebContentsViewQt::from(static_cast<content::WebContentsImpl*>(webContents)->GetView())->client();
         client->navigationRequested(params.navigationType, params.url, navigationRequestAction, params.isMainFrameRequest);
     }
 
diff --git a/src/core/network_delegate_qt.h b/src/core/network_delegate_qt.h
index d057b9915..6066c4c95 100644
--- a/src/core/network_delegate_qt.h
+++ b/src/core/network_delegate_qt.h
@@ -53,42 +53,17 @@ public:
     NetworkDelegateQt() {}
     virtual ~NetworkDelegateQt() {}
 
-private:
     // net::NetworkDelegate implementation
     virtual int OnBeforeURLRequest(net::URLRequest* request, const net::CompletionCallback& callback, GURL* new_url) Q_DECL_OVERRIDE;
-    virtual int OnBeforeSendHeaders(net::URLRequest* request, const net::CompletionCallback& callback, net::HttpRequestHeaders* headers) Q_DECL_OVERRIDE
-    {
-        return net::OK;
-    }
-
-    virtual void OnSendHeaders(net::URLRequest* request, const net::HttpRequestHeaders& headers) Q_DECL_OVERRIDE {}
-    virtual int OnHeadersReceived(net::URLRequest* request, const net::CompletionCallback& callback,
-        const net::HttpResponseHeaders* original_response_headers,
-        scoped_refptr<net::HttpResponseHeaders>* override_response_headers) Q_DECL_OVERRIDE { return net::OK; }
-
-    virtual void OnBeforeRedirect(net::URLRequest* request, const GURL& new_location) Q_DECL_OVERRIDE { }
-    virtual void OnResponseStarted(net::URLRequest* request) Q_DECL_OVERRIDE { }
-    virtual void OnRawBytesRead(const net::URLRequest& request, int bytes_read) Q_DECL_OVERRIDE { }
-    virtual void OnCompleted(net::URLRequest* request, bool started) Q_DECL_OVERRIDE { }
     virtual void OnURLRequestDestroyed(net::URLRequest* request) Q_DECL_OVERRIDE;
-
-    virtual void OnPACScriptError(int line_number, const base::string16& error) Q_DECL_OVERRIDE { }
-    virtual AuthRequiredResponse OnAuthRequired(net::URLRequest* request, const net::AuthChallengeInfo& auth_info,
-        const AuthCallback& callback, net::AuthCredentials* credentials) Q_DECL_OVERRIDE { return AUTH_REQUIRED_RESPONSE_NO_ACTION; }
-
-    virtual bool OnCanGetCookies(const net::URLRequest& request, const net::CookieList& cookie_list) Q_DECL_OVERRIDE { return true; }
-    virtual bool OnCanSetCookie(const net::URLRequest& request, const std::string& cookie_line, net::CookieOptions* options) Q_DECL_OVERRIDE { return true; }
     virtual bool OnCanAccessFile(const net::URLRequest& request, const base::FilePath& path) const Q_DECL_OVERRIDE { return true; }
-    virtual bool OnCanThrottleRequest(const net::URLRequest& request) const Q_DECL_OVERRIDE { return false; }
-    virtual int OnBeforeSocketStreamConnect(net::SocketStream* stream, const net::CompletionCallback& callback) Q_DECL_OVERRIDE { return net::OK; }
-    virtual void OnRequestWaitStateChange(const net::URLRequest& request, RequestWaitState state) Q_DECL_OVERRIDE { }
 
     struct RequestParams {
         QUrl url;
         bool isMainFrameRequest;
         int navigationType;
         int renderProcessId;
-        int renderViewId;
+        int renderFrameId;
     };
 
     void NotifyNavigationRequestedOnUIThread(net::URLRequest *request,
diff --git a/src/core/ozone_platform_eglfs.h b/src/core/ozone_platform_eglfs.h
index 35205ac1f..7c32f2699 100644
--- a/src/core/ozone_platform_eglfs.h
+++ b/src/core/ozone_platform_eglfs.h
@@ -42,8 +42,7 @@
 #ifndef UI_OZONE_PLATFORM_EGLFS_OZONE_PLATFORM_EGLFS_H_
 #define UI_OZONE_PLATFORM_EGLFS_OZONE_PLATFORM_EGLFS_H_
 
-#include "ui/events/ozone/evdev/event_factory.h"
-#include "ui/gfx/ozone/dri/dri_surface_factory.h"
+#include "ui/events/ozone/evdev/event_factory_evdev.h"
 #include "ui/ozone/ozone_platform.h"
 
 #include "surface_factory_qt.h"
diff --git a/src/core/process_main.cpp b/src/core/process_main.cpp
index 56a79cb13..05aa756a9 100644
--- a/src/core/process_main.cpp
+++ b/src/core/process_main.cpp
@@ -52,14 +52,21 @@ namespace QtWebEngine {
 
 int processMain(int argc, const char **argv)
 {
+    ContentMainDelegateQt delegate;
+    content::ContentMainParams params(&delegate);
+
 #if defined(OS_WIN)
     HINSTANCE instance_handle = NULL;
     sandbox::SandboxInterfaceInfo sandbox_info = {0};
     content::InitializeSandboxInfo(&sandbox_info);
-    return content::ContentMain(instance_handle, &sandbox_info, new ContentMainDelegateQt);
+    params.instance = instance_handle;
+    params.sandbox_info = &sandbox_info;
 #else
-    return content::ContentMain(argc, argv, new ContentMainDelegateQt);
+    params.argc = argc;
+    params.argv = argv;
 #endif // OS_WIN
+
+    return content::ContentMain(params);
 }
 
 }
diff --git a/src/core/qtwebengine.gypi b/src/core/qtwebengine.gypi
index f4482a858..ba08c72c1 100644
--- a/src/core/qtwebengine.gypi
+++ b/src/core/qtwebengine.gypi
@@ -3,7 +3,7 @@
     # information so that qmake can take care of the deployment.
     'let_qmake_do_the_linking': 1,
     'variables': {
-      'version_script_location%': '<(chromium_src_dir)/chrome/tools/build/version.py',
+      'version_script_location%': '<(chromium_src_dir)/build/util/version.py',
     },
     'dependencies': [
       '<(chromium_src_dir)/base/base.gyp:base',
@@ -24,12 +24,12 @@
       '<(chromium_src_dir)/net/net.gyp:net',
       '<(chromium_src_dir)/net/net.gyp:net_resources',
       '<(chromium_src_dir)/skia/skia.gyp:skia',
-      '<(chromium_src_dir)/third_party/WebKit/Source/web/web.gyp:webkit',
+      '<(chromium_src_dir)/third_party/WebKit/Source/web/web.gyp:blink_web',
+      '<(chromium_src_dir)/ui/base/ui_base.gyp:ui_base',
       '<(chromium_src_dir)/ui/gl/gl.gyp:gl',
-      '<(chromium_src_dir)/ui/ui.gyp:ui',
       '<(chromium_src_dir)/url/url.gyp:url_lib',
       '<(chromium_src_dir)/v8/tools/gyp/v8.gyp:v8',
-      '<(chromium_src_dir)/webkit/glue/webkit_glue.gyp:*',
+
       'chrome_qt.gyp:chrome_qt',
     ],
     'include_dirs': [
diff --git a/src/core/qtwebengine_extras.gypi b/src/core/qtwebengine_extras.gypi
index eafe5bc28..ab8af819d 100644
--- a/src/core/qtwebengine_extras.gypi
+++ b/src/core/qtwebengine_extras.gypi
@@ -6,20 +6,20 @@
   'target_defaults': {
     # patterns used to exclude chromium files from the build when we have a drop-in replacement
     'sources/': [
-      ['exclude', 'base/clipboard/clipboard_android.cc$'],
-      ['exclude', 'base/clipboard/clipboard_aura.cc$'],
-      ['exclude', 'base/clipboard/clipboard_aurax11.cc$'],
-      ['exclude', 'base/clipboard/clipboard_gtk.cc$'],
-      ['exclude', 'base/clipboard/clipboard_mac.mm$'],
-      ['exclude', 'base/clipboard/clipboard_win.cc$'],
-      ['exclude', 'base/clipboard/clipboard_util_win\\.(cc|h)$'],
-      ['exclude', 'base/dragdrop/os_exchange_data_provider_aurax11\\.(cc|h)$'],
-      ['exclude', 'base/dragdrop/os_exchange_data_provider_win\\.(cc|h)$'],
-      ['exclude', 'base/resource/resource_bundle_android.cc$'],
-      ['exclude', 'base/resource/resource_bundle_auralinux.cc$'],
-      ['exclude', 'base/resource/resource_bundle_gtk.cc$'],
-      ['exclude', 'base/resource/resource_bundle_mac.mm$'],
-      ['exclude', 'base/resource/resource_bundle_win.cc$'],
+      ['exclude', 'clipboard/clipboard_android.cc$'],
+      ['exclude', 'clipboard/clipboard_aura.cc$'],
+      ['exclude', 'clipboard/clipboard_aurax11.cc$'],
+      ['exclude', 'clipboard/clipboard_gtk.cc$'],
+      ['exclude', 'clipboard/clipboard_mac.mm$'],
+      ['exclude', 'clipboard/clipboard_win.cc$'],
+      ['exclude', 'clipboard/clipboard_util_win\\.(cc|h)$'],
+      ['exclude', 'dragdrop/os_exchange_data_provider_aurax11\\.(cc|h)$'],
+      ['exclude', 'dragdrop/os_exchange_data_provider_win\\.(cc|h)$'],
+      ['exclude', 'resource/resource_bundle_android.cc$'],
+      ['exclude', 'resource/resource_bundle_auralinux.cc$'],
+      ['exclude', 'resource/resource_bundle_gtk.cc$'],
+      ['exclude', 'resource/resource_bundle_mac.mm$'],
+      ['exclude', 'resource/resource_bundle_win.cc$'],
       ['exclude', 'browser/web_contents/web_contents_view_android\\.(cc|h)$'],
       ['exclude', 'browser/web_contents/web_contents_view_aura\\.(cc|h)$'],
       ['exclude', 'browser/web_contents/web_contents_view_gtk\\.(cc|h)$'],
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index 7228c51e7..d2ad67af6 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -56,10 +56,12 @@
 #include "content/browser/accessibility/browser_accessibility_state_impl.h"
 #include "content/browser/renderer_host/render_view_host_impl.h"
 #include "content/browser/renderer_host/ui_events_helper.h"
+#include "content/common/cursors/webcursor.h"
 #include "content/common/gpu/gpu_messages.h"
 #include "content/common/view_messages.h"
-#include "content/public/common/content_switches.h"
 #include "content/public/browser/browser_accessibility_state.h"
+#include "content/public/browser/browser_thread.h"
+#include "content/public/common/content_switches.h"
 #include "third_party/skia/include/core/SkColor.h"
 #include "third_party/WebKit/public/platform/WebColor.h"
 #include "third_party/WebKit/public/platform/WebCursorInfo.h"
@@ -67,7 +69,6 @@
 #include "ui/base/clipboard/scoped_clipboard_writer.h"
 #include "ui/events/event.h"
 #include "ui/gfx/size_conversions.h"
-#include "webkit/common/cursors/webcursor.h"
 
 #include <QEvent>
 #include <QFocusEvent>
@@ -90,8 +91,6 @@ static inline ui::EventType toUIEventType(Qt::TouchPointState state)
         return ui::ET_TOUCH_PRESSED;
     case Qt::TouchPointMoved:
         return ui::ET_TOUCH_MOVED;
-    case Qt::TouchPointStationary:
-        return ui::ET_TOUCH_STATIONARY;
     case Qt::TouchPointReleased:
         return ui::ET_TOUCH_RELEASED;
     default:
@@ -190,11 +189,6 @@ void RenderWidgetHostViewQt::setAdapterClient(WebContentsAdapterClient *adapterC
         InitAsChild(0);
 }
 
-content::BackingStore *RenderWidgetHostViewQt::AllocBackingStore(const gfx::Size &size)
-{
-    Q_UNREACHABLE();
-}
-
 void RenderWidgetHostViewQt::InitAsChild(gfx::NativeView)
 {
     if (!m_adapterClient) {
@@ -323,14 +317,6 @@ gfx::Rect RenderWidgetHostViewQt::GetViewBounds() const
     return gfx::BoundingRect(p1, p2);
 }
 
-// Subclasses should override this method to do what is appropriate to set
-// the custom background for their platform.
-void RenderWidgetHostViewQt::SetBackground(const SkBitmap& background)
-{
-    RenderWidgetHostViewBase::SetBackground(background);
-    // Send(new ViewMsg_SetBackground(m_host->GetRoutingID(), background));
-}
-
 // Return value indicates whether the mouse is locked successfully or not.
 bool RenderWidgetHostViewQt::LockMouse()
 {
@@ -352,7 +338,7 @@ void RenderWidgetHostViewQt::WasHidden()
     m_host->WasHidden();
 }
 
-void RenderWidgetHostViewQt::MovePluginWindows(const gfx::Vector2d&, const std::vector<content::WebPluginGeometry>&)
+void RenderWidgetHostViewQt::MovePluginWindows(const std::vector<content::WebPluginGeometry>&)
 {
     // QT_NOT_YET_IMPLEMENTED
 }
@@ -363,9 +349,9 @@ void RenderWidgetHostViewQt::Blur()
     m_host->Blur();
 }
 
-void RenderWidgetHostViewQt::UpdateCursor(const WebCursor &webCursor)
+void RenderWidgetHostViewQt::UpdateCursor(const content::WebCursor &webCursor)
 {
-    WebCursor::CursorInfo cursorInfo;
+    content::WebCursor::CursorInfo cursorInfo;
     webCursor.GetCursorInfo(&cursorInfo);
     Qt::CursorShape shape;
     switch (cursorInfo.type) {
@@ -465,10 +451,10 @@ void RenderWidgetHostViewQt::SetIsLoading(bool)
     // We use WebContentsDelegateQt::LoadingStateChanged to notify about loading state.
 }
 
-void RenderWidgetHostViewQt::TextInputTypeChanged(ui::TextInputType type, ui::TextInputMode, bool)
+void RenderWidgetHostViewQt::TextInputStateChanged(const ViewHostMsg_TextInputState_Params& params)
 {
-    m_currentInputType = type;
-    m_delegate->inputMethodStateChanged(static_cast<bool>(type));
+    m_currentInputType = params.type;
+    m_delegate->inputMethodStateChanged(static_cast<bool>(params.type));
 }
 
 void RenderWidgetHostViewQt::ImeCancelComposition()
@@ -482,21 +468,6 @@ void RenderWidgetHostViewQt::ImeCompositionRangeChanged(const gfx::Range&, const
     QT_NOT_YET_IMPLEMENTED
 }
 
-void RenderWidgetHostViewQt::DidUpdateBackingStore(const gfx::Rect& scroll_rect, const gfx::Vector2d& scroll_delta, const std::vector<gfx::Rect>& copy_rects, const ui::LatencyInfo& /* latency_info */)
-{
-    if (!m_delegate->isVisible())
-        return;
-
-    Paint(scroll_rect);
-
-    for (size_t i = 0; i < copy_rects.size(); ++i) {
-        gfx::Rect rect = gfx::SubtractRects(copy_rects[i], scroll_rect);
-        if (rect.IsEmpty())
-            continue;
-        Paint(rect);
-    }
-}
-
 void RenderWidgetHostViewQt::RenderProcessGone(base::TerminationStatus, int)
 {
     Destroy();
@@ -533,12 +504,10 @@ void RenderWidgetHostViewQt::ScrollOffsetChanged()
     // Not used.
 }
 
-void RenderWidgetHostViewQt::CopyFromCompositingSurface(const gfx::Rect& src_subrect, const gfx::Size& /* dst_size */, const base::Callback<void(bool, const SkBitmap&)>& callback)
+void RenderWidgetHostViewQt::CopyFromCompositingSurface(const gfx::Rect& src_subrect, const gfx::Size& /* dst_size */, const base::Callback<void(bool, const SkBitmap&)>& callback, const SkBitmap::Config config)
 {
-    // Grab the snapshot from the renderer as that's the only reliable way to
-    // readback from the GPU for this platform right now.
-    // FIXME: is this true?
-    GetRenderWidgetHost()->GetSnapshotFromRenderer(src_subrect, callback);
+    NOTIMPLEMENTED();
+    callback.Run(false, SkBitmap());
 }
 
 void RenderWidgetHostViewQt::CopyFromCompositingSurfaceToVideoFrame(const gfx::Rect& src_subrect, const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(bool)>& callback)
@@ -552,12 +521,6 @@ bool RenderWidgetHostViewQt::CanCopyToVideoFrame() const
     return false;
 }
 
-void RenderWidgetHostViewQt::OnAcceleratedCompositingStateChange()
-{
-    // bool activated = m_host->is_accelerated_compositing_active();
-    QT_NOT_YET_IMPLEMENTED
-}
-
 void RenderWidgetHostViewQt::AcceleratedSurfaceInitialized(int host_id, int route_id)
 {
 }
@@ -641,16 +604,6 @@ gfx::GLSurfaceHandle RenderWidgetHostViewQt::GetCompositingSurface()
     return gfx::GLSurfaceHandle(gfx::kNullPluginWindow, gfx::TEXTURE_TRANSPORT);
 }
 
-void RenderWidgetHostViewQt::SetHasHorizontalScrollbar(bool) { }
-
-void RenderWidgetHostViewQt::SetScrollOffsetPinning(bool, bool) { }
-
-void RenderWidgetHostViewQt::OnAccessibilityEvents(const std::vector<AccessibilityHostMsg_EventParams> &notifications)
-{
-    CreateBrowserAccessibilityManagerIfNeeded();
-    GetBrowserAccessibilityManager()->OnAccessibilityEvents(notifications);
-}
-
 void RenderWidgetHostViewQt::SelectionChanged(const base::string16 &text, size_t offset, const gfx::Range &range)
 {
     content::RenderWidgetHostViewBase::SelectionChanged(text, offset, range);
@@ -671,7 +624,7 @@ bool RenderWidgetHostViewQt::CanDispatchToConsumer(ui::GestureConsumer *consumer
     return true;
 }
 
-void RenderWidgetHostViewQt::DispatchPostponedGestureEvent(ui::GestureEvent* event)
+void RenderWidgetHostViewQt::DispatchGestureEvent(ui::GestureEvent* event)
 {
     ForwardGestureEventToRenderer(event);
 }
@@ -805,11 +758,6 @@ void RenderWidgetHostViewQt::sendDelegatedFrameAck()
         m_host->GetProcess()->GetID(), ack);
 }
 
-void RenderWidgetHostViewQt::Paint(const gfx::Rect& damage_rect)
-{
-    Q_UNREACHABLE();
-}
-
 void RenderWidgetHostViewQt::ForwardGestureEventToRenderer(ui::GestureEvent* gesture)
 {
     if ((gesture->type() == ui::ET_GESTURE_PINCH_BEGIN
@@ -830,7 +778,7 @@ void RenderWidgetHostViewQt::ForwardGestureEventToRenderer(ui::GestureEvent* ges
         // So explicitly send an event to stop any in-progress flings.
         blink::WebGestureEvent flingCancel = webGestureEvent;
         flingCancel.type = blink::WebInputEvent::GestureFlingCancel;
-        flingCancel.sourceDevice = blink::WebGestureEvent::Touchscreen;
+        flingCancel.sourceDevice = blink::WebGestureDeviceTouchscreen;
         m_host->ForwardGestureEvent(flingCancel);
     }
 
@@ -973,7 +921,7 @@ void RenderWidgetHostViewQt::handleInputMethodEvent(QInputMethodEvent *ev)
     }
 }
 
-void RenderWidgetHostViewQt::SetAccessibilityFocus(int acc_obj_id)
+void RenderWidgetHostViewQt::AccessibilitySetFocus(int acc_obj_id)
 {
     if (!m_host)
         return;
@@ -1008,17 +956,11 @@ void RenderWidgetHostViewQt::AccessibilitySetTextSelection(int acc_obj_id, int s
     m_host->AccessibilitySetTextSelection(acc_obj_id, start_offset, end_offset);
 }
 
-gfx::Point RenderWidgetHostViewQt::GetLastTouchEventLocation() const
-{
-    QT_NOT_YET_IMPLEMENTED
-    return gfx::Point();
-}
-
-void RenderWidgetHostViewQt::FatalAccessibilityTreeError()
+void RenderWidgetHostViewQt::AccessibilityFatalError()
 {
     if (!m_host)
         return;
-    m_host->FatalAccessibilityTreeError();
+    m_host->AccessibilityFatalError();
     SetBrowserAccessibilityManager(NULL);
 }
 
@@ -1103,8 +1045,7 @@ QAccessibleInterface *RenderWidgetHostViewQt::GetQtAccessible()
     // Assume we have a screen reader doing stuff
     CreateBrowserAccessibilityManagerIfNeeded();
     content::BrowserAccessibilityState::GetInstance()->OnScreenReaderDetected();
-    content::BrowserAccessibilityStateImpl::GetInstance()->SetAccessibilityMode(
-                AccessibilityModeComplete);
+    content::BrowserAccessibilityStateImpl::GetInstance()->EnableAccessibility();
 
     content::BrowserAccessibility *acc = GetBrowserAccessibilityManager()->GetRoot();
     content::BrowserAccessibilityQt *accQt = static_cast<content::BrowserAccessibilityQt*>(acc);
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index 85a48e2a7..bb0478787 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -71,6 +71,10 @@ QT_END_NAMESPACE
 
 class WebContentsAdapterClient;
 
+namespace content {
+class RenderWidgetHostImpl;
+}
+
 struct MultipleMouseClickHelper
 {
     QPoint lastPressPosition;
@@ -102,8 +106,6 @@ public:
     void setDelegate(RenderWidgetHostViewQtDelegate *delegate);
     void setAdapterClient(WebContentsAdapterClient *adapterClient);
 
-    virtual content::BackingStore *AllocBackingStore(const gfx::Size &size) Q_DECL_OVERRIDE;
-
     virtual void InitAsChild(gfx::NativeView) Q_DECL_OVERRIDE;
     virtual void InitAsPopup(content::RenderWidgetHostView*, const gfx::Rect&) Q_DECL_OVERRIDE;
     virtual void InitAsFullscreen(content::RenderWidgetHostView*) Q_DECL_OVERRIDE;
@@ -121,28 +123,25 @@ public:
     virtual void Hide() Q_DECL_OVERRIDE;
     virtual bool IsShowing() Q_DECL_OVERRIDE;
     virtual gfx::Rect GetViewBounds() const Q_DECL_OVERRIDE;
-    virtual void SetBackground(const SkBitmap& background) Q_DECL_OVERRIDE;
     virtual bool LockMouse() Q_DECL_OVERRIDE;
     virtual void UnlockMouse() Q_DECL_OVERRIDE;
     virtual void WasShown() Q_DECL_OVERRIDE;
     virtual void WasHidden() Q_DECL_OVERRIDE;
-    virtual void MovePluginWindows(const gfx::Vector2d&, const std::vector<content::WebPluginGeometry>&) Q_DECL_OVERRIDE;
+    virtual void MovePluginWindows(const std::vector<content::WebPluginGeometry>&) Q_DECL_OVERRIDE;
     virtual void Blur() Q_DECL_OVERRIDE;
-    virtual void UpdateCursor(const WebCursor&) Q_DECL_OVERRIDE;
+    virtual void UpdateCursor(const content::WebCursor&) Q_DECL_OVERRIDE;
     virtual void SetIsLoading(bool) Q_DECL_OVERRIDE;
-    virtual void TextInputTypeChanged(ui::TextInputType, ui::TextInputMode, bool) Q_DECL_OVERRIDE;
+    virtual void TextInputStateChanged(const ViewHostMsg_TextInputState_Params& params) Q_DECL_OVERRIDE;
     virtual void ImeCancelComposition() Q_DECL_OVERRIDE;
     virtual void ImeCompositionRangeChanged(const gfx::Range&, const std::vector<gfx::Rect>&) Q_DECL_OVERRIDE;
-    virtual void DidUpdateBackingStore(const gfx::Rect& scroll_rect, const gfx::Vector2d& scroll_delta, const std::vector<gfx::Rect>& copy_rects, const ui::LatencyInfo&) Q_DECL_OVERRIDE;
     virtual void RenderProcessGone(base::TerminationStatus, int) Q_DECL_OVERRIDE;
     virtual void Destroy() Q_DECL_OVERRIDE;
     virtual void SetTooltipText(const base::string16 &tooltip_text) Q_DECL_OVERRIDE;
     virtual void SelectionBoundsChanged(const ViewHostMsg_SelectionBounds_Params&) Q_DECL_OVERRIDE;
     virtual void ScrollOffsetChanged() Q_DECL_OVERRIDE;
-    virtual void CopyFromCompositingSurface(const gfx::Rect& src_subrect, const gfx::Size& /* dst_size */, const base::Callback<void(bool, const SkBitmap&)>& callback) Q_DECL_OVERRIDE;
+    virtual void CopyFromCompositingSurface(const gfx::Rect& src_subrect, const gfx::Size& /* dst_size */, const base::Callback<void(bool, const SkBitmap&)>& callback, const SkBitmap::Config config) Q_DECL_OVERRIDE;
     virtual void CopyFromCompositingSurfaceToVideoFrame(const gfx::Rect& src_subrect, const scoped_refptr<media::VideoFrame>& target, const base::Callback<void(bool)>& callback) Q_DECL_OVERRIDE;
     virtual bool CanCopyToVideoFrame() const Q_DECL_OVERRIDE;
-    virtual void OnAcceleratedCompositingStateChange() Q_DECL_OVERRIDE;
     virtual void AcceleratedSurfaceInitialized(int host_id, int route_id) Q_DECL_OVERRIDE;
     virtual void AcceleratedSurfaceBuffersSwapped(const GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params& params, int gpu_host_id) Q_DECL_OVERRIDE;
     virtual void AcceleratedSurfacePostSubBuffer(const GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params& params, int gpu_host_id) Q_DECL_OVERRIDE;
@@ -153,9 +152,6 @@ public:
     virtual void GetScreenInfo(blink::WebScreenInfo* results) Q_DECL_OVERRIDE;
     virtual gfx::Rect GetBoundsInRootWindow() Q_DECL_OVERRIDE;
     virtual gfx::GLSurfaceHandle GetCompositingSurface() Q_DECL_OVERRIDE;
-    virtual void SetHasHorizontalScrollbar(bool) Q_DECL_OVERRIDE;
-    virtual void SetScrollOffsetPinning(bool, bool) Q_DECL_OVERRIDE;
-    virtual void OnAccessibilityEvents(const std::vector<AccessibilityHostMsg_EventParams>&) Q_DECL_OVERRIDE;
     virtual void ProcessAckedTouchEvent(const content::TouchEventWithLatencyInfo &touch, content::InputEventAckState ack_result) Q_DECL_OVERRIDE;
 
     // Overridden from RenderWidgetHostViewBase.
@@ -163,7 +159,7 @@ public:
 
     // Overridden from ui::GestureEventHelper.
     virtual bool CanDispatchToConsumer(ui::GestureConsumer*) Q_DECL_OVERRIDE;
-    virtual void DispatchPostponedGestureEvent(ui::GestureEvent*) Q_DECL_OVERRIDE;
+    virtual void DispatchGestureEvent(ui::GestureEvent*) Q_DECL_OVERRIDE;
     virtual void DispatchCancelTouchEvent(ui::TouchEvent*) Q_DECL_OVERRIDE;
 
     // Overridden from RenderWidgetHostViewQtDelegateClient.
@@ -187,7 +183,6 @@ public:
     virtual bool IsSpeaking() const Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED; return false; }
     virtual void SpeakSelection() Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED }
     virtual bool PostProcessEventForPluginIme(const content::NativeWebKeyboardEvent& event) Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED; return false; }
-    virtual void AboutToWaitForBackingStoreMsg() Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED }
     virtual void StopSpeaking() Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED }
     virtual void SetWindowVisibility(bool visible) Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED }
     virtual bool SupportsSpeech() const Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED; return false; }
@@ -211,13 +206,17 @@ public:
 #endif // defined(OS_WIN)
 
     // Overridden from content::BrowserAccessibilityDelegate
-    virtual void SetAccessibilityFocus(int acc_obj_id) Q_DECL_OVERRIDE;
+    virtual void AccessibilitySetFocus(int acc_obj_id) Q_DECL_OVERRIDE;
     virtual void AccessibilityDoDefaultAction(int acc_obj_id) Q_DECL_OVERRIDE;
+    virtual void AccessibilityShowMenu(int acc_obj_id) Q_DECL_OVERRIDE { Q_UNREACHABLE(); }
     virtual void AccessibilityScrollToMakeVisible(int acc_obj_id, gfx::Rect subfocus) Q_DECL_OVERRIDE;
     virtual void AccessibilityScrollToPoint(int acc_obj_id, gfx::Point point) Q_DECL_OVERRIDE;
     virtual void AccessibilitySetTextSelection(int acc_obj_id, int start_offset, int end_offset) Q_DECL_OVERRIDE;
-    virtual gfx::Point GetLastTouchEventLocation() const Q_DECL_OVERRIDE;
-    virtual void FatalAccessibilityTreeError() Q_DECL_OVERRIDE;
+    virtual bool AccessibilityViewHasFocus() const Q_DECL_OVERRIDE { Q_UNREACHABLE(); }
+    virtual gfx::Rect AccessibilityGetViewBounds() const Q_DECL_OVERRIDE { Q_UNREACHABLE(); }
+    virtual gfx::Point AccessibilityOriginInScreen(const gfx::Rect& bounds) const Q_DECL_OVERRIDE { Q_UNREACHABLE(); }
+    virtual void AccessibilityHitTest(const gfx::Point& point) Q_DECL_OVERRIDE { Q_UNREACHABLE(); }
+    virtual void AccessibilityFatalError() Q_DECL_OVERRIDE;
 
     QAccessibleInterface *GetQtAccessible();
 
@@ -225,7 +224,6 @@ public:
 
 private:
     void sendDelegatedFrameAck();
-    void Paint(const gfx::Rect& damage_rect);
     void ProcessGestures(ui::GestureRecognizer::Gestures *gestures);
     void ForwardGestureEventToRenderer(ui::GestureEvent* gesture);
     int GetMappedTouch(int qtTouchId);
diff --git a/src/core/renderer/content_renderer_client_qt.cpp b/src/core/renderer/content_renderer_client_qt.cpp
index af1ba7dcb..ea91162a9 100644
--- a/src/core/renderer/content_renderer_client_qt.cpp
+++ b/src/core/renderer/content_renderer_client_qt.cpp
@@ -45,6 +45,7 @@
 #include "chrome/common/localized_error.h"
 #include "components/visitedlink/renderer/visitedlink_slave.h"
 #include "content/public/renderer/render_thread.h"
+#include "content/public/renderer/render_view.h"
 #include "net/base/net_errors.h"
 #include "third_party/WebKit/public/platform/WebURLError.h"
 #include "third_party/WebKit/public/platform/WebURLRequest.h"
@@ -78,7 +79,7 @@ void ContentRendererClientQt::RenderViewCreated(content::RenderView* render_view
 }
 
 // To tap into the chromium localized strings. Ripped from the chrome layer (highly simplified).
-void ContentRendererClientQt::GetNavigationErrorStrings(blink::WebFrame *frame, const blink::WebURLRequest &failed_request, const blink::WebURLError &error, const std::string &accept_languages, std::string *error_html, base::string16 *error_description)
+void ContentRendererClientQt::GetNavigationErrorStrings(content::RenderView* render_view, blink::WebFrame *frame, const blink::WebURLRequest &failed_request, const blink::WebURLError &error, std::string *error_html, base::string16 *error_description)
 {
     Q_UNUSED(frame)
 
@@ -92,8 +93,9 @@ void ContentRendererClientQt::GetNavigationErrorStrings(blink::WebFrame *frame,
       const std::string locale = content::RenderThread::Get()->GetLocale();
       // TODO(elproxy): We could potentially get better diagnostics here by first calling NetErrorHelper::GetErrorStringsForDnsProbe
       LocalizedError::GetStrings(error.reason, error.domain.utf8(),
-                                 error.unreachableURL, isPost, locale,
-                                 accept_languages, &error_strings);
+                                 error.unreachableURL, isPost, error.staleCopyInCache && !isPost,
+                                 locale, render_view->GetAcceptLanguages(), scoped_ptr<LocalizedError::ErrorPageParams>(),
+                                 &error_strings);
       resource_id = IDR_NET_ERROR_HTML;
 
 
diff --git a/src/core/renderer/content_renderer_client_qt.h b/src/core/renderer/content_renderer_client_qt.h
index ea284db97..d87817cf4 100644
--- a/src/core/renderer/content_renderer_client_qt.h
+++ b/src/core/renderer/content_renderer_client_qt.h
@@ -55,9 +55,9 @@ public:
     virtual void RenderThreadStarted() Q_DECL_OVERRIDE;
     virtual void RenderViewCreated(content::RenderView *render_view) Q_DECL_OVERRIDE;
 
-    virtual bool ShouldSuppressErrorPage(const GURL &) Q_DECL_OVERRIDE { return true; }
-    virtual void GetNavigationErrorStrings(blink::WebFrame* frame, const blink::WebURLRequest& failed_request, const blink::WebURLError& error
-            , const std::string& accept_languages, std::string* error_html, base::string16* error_description) Q_DECL_OVERRIDE;
+    virtual bool ShouldSuppressErrorPage(content::RenderFrame *, const GURL &) Q_DECL_OVERRIDE { return true; }
+    virtual void GetNavigationErrorStrings(content::RenderView* render_view, blink::WebFrame* frame, const blink::WebURLRequest& failed_request
+            , const blink::WebURLError& error, std::string* error_html, base::string16* error_description) Q_DECL_OVERRIDE;
 
     virtual unsigned long long VisitedLinkHash(const char *canonicalUrl, size_t length) Q_DECL_OVERRIDE;
     virtual bool IsLinkVisited(unsigned long long linkHash) Q_DECL_OVERRIDE;
diff --git a/src/core/resource_dispatcher_host_delegate_qt.cpp b/src/core/resource_dispatcher_host_delegate_qt.cpp
index 3e650afb7..f7c73767d 100644
--- a/src/core/resource_dispatcher_host_delegate_qt.cpp
+++ b/src/core/resource_dispatcher_host_delegate_qt.cpp
@@ -58,7 +58,7 @@ ResourceDispatcherHostLoginDelegateQt::ResourceDispatcherHostLoginDelegateQt(net
     : m_request(request)
 {
     Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
-    content::ResourceRequestInfo::ForRequest(request)->GetAssociatedRenderView(&m_renderProcessId,  &m_renderViewId);
+    content::ResourceRequestInfo::GetRenderFrameForRequest(request, &m_renderProcessId,  &m_renderFrameId);
 
     m_url = toQt(request->url());
     m_realm = QString::fromStdString(authInfo->realm);
@@ -84,8 +84,8 @@ void ResourceDispatcherHostLoginDelegateQt::OnRequestCancelled()
 void ResourceDispatcherHostLoginDelegateQt::triggerDialog()
 {
     Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
-    content::RenderViewHost* renderViewHost = content::RenderViewHost::FromID(m_renderProcessId, m_renderViewId);
-    content::WebContents *webContents = content::WebContents::FromRenderViewHost(renderViewHost);
+    content::RenderViewHost* renderViewHost = content::RenderFrameHost::FromID(m_renderProcessId, m_renderFrameId)->GetRenderViewHost();
+    content::WebContentsImpl *webContents = static_cast<content::WebContentsImpl *>(content::WebContents::FromRenderViewHost(renderViewHost));
     WebContentsAdapterClient *client = WebContentsViewQt::from(webContents->GetView())->client();
 
     // The widgets API will ask for credentials synchronouly, keep it simple for now.
@@ -116,11 +116,6 @@ void ResourceDispatcherHostLoginDelegateQt::sendAuthToRequester(bool success, co
     m_request = 0;
 }
 
-bool ResourceDispatcherHostDelegateQt::AcceptAuthRequest(net::URLRequest *, net::AuthChallengeInfo *)
-{
-    return true;
-}
-
 content::ResourceDispatcherHostLoginDelegate *ResourceDispatcherHostDelegateQt::CreateLoginDelegate(net::AuthChallengeInfo *authInfo, net::URLRequest *request)
 {
     // ResourceDispatcherHostLoginDelegateQt is ref-counted and will be released after we called ClearLoginDelegateForRequest.
diff --git a/src/core/resource_dispatcher_host_delegate_qt.h b/src/core/resource_dispatcher_host_delegate_qt.h
index 1b584912e..7b0693a1a 100644
--- a/src/core/resource_dispatcher_host_delegate_qt.h
+++ b/src/core/resource_dispatcher_host_delegate_qt.h
@@ -65,7 +65,7 @@ private:
     QString m_host;
 
     int m_renderProcessId;
-    int m_renderViewId;
+    int m_renderFrameId;
 
     // The request that wants login data.
     // Must only be accessed on the IO thread.
@@ -74,7 +74,6 @@ private:
 
 class ResourceDispatcherHostDelegateQt : public content::ResourceDispatcherHostDelegate {
 public:
-    virtual bool AcceptAuthRequest(net::URLRequest *request, net::AuthChallengeInfo *authInfo) Q_DECL_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 9db9a9d2c..c54a64f6e 100644
--- a/src/core/surface_factory_qt.cpp
+++ b/src/core/surface_factory_qt.cpp
@@ -45,7 +45,6 @@
 #include "base/files/file_path.h"
 #include "base/native_library.h"
 #include "ui/gl/gl_implementation.h"
-#include "ui/gl/gl_implementation_linux.h"
 
 #include <QGuiApplication>
 #include <qpa/qplatformnativeinterface.h>
diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp
index ce67bb23d..5636aec90 100644
--- a/src/core/url_request_context_getter_qt.cpp
+++ b/src/core/url_request_context_getter_qt.cpp
@@ -67,6 +67,7 @@
 #include "net/ftp/ftp_network_layer.h"
 
 #include "network_delegate_qt.h"
+#include "content_client_qt.h"
 #include "qrc_protocol_handler_qt.h"
 
 static const char kQrcSchemeQt[] = "qrc";
@@ -98,8 +99,8 @@ net::URLRequestContext *URLRequestContextGetterQt::GetURLRequestContext()
         m_urlRequestContext->set_network_delegate(m_networkDelegate.get());
 
         base::FilePath cookiesPath = m_basePath.Append(FILE_PATH_LITERAL("Cookies"));
-        scoped_refptr<net::CookieStore> cookieStore = content::CreatePersistentCookieStore(cookiesPath, true, NULL, NULL, scoped_ptr<content::CookieCryptoDelegate>());
-        cookieStore->GetCookieMonster()->SetPersistSessionCookies(true);
+        content::CookieStoreConfig cookieStoreConfig(cookiesPath, content::CookieStoreConfig::PERSISTANT_SESSION_COOKIES, NULL, NULL);
+        scoped_refptr<net::CookieStore> cookieStore = content::CreateCookieStore(cookieStoreConfig);
 
         m_storage.reset(new net::URLRequestContextStorage(m_urlRequestContext.get()));
         m_storage->set_cookie_store(cookieStore.get());
@@ -107,7 +108,7 @@ net::URLRequestContext *URLRequestContextGetterQt::GetURLRequestContext()
             new net::DefaultServerBoundCertStore(NULL),
             base::WorkerPool::GetTaskRunner(true)));
         m_storage->set_http_user_agent_settings(
-            new net::StaticHttpUserAgentSettings("en-us,en", base::EmptyString()));
+            new net::StaticHttpUserAgentSettings("en-us,en", ContentClientQt::getUserAgent()));
 
         scoped_ptr<net::HostResolver> host_resolver(
             net::HostResolver::CreateDefaultResolver(NULL));
@@ -166,16 +167,16 @@ net::URLRequestContext *URLRequestContextGetterQt::GetURLRequestContext()
         m_jobFactory.reset(new net::URLRequestJobFactoryImpl());
 
         // Chromium has a few protocol handlers ready for us, only pick blob: and throw away the rest.
-        content::ProtocolHandlerMap::iterator it = m_protocolHandlers.find(chrome::kBlobScheme);
+        content::ProtocolHandlerMap::iterator it = m_protocolHandlers.find(url::kBlobScheme);
         Q_ASSERT(it != m_protocolHandlers.end());
         m_jobFactory->SetProtocolHandler(it->first, it->second.release());
         m_protocolHandlers.clear();
 
-        m_jobFactory->SetProtocolHandler(chrome::kDataScheme, new net::DataProtocolHandler());
-        m_jobFactory->SetProtocolHandler(chrome::kFileScheme, new net::FileProtocolHandler(
+        m_jobFactory->SetProtocolHandler(url::kDataScheme, new net::DataProtocolHandler());
+        m_jobFactory->SetProtocolHandler(url::kFileScheme, new net::FileProtocolHandler(
             content::BrowserThread::GetBlockingPool()->GetTaskRunnerWithShutdownBehavior(base::SequencedWorkerPool::SKIP_ON_SHUTDOWN)));
         m_jobFactory->SetProtocolHandler(kQrcSchemeQt, new QrcProtocolHandlerQt());
-        m_jobFactory->SetProtocolHandler(content::kFtpScheme, new net::FtpProtocolHandler(
+        m_jobFactory->SetProtocolHandler(url::kFtpScheme, new net::FtpProtocolHandler(
             new net::FtpNetworkLayer(m_urlRequestContext->host_resolver())));
         m_urlRequestContext->set_job_factory(m_jobFactory.get());
     }
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 258feb92b..404af74ff 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -62,6 +62,7 @@
 #include "content/browser/renderer_host/render_view_host_impl.h"
 #include "content/browser/web_contents/web_contents_impl.h"
 #include "content/public/browser/child_process_security_policy.h"
+#include "content/public/browser/host_zoom_map.h"
 #include "content/public/browser/navigation_entry.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/favicon_status.h"
@@ -374,7 +375,7 @@ void WebContentsAdapter::initialize(WebContentsAdapterClient *adapterClient)
     d->renderViewObserverHost.reset(new QtRenderViewObserverHost(d->webContents.get(), adapterClient));
 
     // Let the WebContent's view know about the WebContentsAdapterClient.
-    WebContentsViewQt* contentsView = static_cast<WebContentsViewQt*>(d->webContents->GetView());
+    WebContentsViewQt* contentsView = static_cast<WebContentsViewQt*>(static_cast<content::WebContentsImpl*>(d->webContents.get())->GetView());
     contentsView->initialize(adapterClient);
 
     // This should only be necessary after having restored the history to a new WebContentsAdapter.
@@ -384,8 +385,7 @@ void WebContentsAdapter::initialize(WebContentsAdapterClient *adapterClient)
     content::RenderViewHost *rvh = d->webContents->GetRenderViewHost();
     Q_ASSERT(rvh);
     if (!rvh->IsRenderViewLive())
-        static_cast<content::WebContentsImpl*>(d->webContents.get())->CreateRenderViewForRenderManager(rvh, MSG_ROUTING_NONE);
-
+        static_cast<content::WebContentsImpl*>(d->webContents.get())->CreateRenderViewForRenderManager(rvh, MSG_ROUTING_NONE, MSG_ROUTING_NONE, true);
 }
 
 void WebContentsAdapter::reattachRWHV()
@@ -423,14 +423,14 @@ void WebContentsAdapter::stop()
         controller.RemoveEntryAtIndex(index);
 
     d->webContents->Stop();
-    d->webContents->GetView()->Focus();
+    d->webContents->Focus();
 }
 
 void WebContentsAdapter::reload()
 {
     Q_D(WebContentsAdapter);
     d->webContents->GetController().Reload(/*checkRepost = */false);
-    d->webContents->GetView()->Focus();
+    d->webContents->Focus();
 }
 
 void WebContentsAdapter::load(const QUrl &url)
@@ -439,7 +439,7 @@ void WebContentsAdapter::load(const QUrl &url)
     content::NavigationController::LoadURLParams params(toGurl(url));
     params.transition_type = content::PageTransitionFromInt(content::PAGE_TRANSITION_TYPED | content::PAGE_TRANSITION_FROM_ADDRESS_BAR);
     d->webContents->GetController().LoadURLWithParams(params);
-    d->webContents->GetView()->Focus();
+    d->webContents->Focus();
 }
 
 void WebContentsAdapter::setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl)
@@ -454,7 +454,7 @@ void WebContentsAdapter::setContent(const QByteArray &data, const QString &mimeT
     content::NavigationController::LoadURLParams params((GURL(urlString)));
     params.load_type = content::NavigationController::LOAD_TYPE_DATA;
     params.base_url_for_data_url = toGurl(baseUrl);
-    params.virtual_url_for_data_url = baseUrl.isEmpty() ? GURL(content::kAboutBlankURL) : toGurl(baseUrl);
+    params.virtual_url_for_data_url = baseUrl.isEmpty() ? GURL(url::kAboutBlankURL) : toGurl(baseUrl);
     params.can_load_local_resources = true;
     d->webContents->GetController().LoadURLWithParams(params);
 }
@@ -502,57 +502,57 @@ QString WebContentsAdapter::selectedText() const
 void WebContentsAdapter::undo()
 {
     Q_D(const WebContentsAdapter);
-    d->webContents->GetRenderViewHost()->Undo();
+    d->webContents->Undo();
 }
 
 void WebContentsAdapter::redo()
 {
     Q_D(const WebContentsAdapter);
-    d->webContents->GetRenderViewHost()->Redo();
+    d->webContents->Redo();
 }
 
 void WebContentsAdapter::cut()
 {
     Q_D(const WebContentsAdapter);
-    d->webContents->GetRenderViewHost()->Cut();
+    d->webContents->Cut();
 }
 
 void WebContentsAdapter::copy()
 {
     Q_D(const WebContentsAdapter);
-    d->webContents->GetRenderViewHost()->Copy();
+    d->webContents->Copy();
 }
 
 void WebContentsAdapter::paste()
 {
     Q_D(const WebContentsAdapter);
-    d->webContents->GetRenderViewHost()->Paste();
+    d->webContents->Paste();
 }
 
 void WebContentsAdapter::pasteAndMatchStyle()
 {
     Q_D(const WebContentsAdapter);
-    d->webContents->GetRenderViewHost()->PasteAndMatchStyle();
+    d->webContents->PasteAndMatchStyle();
 }
 
 void WebContentsAdapter::selectAll()
 {
     Q_D(const WebContentsAdapter);
-    d->webContents->GetRenderViewHost()->SelectAll();
+    d->webContents->SelectAll();
 }
 
 void WebContentsAdapter::navigateToIndex(int offset)
 {
     Q_D(WebContentsAdapter);
     d->webContents->GetController().GoToIndex(offset);
-    d->webContents->GetView()->Focus();
+    d->webContents->Focus();
 }
 
 void WebContentsAdapter::navigateToOffset(int offset)
 {
     Q_D(WebContentsAdapter);
     d->webContents->GetController().GoToOffset(offset);
-    d->webContents->GetView()->Focus();
+    d->webContents->Focus();
 }
 
 int WebContentsAdapter::navigationEntryCount()
@@ -611,13 +611,13 @@ void WebContentsAdapter::serializeNavigationHistory(QDataStream &output)
 void WebContentsAdapter::setZoomFactor(qreal factor)
 {
     Q_D(WebContentsAdapter);
-    d->webContents->SetZoomLevel(content::ZoomFactorToZoomLevel(static_cast<double>(factor)));
+    content::HostZoomMap::SetZoomLevel(d->webContents.get(), content::ZoomFactorToZoomLevel(static_cast<double>(factor)));
 }
 
 qreal WebContentsAdapter::currentZoomFactor() const
 {
     Q_D(const WebContentsAdapter);
-    return static_cast<qreal>(content::ZoomLevelToZoomFactor(d->webContents->GetZoomLevel()));
+    return content::ZoomLevelToZoomFactor(content::HostZoomMap::GetZoomLevel(d->webContents.get()));
 }
 
 void WebContentsAdapter::enableInspector(bool enable)
@@ -637,8 +637,7 @@ void WebContentsAdapter::runJavaScript(const QString &javaScript)
     Q_D(WebContentsAdapter);
     content::RenderViewHost *rvh = d->webContents->GetRenderViewHost();
     Q_ASSERT(rvh);
-    base::string16 mainFrameXPath;
-    rvh->ExecuteJavascriptInWebFrame(mainFrameXPath, toString16(javaScript));
+    rvh->GetMainFrame()->ExecuteJavaScript(toString16(javaScript));
 }
 
 quint64 WebContentsAdapter::runJavaScriptCallbackResult(const QString &javaScript)
@@ -646,9 +645,8 @@ quint64 WebContentsAdapter::runJavaScriptCallbackResult(const QString &javaScrip
     Q_D(WebContentsAdapter);
     content::RenderViewHost *rvh = d->webContents->GetRenderViewHost();
     Q_ASSERT(rvh);
-    content::RenderViewHost::JavascriptResultCallback callback = base::Bind(&callbackOnEvaluateJS, d->adapterClient, ++d->lastRequestId);
-    base::string16 mainFrameXPath;
-    rvh->ExecuteJavascriptInWebFrameCallbackResult(mainFrameXPath, toString16(javaScript), callback);
+    content::RenderFrameHost::JavaScriptResultCallback callback = base::Bind(&callbackOnEvaluateJS, d->adapterClient, ++d->lastRequestId);
+    rvh->GetMainFrame()->ExecuteJavaScript(toString16(javaScript), callback);
     return d->lastRequestId;
 }
 
@@ -678,7 +676,7 @@ quint64 WebContentsAdapter::findText(const QString &subString, bool caseSensitiv
     // Find already allows a request ID as input, but only as an int.
     // Use the same counter but mod it to MAX_INT, this keeps the same likeliness of request ID clashing.
     int shrunkRequestId = ++d->lastRequestId & 0x7fffffff;
-    d->webContents->GetRenderViewHost()->Find(shrunkRequestId, toString16(subString), options);
+    d->webContents->Find(shrunkRequestId, toString16(subString), options);
     return shrunkRequestId;
 }
 
@@ -686,7 +684,7 @@ void WebContentsAdapter::stopFinding()
 {
     Q_D(WebContentsAdapter);
     d->webContentsDelegate->setLastSearchedString(QString());
-    d->webContents->GetRenderViewHost()->StopFinding(content::STOP_FIND_ACTION_KEEP_SELECTION);
+    d->webContents->StopFinding(content::STOP_FIND_ACTION_KEEP_SELECTION);
 }
 
 void WebContentsAdapter::updateWebPreferences(const WebPreferences & webPreferences)
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index d706923c8..b3c1cd70b 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -180,9 +180,8 @@ void WebContentsDelegateQt::DidFinishLoad(int64, const GURL&, bool is_main_frame
     }
 }
 
-void WebContentsDelegateQt::DidUpdateFaviconURL(int32 page_id, const std::vector<content::FaviconURL>& candidates)
+void WebContentsDelegateQt::DidUpdateFaviconURL(const std::vector<content::FaviconURL>& candidates)
 {
-    Q_UNUSED(page_id)
     Q_FOREACH (content::FaviconURL candidate, candidates) {
         if (candidate.icon_type == content::FaviconURL::FAVICON && !candidate.icon_url.is_empty()) {
             content::NavigationEntry *entry = web_contents()->GetController().GetActiveEntry();
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index ebdee4cde..e4bc143c1 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -76,7 +76,7 @@ public:
     virtual void DidFailProvisionalLoad(int64 frame_id, const base::string16& frame_unique_name, bool is_main_frame, const GURL& validated_url, int error_code, const base::string16& error_description, content::RenderViewHost* render_view_host) Q_DECL_OVERRIDE;
     virtual void DidFailLoad(int64 frame_id, const GURL &validated_url, bool is_main_frame, int error_code, const base::string16 &error_description, content::RenderViewHost *render_view_host) Q_DECL_OVERRIDE;
     virtual void DidFinishLoad(int64 frame_id, const GURL &validated_url, bool is_main_frame, content::RenderViewHost *render_view_host) Q_DECL_OVERRIDE;
-    virtual void DidUpdateFaviconURL(int32 page_id, const std::vector<content::FaviconURL>& candidates) Q_DECL_OVERRIDE;
+    virtual void DidUpdateFaviconURL(const std::vector<content::FaviconURL>& candidates) Q_DECL_OVERRIDE;
     virtual content::JavaScriptDialogManager *GetJavaScriptDialogManager() Q_DECL_OVERRIDE;
     virtual void ToggleFullscreenModeForTab(content::WebContents* web_contents, bool enter_fullscreen) Q_DECL_OVERRIDE;
     virtual bool IsFullscreenForTabOrPending(const content::WebContents* web_contents) const Q_DECL_OVERRIDE;
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp
index 61a17fec3..02145ff14 100644
--- a/src/core/web_contents_view_qt.cpp
+++ b/src/core/web_contents_view_qt.cpp
@@ -59,7 +59,7 @@ void WebContentsViewQt::initialize(WebContentsAdapterClient* client)
         static_cast<RenderWidgetHostViewQt *>(m_webContents->GetRenderWidgetHostView())->setAdapterClient(client);
 }
 
-content::RenderWidgetHostView* WebContentsViewQt::CreateViewForWidget(content::RenderWidgetHost* render_widget_host)
+content::RenderWidgetHostViewBase* WebContentsViewQt::CreateViewForWidget(content::RenderWidgetHost* render_widget_host)
 {
     RenderWidgetHostViewQt *view = new RenderWidgetHostViewQt(render_widget_host);
 
@@ -73,7 +73,7 @@ content::RenderWidgetHostView* WebContentsViewQt::CreateViewForWidget(content::R
     return view;
 }
 
-content::RenderWidgetHostView* WebContentsViewQt::CreateViewForPopupWidget(content::RenderWidgetHost* render_widget_host)
+content::RenderWidgetHostViewBase* WebContentsViewQt::CreateViewForPopupWidget(content::RenderWidgetHost* render_widget_host)
 {
     RenderWidgetHostViewQt *view = new RenderWidgetHostViewQt(render_widget_host);
 
@@ -123,7 +123,7 @@ static WebEngineContextMenuData fromParams(const content::ContextMenuParams &par
     return ret;
 }
 
-void WebContentsViewQt::ShowContextMenu(const content::ContextMenuParams &params)
+void WebContentsViewQt::ShowContextMenu(content::RenderFrameHost *, const content::ContextMenuParams &params)
 {
     WebEngineContextMenuData contextMenuData(fromParams(params));
     m_client->contextMenuRequested(contextMenuData);
diff --git a/src/core/web_contents_view_qt.h b/src/core/web_contents_view_qt.h
index a2059cd9b..0c20f2f18 100644
--- a/src/core/web_contents_view_qt.h
+++ b/src/core/web_contents_view_qt.h
@@ -42,11 +42,11 @@
 #ifndef WEB_CONTENTS_VIEW_QT_H
 #define WEB_CONTENTS_VIEW_QT_H
 
+#include "content/browser/renderer_host/render_view_host_delegate_view.h"
 #include "content/browser/web_contents/web_contents_impl.h"
+#include "content/browser/web_contents/web_contents_view.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/render_widget_host.h"
-#include "content/port/browser/render_view_host_delegate_view.h"
-#include "content/port/browser/web_contents_view_port.h"
 
 #include "web_contents_adapter_client.h"
 #include "render_widget_host_view_qt.h"
@@ -54,7 +54,7 @@
 #include "web_engine_context.h"
 
 class WebContentsViewQt
-    : public content::WebContentsViewPort
+    : public content::WebContentsView
     , public content::RenderViewHostDelegateView
 {
 public:
@@ -69,11 +69,11 @@ public:
     void initialize(WebContentsAdapterClient* client);
     WebContentsAdapterClient *client() { return m_client; }
 
-    virtual content::RenderWidgetHostView *CreateViewForWidget(content::RenderWidgetHost* render_widget_host) Q_DECL_OVERRIDE;
+    virtual content::RenderWidgetHostViewBase *CreateViewForWidget(content::RenderWidgetHost* render_widget_host) Q_DECL_OVERRIDE;
 
     virtual void CreateView(const gfx::Size& initial_size, gfx::NativeView context) Q_DECL_OVERRIDE;
 
-    virtual content::RenderWidgetHostView* CreateViewForPopupWidget(content::RenderWidgetHost* render_widget_host) Q_DECL_OVERRIDE;
+    virtual content::RenderWidgetHostViewBase* CreateViewForPopupWidget(content::RenderWidgetHost* render_widget_host) Q_DECL_OVERRIDE;
 
     virtual void SetPageTitle(const base::string16& title) Q_DECL_OVERRIDE { }
 
@@ -91,8 +91,6 @@ public:
 
     virtual void GetContainerBounds(gfx::Rect* out) const Q_DECL_OVERRIDE;
 
-    virtual void OnTabCrashed(base::TerminationStatus status, int error_code) Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED }
-
     virtual void SizeContents(const gfx::Size& size) Q_DECL_OVERRIDE { QT_NOT_YET_IMPLEMENTED }
 
     virtual void Focus() Q_DECL_OVERRIDE;
@@ -112,7 +110,7 @@ public:
 
     virtual void StartDragging(const content::DropData& drop_data, blink::WebDragOperationsMask allowed_ops, const gfx::ImageSkia& image, const gfx::Vector2d& image_offset, const content::DragEventSourceInfo& event_info) Q_DECL_OVERRIDE;
 
-    virtual void ShowContextMenu(const content::ContextMenuParams &params) Q_DECL_OVERRIDE;
+    virtual void ShowContextMenu(content::RenderFrameHost *, const content::ContextMenuParams &params) Q_DECL_OVERRIDE;
 
     virtual void TakeFocus(bool reverse) Q_DECL_OVERRIDE;
 
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index 709000c10..03681f603 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -49,21 +49,21 @@
 #include "base/run_loop.h"
 #include "base/threading/thread_restrictions.h"
 #include "cc/base/switches.h"
+#include "content/browser/gpu/gpu_process_host.h"
+#include "content/browser/renderer_host/render_process_host_impl.h"
+#include "content/browser/utility_process_host_impl.h"
+#include "content/gpu/in_process_gpu_thread.h"
+#include "content/public/app/content_main.h"
 #include "content/public/app/content_main_runner.h"
 #include "content/public/browser/browser_main_runner.h"
 #include "content/public/common/content_paths.h"
 #include "content/public/common/content_switches.h"
 #include "content/public/common/main_function_params.h"
-#include "content/public/browser/utility_process_host.h"
-#include "content/public/browser/render_process_host.h"
-#include "content/browser/gpu/gpu_process_host.h"
-#include "content/utility/in_process_utility_thread.h"
 #include "content/renderer/in_process_renderer_thread.h"
-#include "content/gpu/in_process_gpu_thread.h"
+#include "content/utility/in_process_utility_thread.h"
+#include "gpu/command_buffer/service/gpu_switches.h"
 #include "ui/events/event_switches.h"
 #include "ui/gl/gl_switches.h"
-#include "gpu/command_buffer/service/gpu_switches.h"
-#include "webkit/common/user_agent/user_agent_util.h"
 #if defined(OS_WIN)
 #include "sandbox/win/src/sandbox_types.h"
 #include "content/public/app/startup_helper_win.h"
@@ -135,8 +135,6 @@ WebEngineContext::WebEngineContext()
     CommandLine::Init(argv.size(), argv.constData());
 
     CommandLine* parsedCommandLine = CommandLine::ForCurrentProcess();
-    // Mention the Chromium version we're based on to get passed stupid UA-string-based feature detection (several WebRTC demos need this)
-    parsedCommandLine->AppendSwitchASCII(switches::kUserAgent, webkit_glue::BuildUserAgentFromProduct("QtWebEngine/" QTWEBENGINECORE_VERSION_STR " Chrome/" CHROMIUM_VERSION));
     parsedCommandLine->AppendSwitchPath(switches::kBrowserSubprocessPath, WebEngineLibraryInfo::getPath(content::CHILD_PROCESS_EXE));
     parsedCommandLine->AppendSwitch(switches::kNoSandbox);
     parsedCommandLine->AppendSwitch(switches::kDisablePlugins);
@@ -189,17 +187,17 @@ WebEngineContext::WebEngineContext()
         && qApp->platformNativeInterface()->nativeResourceForWindow(QByteArrayLiteral("egldisplay"), 0))
         parsedCommandLine->AppendSwitchASCII(switches::kUseGL, gfx::kGLImplementationEGLName);
 
-    content::UtilityProcessHost::RegisterUtilityMainThreadFactory(content::CreateInProcessUtilityThread);
-    content::RenderProcessHost::RegisterRendererMainThreadFactory(content::CreateInProcessRendererThread);
+    content::UtilityProcessHostImpl::RegisterUtilityMainThreadFactory(content::CreateInProcessUtilityThread);
+    content::RenderProcessHostImpl::RegisterRendererMainThreadFactory(content::CreateInProcessRendererThread);
     content::GpuProcessHost::RegisterGpuMainThreadFactory(content::CreateInProcessGpuThread);
 
+    content::ContentMainParams contentMainParams(m_mainDelegate.get());
 #if defined(OS_WIN)
     sandbox::SandboxInterfaceInfo sandbox_info = {0};
     content::InitializeSandboxInfo(&sandbox_info);
-    m_contentRunner->Initialize(0, &sandbox_info, m_mainDelegate.get());
-#else
-    m_contentRunner->Initialize(0, 0, m_mainDelegate.get());
+    contentMainParams.sandbox_info = &sandbox_info;
 #endif
+    m_contentRunner->Initialize(contentMainParams);
     m_browserRunner->Initialize(content::MainFunctionParams(*CommandLine::ForCurrentProcess()));
 
     // Once the MessageLoop has been created, attach a top-level RunLoop.
diff --git a/src/core/web_engine_library_info.cpp b/src/core/web_engine_library_info.cpp
index fd1748d00..952c614f2 100644
--- a/src/core/web_engine_library_info.cpp
+++ b/src/core/web_engine_library_info.cpp
@@ -170,6 +170,8 @@ base::FilePath WebEngineLibraryInfo::getPath(int key)
     case base::DIR_USER_DESKTOP:
         directory = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
         break;
+    case base::DIR_QT_LIBRARY_DATA:
+        return toFilePath(location(QLibraryInfo::DataPath));
 #if defined(OS_ANDROID)
     case base::DIR_SOURCE_ROOT:
     case base::DIR_ANDROID_EXTERNAL_STORAGE:
diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp
index bdbd25155..4d0e727e3 100644
--- a/src/core/web_engine_settings.cpp
+++ b/src/core/web_engine_settings.cpp
@@ -258,7 +258,6 @@ void WebEngineSettings::doApply()
 
 void WebEngineSettings::applySettingsToWebPreferences(WebPreferences *prefs)
 {
-    Q_ASSERT(prefs->accelerated_compositing_enabled);
     // Override for now
     prefs->java_enabled = false;
 
diff --git a/src/core/yuv_video_node.cpp b/src/core/yuv_video_node.cpp
index e6c0c7da9..362ad5bde 100644
--- a/src/core/yuv_video_node.cpp
+++ b/src/core/yuv_video_node.cpp
@@ -58,16 +58,17 @@ public:
 
 protected:
     virtual const char *vertexShader() const Q_DECL_OVERRIDE {
-        // Keep in sync with cc::VertexShaderPosTexYUVStretch
+        // Keep in sync with cc::VertexShaderPosTexYUVStretchOffset
         const char *shader =
         "attribute highp vec4 a_position;\n"
         "attribute mediump vec2 a_texCoord;\n"
         "uniform highp mat4 matrix;\n"
         "varying mediump vec2 v_texCoord;\n"
         "uniform mediump vec2 texScale;\n"
+        "uniform mediump vec2 texOffset;\n"
         "void main() {\n"
         "  gl_Position = matrix * a_position;\n"
-        "  v_texCoord = a_texCoord * texScale;\n"
+        "  v_texCoord = a_texCoord * texScale + texOffset;\n"
         "}";
         return shader;
     }
@@ -96,6 +97,7 @@ protected:
     virtual void initialize() Q_DECL_OVERRIDE {
         m_id_matrix = program()->uniformLocation("matrix");
         m_id_texScale = program()->uniformLocation("texScale");
+        m_id_texOffset = program()->uniformLocation("texOffset");
         m_id_yTexture = program()->uniformLocation("y_texture");
         m_id_uTexture = program()->uniformLocation("u_texture");
         m_id_vTexture = program()->uniformLocation("v_texture");
@@ -106,6 +108,7 @@ protected:
 
     int m_id_matrix;
     int m_id_texScale;
+    int m_id_texOffset;
     int m_id_yTexture;
     int m_id_uTexture;
     int m_id_vTexture;
@@ -122,8 +125,6 @@ protected:
     virtual const char *fragmentShader() const Q_DECL_OVERRIDE {
         // Keep in sync with cc::FragmentShaderYUVAVideo
         static const char *shader =
-        // "precision mediump float;\n"
-        // "precision mediump int;\n"
         "varying mediump vec2 v_texCoord;\n"
         "uniform sampler2D y_texture;\n"
         "uniform sampler2D u_texture;\n"
@@ -169,7 +170,8 @@ void YUVVideoMaterialShader::updateState(const RenderState &state, QSGMaterial *
     glActiveTexture(GL_TEXTURE0); // Finish with 0 as default texture unit
     mat->m_yTexture->bind();
 
-    program()->setUniformValue(m_id_texScale, mat->m_texScale);
+    program()->setUniformValue(m_id_texOffset, mat->m_texCoordRect.topLeft());
+    program()->setUniformValue(m_id_texScale, mat->m_texCoordRect.size());
 
     // These values are magic numbers that are used in the transformation from YUV
     // to RGB color values.  They are taken from the following webpage:
@@ -213,11 +215,11 @@ void YUVAVideoMaterialShader::updateState(const RenderState &state, QSGMaterial
 }
 
 
-YUVVideoMaterial::YUVVideoMaterial(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, const QSizeF &texScale)
+YUVVideoMaterial::YUVVideoMaterial(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, const QRectF &texCoordRect)
     : m_yTexture(yTexture)
     , m_uTexture(uTexture)
     , m_vTexture(vTexture)
-    , m_texScale(texScale)
+    , m_texCoordRect(texCoordRect)
 {
 }
 
@@ -236,8 +238,8 @@ int YUVVideoMaterial::compare(const QSGMaterial *other) const
     return m_vTexture->textureId() - m->m_vTexture->textureId();
 }
 
-YUVAVideoMaterial::YUVAVideoMaterial(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, QSGTexture *aTexture, const QSizeF &texScale)
-    : YUVVideoMaterial(yTexture, uTexture, vTexture, texScale)
+YUVAVideoMaterial::YUVAVideoMaterial(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, QSGTexture *aTexture, const QRectF &texCoordRect)
+    : YUVVideoMaterial(yTexture, uTexture, vTexture, texCoordRect)
     , m_aTexture(aTexture)
 {
     setFlag(Blending, aTexture);
@@ -256,15 +258,15 @@ int YUVAVideoMaterial::compare(const QSGMaterial *other) const
     return (m_aTexture ? m_aTexture->textureId() : 0) - (m->m_aTexture ? m->m_aTexture->textureId() : 0);
 }
 
-YUVVideoNode::YUVVideoNode(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, QSGTexture *aTexture, const QSizeF &texScale)
+YUVVideoNode::YUVVideoNode(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, QSGTexture *aTexture, const QRectF &texCoordRect)
     : m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 4)
 {
     setGeometry(&m_geometry);
     setFlag(QSGNode::OwnsMaterial);
     if (aTexture)
-        m_material = new YUVAVideoMaterial(yTexture, uTexture, vTexture, aTexture, texScale);
+        m_material = new YUVAVideoMaterial(yTexture, uTexture, vTexture, aTexture, texCoordRect);
     else
-        m_material = new YUVVideoMaterial(yTexture, uTexture, vTexture, texScale);
+        m_material = new YUVVideoMaterial(yTexture, uTexture, vTexture, texCoordRect);
     setMaterial(m_material);
 }
 
diff --git a/src/core/yuv_video_node.h b/src/core/yuv_video_node.h
index 509ef40e6..7ca45d1e4 100644
--- a/src/core/yuv_video_node.h
+++ b/src/core/yuv_video_node.h
@@ -55,7 +55,7 @@ QT_END_NAMESPACE
 class YUVVideoMaterial : public QSGMaterial
 {
 public:
-    YUVVideoMaterial(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, const QSizeF &texScale);
+    YUVVideoMaterial(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, const QRectF &texCoordRect);
 
     virtual QSGMaterialType *type() const Q_DECL_OVERRIDE {
         static QSGMaterialType theType;
@@ -68,13 +68,13 @@ public:
     QSGTexture *m_yTexture;
     QSGTexture *m_uTexture;
     QSGTexture *m_vTexture;
-    QSizeF m_texScale;
+    QRectF m_texCoordRect;
 };
 
 class YUVAVideoMaterial : public YUVVideoMaterial
 {
 public:
-    YUVAVideoMaterial(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, QSGTexture *aTexture, const QSizeF &texScale);
+    YUVAVideoMaterial(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, QSGTexture *aTexture, const QRectF &texCoordRect);
 
     virtual QSGMaterialType *type() const Q_DECL_OVERRIDE{
         static QSGMaterialType theType;
@@ -90,7 +90,7 @@ public:
 class YUVVideoNode : public QSGGeometryNode
 {
 public:
-    YUVVideoNode(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, QSGTexture *aTexture, const QSizeF &texScale);
+    YUVVideoNode(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, QSGTexture *aTexture, const QRectF &texCoordRect);
     void setRect(const QRectF &rect);
 
 private:
diff --git a/tools/buildscripts/gyp_qtwebengine b/tools/buildscripts/gyp_qtwebengine
index 29d33a802..1bda49855 100755
--- a/tools/buildscripts/gyp_qtwebengine
+++ b/tools/buildscripts/gyp_qtwebengine
@@ -77,16 +77,6 @@ if __name__ == '__main__':
   if 'qt_cross_compile=1' in sys.argv:
     os.environ['GYP_CROSSCOMPILE'] = '1'
 
-  # On Windows we have to update the path of Chromium's Cygwin in registry to ensure current build
-  # uses Cygwin from the current source directory.
-  if sys.platform.startswith('win32'):
-    print 'Updating Cygwin\'s path in registry...'
-    setup_mount = os.path.abspath(os.path.join(chrome_src,'third_party','cygwin','setup_mount.bat'))
-    ret = subprocess.call(setup_mount)
-    if ret != 0:
-      print 'Failed to run', setup_mount
-      sys.exit(1)
-
   # On Mac we want to override CXX and CC that is provided with
   # the Chromium GYP environment.
   if sys.platform.startswith('darwin') and not 'GYP_CROSSCOMPILE' in os.environ:
@@ -141,10 +131,12 @@ if __name__ == '__main__':
   args.extend(['-D', 'qtwebengine_root=' + qtwebengine_root])
   args.extend(['-D', 'chromium_src_dir=' + chrome_src])
 
-  # linux_use_gold_binary currently relies on a hardcoded relative path from chromium/src/out/(Release|Debug)
+  # linux_use_bundled_gold currently relies on a hardcoded relative path from chromium/src/out/(Release|Debug)
   # Disable it along with the -Wl,--threads flag just in case gold isn't installed on the system.
-  args.extend(['-D', 'linux_use_gold_binary=0'])
+  args.extend(['-D', 'linux_use_bundled_gold=0'])
+  args.extend(['-D', 'linux_use_bundled_binutils=0'])
   args.extend(['-D', 'linux_use_gold_flags=0'])
+  args.extend(['-D', 'clang_use_chrome_plugins=0'])
   # Trigger Qt-specific build conditions.
   args.extend(['-D', 'use_qt=1'])
   # Tweak the output location and format (hardcode ninja for now if not set)
diff --git a/tools/scripts/version_resolver.py b/tools/scripts/version_resolver.py
index 396fc626a..0a9ed813b 100644
--- a/tools/scripts/version_resolver.py
+++ b/tools/scripts/version_resolver.py
@@ -51,8 +51,8 @@ import json
 import urllib2
 import git_submodule as GitSubmodule
 
-chromium_version = '33.0.1750.170'
-chromium_branch = '1750'
+chromium_version = '37.0.2062.68'
+chromium_branch = '2062'
 
 json_url = 'http://omahaproxy.appspot.com/all.json'
 git_deps_url = 'http://src.chromium.org/chrome/branches/' + chromium_branch + '/src/.DEPS.git'
-- 
GitLab