Commit 6d9a8c68 authored by arthursonzogni's avatar arthursonzogni Committed by Commit Bot

Update signature of RFHM::CreateRenderFrameProxy.

It used to return the routing_id of the RenderFrameProxyHost for which a
RenderFrameProxy was initialized. This is a bit arbitrary and as a
result, among 6 callers, nobody was using it, except BrowserPluginHost.
It is probably better to return nothing instead.

Bug: None.
Change-Id: Idcc46d469f3eae53cabd5d09fa29636165804b69
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1614177
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: default avatarAlex Moshchuk <alexmos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#661320}
parent 3bab99c8
...@@ -171,14 +171,14 @@ int BrowserPluginGuest::GetGuestProxyRoutingID() { ...@@ -171,14 +171,14 @@ int BrowserPluginGuest::GetGuestProxyRoutingID() {
SiteInstance* owner_site_instance = delegate_->GetOwnerSiteInstance(); SiteInstance* owner_site_instance = delegate_->GetOwnerSiteInstance();
if (!owner_site_instance) if (!owner_site_instance)
return MSG_ROUTING_NONE; return MSG_ROUTING_NONE;
int proxy_routing_id = GetWebContents()
->GetFrameTree() RenderFrameHostManager* rfh_manager =
->root() GetWebContents()->GetFrameTree()->root()->render_manager();
->render_manager() rfh_manager->CreateRenderFrameProxy(owner_site_instance);
->CreateRenderFrameProxy(owner_site_instance); guest_proxy_routing_id_ =
guest_proxy_routing_id_ = RenderFrameProxyHost::FromID( rfh_manager->GetRenderFrameProxyHost(owner_site_instance)
owner_site_instance->GetProcess()->GetID(), proxy_routing_id) ->GetRenderViewHost()
->GetRenderViewHost()->GetRoutingID(); ->GetRoutingID();
return guest_proxy_routing_id_; return guest_proxy_routing_id_;
} }
......
...@@ -2000,16 +2000,16 @@ std::unique_ptr<RenderFrameHostImpl> RenderFrameHostManager::CreateRenderFrame( ...@@ -2000,16 +2000,16 @@ std::unique_ptr<RenderFrameHostImpl> RenderFrameHostManager::CreateRenderFrame(
return new_render_frame_host; return new_render_frame_host;
} }
int RenderFrameHostManager::CreateRenderFrameProxy(SiteInstance* instance) { void RenderFrameHostManager::CreateRenderFrameProxy(SiteInstance* instance) {
// A RenderFrameProxyHost should never be created in the same SiteInstance as // A RenderFrameProxyHost should never be created in the same SiteInstance as
// the current RFH. // the current RFH.
CHECK(instance); CHECK(instance);
CHECK_NE(instance, render_frame_host_->GetSiteInstance()); CHECK_NE(instance, render_frame_host_->GetSiteInstance());
// Return an already existing RenderFrameProxyHost if one exists and is alive. // If a proxy already exists and is alive, nothing needs to be done.
RenderFrameProxyHost* proxy = GetRenderFrameProxyHost(instance); RenderFrameProxyHost* proxy = GetRenderFrameProxyHost(instance);
if (proxy && proxy->is_render_frame_proxy_live()) if (proxy && proxy->is_render_frame_proxy_live())
return proxy->GetRoutingID(); return;
// At this point we know that we either have to 1) create a new // At this point we know that we either have to 1) create a new
// RenderFrameProxyHost or 2) revive an existing, but no longer alive // RenderFrameProxyHost or 2) revive an existing, but no longer alive
...@@ -2035,8 +2035,6 @@ int RenderFrameHostManager::CreateRenderFrameProxy(SiteInstance* instance) { ...@@ -2035,8 +2035,6 @@ int RenderFrameHostManager::CreateRenderFrameProxy(SiteInstance* instance) {
} else { } else {
proxy->InitRenderFrameProxy(); proxy->InitRenderFrameProxy();
} }
return proxy->GetRoutingID();
} }
void RenderFrameHostManager::CreateProxiesForChildFrame(FrameTreeNode* child) { void RenderFrameHostManager::CreateProxiesForChildFrame(FrameTreeNode* child) {
......
...@@ -297,9 +297,8 @@ class CONTENT_EXPORT RenderFrameHostManager ...@@ -297,9 +297,8 @@ class CONTENT_EXPORT RenderFrameHostManager
std::unique_ptr<RenderFrameHostImpl> CreateRenderFrame(SiteInstance* instance, std::unique_ptr<RenderFrameHostImpl> CreateRenderFrame(SiteInstance* instance,
bool hidden); bool hidden);
// Helper method to create and initialize a RenderFrameProxyHost and return // Helper method to create and initialize a RenderFrameProxyHost.
// its routing id. void CreateRenderFrameProxy(SiteInstance* instance);
int CreateRenderFrameProxy(SiteInstance* instance);
// Creates proxies for a new child frame at FrameTreeNode |child| in all // Creates proxies for a new child frame at FrameTreeNode |child| in all
// SiteInstances for which the current frame has proxies. This method is // SiteInstances for which the current frame has proxies. This method is
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment