summaryrefslogtreecommitdiffstats
path: root/src/core/renderer_host
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-09-14 10:08:51 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-09-14 11:06:37 +0200
commitbdeb81b73122d6962ca4796c573dcbc636ccb195 (patch)
tree946530bfe0f7bd506ea26633f8374fde5180c6cb /src/core/renderer_host
parent529623a9f3590ac0ac3baf3ccece793c0ce7f825 (diff)
parentc7d46325e635d1fb4482b53dce866e2c55026a7e (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Diffstat (limited to 'src/core/renderer_host')
-rw-r--r--src/core/renderer_host/user_resource_controller_host.cpp5
-rw-r--r--src/core/renderer_host/web_channel_ipc_transport_host.cpp14
-rw-r--r--src/core/renderer_host/web_channel_ipc_transport_host.h1
3 files changed, 11 insertions, 9 deletions
diff --git a/src/core/renderer_host/user_resource_controller_host.cpp b/src/core/renderer_host/user_resource_controller_host.cpp
index f90aebda6..2799d5d85 100644
--- a/src/core/renderer_host/user_resource_controller_host.cpp
+++ b/src/core/renderer_host/user_resource_controller_host.cpp
@@ -88,11 +88,6 @@ void UserResourceControllerHost::WebContentsObserverHelper::RenderFrameHostChang
{
if (oldHost)
oldHost->Send(new RenderFrameObserverHelper_ClearScripts(oldHost->GetRoutingID()));
-
- content::WebContents *contents = web_contents();
- Q_FOREACH (const UserScript &script, m_controllerHost->m_perContentsScripts.value(contents))
- newHost->Send(new RenderFrameObserverHelper_AddScript(newHost->GetRoutingID(),
- script.data()));
}
void UserResourceControllerHost::WebContentsObserverHelper::WebContentsDestroyed()
diff --git a/src/core/renderer_host/web_channel_ipc_transport_host.cpp b/src/core/renderer_host/web_channel_ipc_transport_host.cpp
index 1cd4e4063..c47b255b7 100644
--- a/src/core/renderer_host/web_channel_ipc_transport_host.cpp
+++ b/src/core/renderer_host/web_channel_ipc_transport_host.cpp
@@ -40,6 +40,7 @@
#include "web_channel_ipc_transport_host.h"
#include "base/strings/string16.h"
+#include "content/public/browser/render_view_host.h"
#include "common/qt_messages.h"
#include "type_conversion.h"
@@ -61,11 +62,16 @@ WebChannelIPCTransportHost::~WebChannelIPCTransportHost()
{
}
-void WebChannelIPCTransportHost::RenderViewHostChanged(content::RenderViewHost *, content::RenderViewHost *)
+void WebChannelIPCTransportHost::RenderViewHostChanged(content::RenderViewHost *oldHost, content::RenderViewHost *)
{
- // This means that we were moved into a different RenderView, possibly in a different
- // render process and that we lost our WebChannelIPCTransport object and its state.
- Send(new WebChannelIPCTransport_Install(routing_id(), m_worldId));
+ if (oldHost)
+ oldHost->Send(new WebChannelIPCTransport_Uninstall(oldHost->GetRoutingID(), m_worldId));
+}
+
+void WebChannelIPCTransportHost::RenderViewCreated(content::RenderViewHost *view_host)
+{
+ // Make sure the new view knows a webchannel is installed and in which world.
+ view_host->Send(new WebChannelIPCTransport_Install(view_host->GetRoutingID(), m_worldId));
}
void WebChannelIPCTransportHost::setWorldId(uint worldId)
diff --git a/src/core/renderer_host/web_channel_ipc_transport_host.h b/src/core/renderer_host/web_channel_ipc_transport_host.h
index aa406471c..a1e697a91 100644
--- a/src/core/renderer_host/web_channel_ipc_transport_host.h
+++ b/src/core/renderer_host/web_channel_ipc_transport_host.h
@@ -60,6 +60,7 @@ public:
// WebContentsObserver
void RenderViewHostChanged(content::RenderViewHost* old_host, content::RenderViewHost* new_host) override;
+ void RenderViewCreated(content::RenderViewHost* render_view_host) override;
// QWebChannelAbstractTransport
void sendMessage(const QJsonObject &message) override;