Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 469 | 469 |
| 470 RenderFrameHostImpl::~RenderFrameHostImpl() { | 470 RenderFrameHostImpl::~RenderFrameHostImpl() { |
| 471 // Destroying navigation handle may call into delegates/observers, | 471 // Destroying navigation handle may call into delegates/observers, |
| 472 // so we do it early while |this| object is still in a sane state. | 472 // so we do it early while |this| object is still in a sane state. |
| 473 navigation_handle_.reset(); | 473 navigation_handle_.reset(); |
| 474 | 474 |
| 475 // Release the WebUI instances before all else as the WebUI may accesses the | 475 // Release the WebUI instances before all else as the WebUI may accesses the |
| 476 // RenderFrameHost during cleanup. | 476 // RenderFrameHost during cleanup. |
| 477 ClearAllWebUI(); | 477 ClearAllWebUI(); |
| 478 | 478 |
| 479 if (!last_committed_url_.is_empty()) { | |
|
Charlie Reis
2017/05/15 03:41:52
I wonder whether using last_committed_url_ here is
clamy
2017/05/16 14:50:45
I'm now storing the last_committed_site_url_. I'm
| |
| 480 RenderProcessHostImpl::RemoveFrameWithSite( | |
| 481 frame_tree_node_->navigator()->GetController()->GetBrowserContext(), | |
| 482 GetProcess(), last_committed_url_); | |
| 483 } | |
| 484 | |
| 479 GetProcess()->RemoveRoute(routing_id_); | 485 GetProcess()->RemoveRoute(routing_id_); |
| 480 g_routing_id_frame_map.Get().erase( | 486 g_routing_id_frame_map.Get().erase( |
| 481 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); | 487 RenderFrameHostID(GetProcess()->GetID(), routing_id_)); |
| 482 | 488 |
| 483 if (overlay_routing_token_) | 489 if (overlay_routing_token_) |
| 484 g_token_frame_map.Get().erase(*overlay_routing_token_); | 490 g_token_frame_map.Get().erase(*overlay_routing_token_); |
| 485 | 491 |
| 486 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 492 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 487 base::Bind(&NotifyRenderFrameDetachedOnIO, | 493 base::Bind(&NotifyRenderFrameDetachedOnIO, |
| 488 GetProcess()->GetID(), routing_id_)); | 494 GetProcess()->GetID(), routing_id_)); |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1153 frame_tree_->AddFrame(frame_tree_node_, GetProcess()->GetID(), new_routing_id, | 1159 frame_tree_->AddFrame(frame_tree_node_, GetProcess()->GetID(), new_routing_id, |
| 1154 scope, frame_name, frame_unique_name, sandbox_flags, | 1160 scope, frame_name, frame_unique_name, sandbox_flags, |
| 1155 container_policy, frame_owner_properties); | 1161 container_policy, frame_owner_properties); |
| 1156 } | 1162 } |
| 1157 | 1163 |
| 1158 void RenderFrameHostImpl::SetLastCommittedOrigin(const url::Origin& origin) { | 1164 void RenderFrameHostImpl::SetLastCommittedOrigin(const url::Origin& origin) { |
| 1159 last_committed_origin_ = origin; | 1165 last_committed_origin_ = origin; |
| 1160 CSPContext::SetSelf(origin); | 1166 CSPContext::SetSelf(origin); |
| 1161 } | 1167 } |
| 1162 | 1168 |
| 1169 void RenderFrameHostImpl::SetLastCommittedUrl(const GURL& url) { | |
| 1170 BrowserContext* browser_context = | |
| 1171 frame_tree_node_->navigator()->GetController()->GetBrowserContext(); | |
| 1172 | |
| 1173 if (!last_committed_url_.is_empty()) { | |
|
nasko
2017/05/05 05:22:00
Since we are registering only origins, should we e
Charlie Reis
2017/05/15 03:41:52
Yes, I agree that we need to be careful about what
clamy
2017/05/16 14:50:45
I'm now storing the site_url as suggested above, s
| |
| 1174 RenderProcessHostImpl::RemoveFrameWithSite(browser_context, GetProcess(), | |
| 1175 last_committed_url_); | |
| 1176 } | |
| 1177 | |
| 1178 last_committed_url_ = url; | |
| 1179 | |
| 1180 RenderProcessHostImpl::AddFrameWithSite(browser_context, GetProcess(), | |
| 1181 last_committed_url_); | |
| 1182 } | |
| 1183 | |
| 1163 void RenderFrameHostImpl::OnDetach() { | 1184 void RenderFrameHostImpl::OnDetach() { |
| 1164 frame_tree_->RemoveFrame(frame_tree_node_); | 1185 frame_tree_->RemoveFrame(frame_tree_node_); |
| 1165 } | 1186 } |
| 1166 | 1187 |
| 1167 void RenderFrameHostImpl::OnFrameFocused() { | 1188 void RenderFrameHostImpl::OnFrameFocused() { |
| 1168 delegate_->SetFocusedFrame(frame_tree_node_, GetSiteInstance()); | 1189 delegate_->SetFocusedFrame(frame_tree_node_, GetSiteInstance()); |
| 1169 } | 1190 } |
| 1170 | 1191 |
| 1171 void RenderFrameHostImpl::OnOpenURL(const FrameHostMsg_OpenURL_Params& params) { | 1192 void RenderFrameHostImpl::OnOpenURL(const FrameHostMsg_OpenURL_Params& params) { |
| 1172 GURL validated_url(params.url); | 1193 GURL validated_url(params.url); |
| (...skipping 2729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3902 } | 3923 } |
| 3903 | 3924 |
| 3904 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( | 3925 void RenderFrameHostImpl::ForwardGetInterfaceToRenderFrame( |
| 3905 const std::string& interface_name, | 3926 const std::string& interface_name, |
| 3906 mojo::ScopedMessagePipeHandle pipe) { | 3927 mojo::ScopedMessagePipeHandle pipe) { |
| 3907 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); | 3928 GetRemoteInterfaces()->GetInterface(interface_name, std::move(pipe)); |
| 3908 } | 3929 } |
| 3909 #endif | 3930 #endif |
| 3910 | 3931 |
| 3911 } // namespace content | 3932 } // namespace content |
| OLD | NEW |