diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2017-12-19 12:37:02 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-01-25 14:41:06 +0000 |
commit | f4a8ce98bd371acf1ca1eb2c58a8403e8795a670 (patch) | |
tree | 1f2305261b605aae31e5f8737ffcb275986baf1e /src/core/renderer_host | |
parent | 448478729cfdf5098dd24a6a870bacdbcd8cf9a7 (diff) |
Adaptations for Chromium 63
Change-Id: I551c7091bbc0463bed94180313eb2bfe92f0ad84
Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
Diffstat (limited to 'src/core/renderer_host')
-rw-r--r-- | src/core/renderer_host/user_resource_controller_host.cpp | 18 | ||||
-rw-r--r-- | src/core/renderer_host/web_channel_ipc_transport_host.cpp | 22 |
2 files changed, 28 insertions, 12 deletions
diff --git a/src/core/renderer_host/user_resource_controller_host.cpp b/src/core/renderer_host/user_resource_controller_host.cpp index 2799d5d85..a9071df8f 100644 --- a/src/core/renderer_host/user_resource_controller_host.cpp +++ b/src/core/renderer_host/user_resource_controller_host.cpp @@ -142,9 +142,10 @@ void UserResourceControllerHost::addUserScript(const UserScript &script, WebCont m_perContentsScripts.insert(contents, currentScripts); } } - contents->Send(new RenderFrameObserverHelper_AddScript(contents->GetRenderViewHost()-> - GetMainFrame()->GetRoutingID(), - script.data())); + contents->GetRenderViewHost()->Send( + new RenderFrameObserverHelper_AddScript( + contents->GetRenderViewHost()->GetMainFrame()->GetRoutingID(), + script.data())); } } @@ -180,9 +181,10 @@ bool UserResourceControllerHost::removeUserScript(const UserScript &script, WebC QList<UserScript>::iterator it = std::find(list.begin(), list.end(), script); if (it == list.end()) return false; - contents->Send(new RenderFrameObserverHelper_RemoveScript(contents-> - GetMainFrame()->GetRoutingID(), - (*it).data())); + contents->GetRenderViewHost()->Send( + new RenderFrameObserverHelper_RemoveScript( + contents->GetMainFrame()->GetRoutingID(), + (*it).data())); list.erase(it); } return true; @@ -198,8 +200,8 @@ void UserResourceControllerHost::clearAllScripts(WebContentsAdapter *adapter) } else { content::WebContents *contents = adapter->webContents(); m_perContentsScripts.remove(contents); - contents->Send(new RenderFrameObserverHelper_ClearScripts(contents-> - GetMainFrame()->GetRoutingID())); + contents->GetRenderViewHost()->Send( + new RenderFrameObserverHelper_ClearScripts(contents->GetMainFrame()->GetRoutingID())); } } 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 c47b255b7..b624d7e45 100644 --- a/src/core/renderer_host/web_channel_ipc_transport_host.cpp +++ b/src/core/renderer_host/web_channel_ipc_transport_host.cpp @@ -41,6 +41,7 @@ #include "base/strings/string16.h" #include "content/public/browser/render_view_host.h" +#include "content/public/browser/web_contents.h" #include "common/qt_messages.h" #include "type_conversion.h" @@ -55,7 +56,10 @@ WebChannelIPCTransportHost::WebChannelIPCTransportHost(content::WebContents *con , content::WebContentsObserver(contents) , m_worldId(worldId) { - Send(new WebChannelIPCTransport_Install(routing_id(), m_worldId)); + contents->GetRenderViewHost()->Send( + new WebChannelIPCTransport_Install( + contents->GetRenderViewHost()->GetRoutingID(), + m_worldId)); } WebChannelIPCTransportHost::~WebChannelIPCTransportHost() @@ -78,9 +82,15 @@ void WebChannelIPCTransportHost::setWorldId(uint worldId) { if (worldId == m_worldId) return; - Send(new WebChannelIPCTransport_Uninstall(routing_id(), m_worldId)); + web_contents()->GetRenderViewHost()->Send( + new WebChannelIPCTransport_Uninstall( + web_contents()->GetRenderViewHost()->GetRoutingID(), + m_worldId)); m_worldId = worldId; - Send(new WebChannelIPCTransport_Install(routing_id(), m_worldId)); + web_contents()->GetRenderViewHost()->Send( + new WebChannelIPCTransport_Install( + web_contents()->GetRenderViewHost()->GetRoutingID(), + m_worldId)); } void WebChannelIPCTransportHost::sendMessage(const QJsonObject &message) @@ -88,7 +98,11 @@ void WebChannelIPCTransportHost::sendMessage(const QJsonObject &message) QJsonDocument doc(message); int size = 0; const char *rawData = doc.rawData(&size); - Send(new WebChannelIPCTransport_Message(routing_id(), std::vector<char>(rawData, rawData + size), m_worldId)); + web_contents()->GetRenderViewHost()->Send( + new WebChannelIPCTransport_Message( + web_contents()->GetRenderViewHost()->GetRoutingID(), + std::vector<char>(rawData, rawData + size), + m_worldId)); } void WebChannelIPCTransportHost::onWebChannelMessage(const std::vector<char> &message) |